- Timestamp:
- 11/12/10 07:29:55 (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/OpcPackage.java
r1162 r1307 232 232 docPropsCorePart = (DocPropsCorePart)part; 233 233 return true; 234 } else if (relationshipType.equals(Namespaces.PROPERTIES_CUSTOM)) { 235 docPropsCustomPart = (DocPropsCustomPart)part; 236 return true; 234 237 } else if (relationshipType.equals(Namespaces.PROPERTIES_EXTENDED)) { 235 238 docPropsExtendedPart = (DocPropsExtendedPart)part; … … 241 244 242 245 public DocPropsCorePart getDocPropsCorePart() { 243 if (docPropsCorePart==null) {244 try {245 docPropsCorePart = new org.docx4j.openpackaging.parts.DocPropsCorePart();246 this.addTargetPart(docPropsCorePart);247 248 org.docx4j.docProps.core.ObjectFactory factory =249 new org.docx4j.docProps.core.ObjectFactory();250 org.docx4j.docProps.core.CoreProperties properties = factory.createCoreProperties();251 ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsCorePart).setJaxbElement((Object)properties);252 ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsCorePart).setJAXBContext(Context.jcDocPropsCore);253 } catch (InvalidFormatException e) {254 // TODO Auto-generated catch block255 e.printStackTrace();256 }257 }246 // if (docPropsCorePart==null) { 247 // try { 248 // docPropsCorePart = new org.docx4j.openpackaging.parts.DocPropsCorePart(); 249 // this.addTargetPart(docPropsCorePart); 250 // 251 // org.docx4j.docProps.core.ObjectFactory factory = 252 // new org.docx4j.docProps.core.ObjectFactory(); 253 // org.docx4j.docProps.core.CoreProperties properties = factory.createCoreProperties(); 254 // ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsCorePart).setJaxbElement((Object)properties); 255 // ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsCorePart).setJAXBContext(Context.jcDocPropsCore); 256 // } catch (InvalidFormatException e) { 257 // // TODO Auto-generated catch block 258 // e.printStackTrace(); 259 // } 260 // } 258 261 return docPropsCorePart; 259 262 } 260 263 261 264 public DocPropsExtendedPart getDocPropsExtendedPart() { 262 if (docPropsExtendedPart==null) {263 try {264 docPropsExtendedPart = new org.docx4j.openpackaging.parts.DocPropsExtendedPart();265 this.addTargetPart(docPropsExtendedPart);266 267 org.docx4j.docProps.extended.ObjectFactory factory =268 new org.docx4j.docProps.extended.ObjectFactory();269 org.docx4j.docProps.extended.Properties properties = factory.createProperties();270 ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsExtendedPart).setJaxbElement((Object)properties);271 ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsExtendedPart).setJAXBContext(Context.jcDocPropsExtended);272 } catch (InvalidFormatException e) {273 // TODO Auto-generated catch block274 e.printStackTrace();275 }276 }265 // if (docPropsExtendedPart==null) { 266 // try { 267 // docPropsExtendedPart = new org.docx4j.openpackaging.parts.DocPropsExtendedPart(); 268 // this.addTargetPart(docPropsExtendedPart); 269 // 270 // org.docx4j.docProps.extended.ObjectFactory factory = 271 // new org.docx4j.docProps.extended.ObjectFactory(); 272 // org.docx4j.docProps.extended.Properties properties = factory.createProperties(); 273 // ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsExtendedPart).setJaxbElement((Object)properties); 274 // ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsExtendedPart).setJAXBContext(Context.jcDocPropsExtended); 275 // } catch (InvalidFormatException e) { 276 // // TODO Auto-generated catch block 277 // e.printStackTrace(); 278 // } 279 // } 277 280 return docPropsExtendedPart; 278 281 } 279 282 280 283 /** 281 * Get DocPropsCustomPart, creating it if necessary.284 * Get DocPropsCustomPart, if any. 282 285 * 283 286 * @return … … 285 288 public DocPropsCustomPart getDocPropsCustomPart() { 286 289 287 if (docPropsCustomPart==null) {288 try {289 docPropsCustomPart = new org.docx4j.openpackaging.parts.DocPropsCustomPart();290 this.addTargetPart(docPropsCustomPart);291 292 org.docx4j.docProps.custom.ObjectFactory factory =293 new org.docx4j.docProps.custom.ObjectFactory();294 295 org.docx4j.docProps.custom.Properties properties = factory.createProperties();296 ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsCustomPart).setJaxbElement((Object)properties);297 298 ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsCustomPart).setJAXBContext(Context.jcDocPropsCustom);299 300 } catch (InvalidFormatException e) {301 // TODO Auto-generated catch block302 e.printStackTrace();303 }304 }290 // if (docPropsCustomPart==null) { 291 // try { 292 // docPropsCustomPart = new org.docx4j.openpackaging.parts.DocPropsCustomPart(); 293 // this.addTargetPart(docPropsCustomPart); 294 // 295 // org.docx4j.docProps.custom.ObjectFactory factory = 296 // new org.docx4j.docProps.custom.ObjectFactory(); 297 // 298 // org.docx4j.docProps.custom.Properties properties = factory.createProperties(); 299 // ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsCustomPart).setJaxbElement((Object)properties); 300 // 301 // ((org.docx4j.openpackaging.parts.JaxbXmlPart)docPropsCustomPart).setJAXBContext(Context.jcDocPropsCustom); 302 // 303 // } catch (InvalidFormatException e) { 304 // // TODO Auto-generated catch block 305 // e.printStackTrace(); 306 // } 307 // } 305 308 306 309 return docPropsCustomPart;
Note: See TracChangeset
for help on using the changeset viewer.
