]> source.dussan.org Git - poi.git/commitdiff
Add getters for the common xml extended properties
authorNick Burch <nick@apache.org>
Wed, 3 Sep 2014 13:47:50 +0000 (13:47 +0000)
committerNick Burch <nick@apache.org>
Wed, 3 Sep 2014 13:47:50 +0000 (13:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1622257 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/POIXMLProperties.java
src/ooxml/testcases/org/apache/poi/TestPOIXMLProperties.java

index a58af001800013159da82ebd285326b4df818c0a..27c1c49d11e2584070726c458705fe4fe911814a 100644 (file)
@@ -286,6 +286,116 @@ public class POIXMLProperties {
                        return props.getProperties();
                }
                
+        public String getTemplate() {
+            if (props.getProperties().isSetTemplate()) {
+                return props.getProperties().getTemplate();
+            }
+            return null;
+        }
+        public String getManager() {
+            if (props.getProperties().isSetManager()) {
+                return props.getProperties().getManager();
+            }
+            return null;
+        }
+        public String getCompany() {
+            if (props.getProperties().isSetCompany()) {
+                return props.getProperties().getCompany();
+            }
+            return null;
+        }
+        public String getPresentationFormat() {
+            if (props.getProperties().isSetPresentationFormat()) {
+                return props.getProperties().getPresentationFormat();
+            }
+            return null;
+        }
+        public String getApplication() {
+            if (props.getProperties().isSetApplication()) {
+                return props.getProperties().getApplication();
+            }
+            return null;
+        }
+        public String getAppVersion() {
+            if (props.getProperties().isSetAppVersion()) {
+                return props.getProperties().getAppVersion();
+            }
+            return null;
+        }
+
+        public int getPages() {
+            if (props.getProperties().isSetPages()) {
+                return props.getProperties().getPages();
+            }
+            return -1;
+        }
+        public int getWords() {
+            if (props.getProperties().isSetWords()) {
+                return props.getProperties().getWords();
+            }
+            return -1;
+        }
+        public int getCharacters() {
+            if (props.getProperties().isSetCharacters()) {
+                return props.getProperties().getCharacters();
+            }
+            return -1;
+        }
+        public int getCharactersWithSpaces() {
+            if (props.getProperties().isSetCharactersWithSpaces()) {
+                return props.getProperties().getCharactersWithSpaces();
+            }
+            return -1;
+        }
+        public int getLines() {
+            if (props.getProperties().isSetLines()) {
+                return props.getProperties().getLines();
+            }
+            return -1;
+        }
+        public int getParagraphs() {
+            if (props.getProperties().isSetParagraphs()) {
+                return props.getProperties().getParagraphs();
+            }
+            return -1;
+        }
+        public int getSlides() {
+            if (props.getProperties().isSetSlides()) {
+                return props.getProperties().getSlides();
+            }
+            return -1;
+        }
+        public int getNotes() {
+            if (props.getProperties().isSetNotes()) {
+                return props.getProperties().getNotes();
+            }
+            return -1;
+        }
+        public int getTotalTime()  {
+            if (props.getProperties().isSetTotalTime()) {
+                return props.getProperties().getTotalTime();
+            }
+            return -1;
+        }
+        public int getHiddenSlides()  {
+            if (props.getProperties().isSetHiddenSlides()) {
+                return props.getProperties().getHiddenSlides();
+            }
+            return -1;
+        }
+        public int getMMClips() {
+            if (props.getProperties().isSetMMClips()) {
+                return props.getProperties().getMMClips();
+            }
+            return -1;
+        }
+
+        public String getHyperlinkBase() {
+            if (props.getProperties().isSetHyperlinkBase()) {
+                return props.getProperties().getHyperlinkBase();
+            }
+            return null;
+        }
        }
 
        /**
index c7215a406169c4e41fcdc986d64dae730dc59692..e185543020b59718a489ac0e562b8de27e4fa5c0 100644 (file)
@@ -80,13 +80,14 @@ public final class TestPOIXMLProperties extends TestCase {
                org.apache.poi.POIXMLProperties.ExtendedProperties newProperties =
                                newProps.getExtendedProperties();
 
+        assertEquals(application, newProperties.getApplication());
+        assertEquals(appVersion, newProperties.getAppVersion());
+        
                org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.CTProperties
                                newCtProps = newProperties.getUnderlyingProperties();
 
                assertEquals(application, newCtProps.getApplication());
                assertEquals(appVersion, newCtProps.getAppVersion());
-
-
        }