Changeset 1378
- Timestamp:
- 12/31/10 00:13:29 (17 months ago)
- Location:
- trunk/docx4j/src/main/java/org/docx4j/openpackaging
- Files:
-
- 12 edited
-
contenttype/ContentTypeManager.java (modified) (1 diff)
-
io/LoadFromZipNG.java (modified) (8 diffs)
-
io/SaveToZipFile.java (modified) (1 diff)
-
packages/WordprocessingMLPackage.java (modified) (1 diff)
-
parts/DocPropsCorePart.java (modified) (2 diffs)
-
parts/DocPropsCustomPart.java (modified) (1 diff)
-
parts/DocPropsExtendedPart.java (modified) (1 diff)
-
parts/JaxbXmlPart.java (modified) (1 diff)
-
parts/Part.java (modified) (1 diff)
-
parts/ThemePart.java (modified) (1 diff)
-
parts/WordprocessingML/FontTablePart.java (modified) (1 diff)
-
parts/relationships/RelationshipsPart.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/openpackaging/contenttype/ContentTypeManager.java
r1355 r1378 193 193 */ 194 194 public void addOverrideContentType(URI partUri, CTOverride contentType) { 195 log. info("Registered " + partUri.toString() + " of type " + contentType.getContentType() );195 log.debug("Registered " + partUri.toString() + " of type " + contentType.getContentType() ); 196 196 overrideContentType.put(partUri, contentType); 197 197 } -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/io/LoadFromZipNG.java
r1309 r1378 95 95 // HashMap containing the names of all the zip entries, 96 96 // so we can tell whether there are any orphans 97 public HashMap unusedZipEntries = new HashMap();97 // public HashMap unusedZipEntries = new HashMap(); 98 98 99 99 … … 209 209 // each PartName, and use it in the Part constructor. 210 210 // p.setContentTypeManager(ctm); - 20080111 - done by ctm.createPackage(); 211 unusedZipEntries.put("[Content_Types].xml", new Boolean(false)); 211 212 // unusedZipEntries.put("[Content_Types].xml", new Boolean(false)); 212 213 213 214 // 4. Start with _rels/.rels … … 222 223 RelationshipsPart rp = getRelationshipsPartFromZip(p, partByteArrays, partName); 223 224 p.setRelationships(rp); 224 //rp.setPackageRelationshipPart(true); 225 unusedZipEntries.put(partName, new Boolean(false));226 227 228 log.info( "Object created for: " + partName);229 //log.info( rp.toString());225 //rp.setPackageRelationshipPart(true); 226 227 // unusedZipEntries.put(partName, new Boolean(false)); 228 229 230 log.debug( "Object created for: " + partName); 230 231 231 232 // 5. Now recursively … … 238 239 239 240 // 6. Check unusedZipEntries is empty 240 if (log.isDebugEnabled()) {241 Iterator myVeryOwnIterator = unusedZipEntries.keySet().iterator();242 while(myVeryOwnIterator.hasNext()) {243 String key = (String)myVeryOwnIterator.next();244 log.info( key + " " + unusedZipEntries.get(key));245 }246 }241 // if (log.isDebugEnabled()) { 242 // Iterator myVeryOwnIterator = unusedZipEntries.keySet().iterator(); 243 // while(myVeryOwnIterator.hasNext()) { 244 // String key = (String)myVeryOwnIterator.next(); 245 // log.info( key + " " + unusedZipEntries.get(key)); 246 // } 247 // } 247 248 248 249 registerCustomXmlDataStorageParts(p); … … 341 342 for ( Relationship r : rp.getRelationships().getRelationship() ) { 342 343 343 log. info("\n For Relationship Id=" + r.getId()344 log.debug("\n For Relationship Id=" + r.getId() 344 345 + " Source is " + rp.getSourceP().getPartName() 345 346 + ", Target is " + r.getTarget() … … 432 433 // method for this 433 434 if (source.setPartShortcut(part, relationshipType ) ) { 434 log. info("Convenience method established from " + source.getPartName()435 log.debug("Convenience method established from " + source.getPartName() 435 436 + " to " + part.getPartName()); 436 437 } 437 438 438 unusedZipEntries.put(resolvedPartUri, new Boolean(false)); 439 log.info(".. added." ); 439 // unusedZipEntries.put(resolvedPartUri, new Boolean(false)); 440 440 441 441 RelationshipsPart rrp = getRelationshipsPart(partByteArrays, part); … … 445 445 String relPart = PartName.getRelationshipsPartName( 446 446 part.getPartName().getName().substring(1) ); 447 unusedZipEntries.put(relPart, new Boolean(false));447 // unusedZipEntries.put(relPart, new Boolean(false)); 448 448 } 449 449 } … … 469 469 470 470 if (partByteArrays.get(relPart) !=null ) { 471 log.info("Found relationships " + relPart ); 472 log.info("Recursing ... " ); 471 log.debug("Found relationships " + relPart ); 473 472 rrp = getRelationshipsPartFromZip(part, partByteArrays, relPart); 474 473 part.setRelationships(rrp); 475 474 } else { 476 log. info("No relationships " + relPart );475 log.debug("No relationships " + relPart ); 477 476 return null; 478 477 } -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/io/SaveToZipFile.java
r1321 r1378 81 81 /* Save a Package as a Zip file in the file system */ 82 82 public boolean save(String filepath) throws Docx4JException { 83 log.info("S aving to" + filepath );83 log.info("SAVING to " + filepath ); 84 84 try { 85 85 if (filepath.toLowerCase().endsWith(".xml") ) { -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
r1304 r1378 212 212 if (relationshipType.equals(Namespaces.PROPERTIES_CORE)) { 213 213 docPropsCorePart = (DocPropsCorePart)part; 214 log. info("Set shortcut for docPropsCorePart");214 log.debug("Set shortcut for docPropsCorePart"); 215 215 return true; 216 216 } else if (relationshipType.equals(Namespaces.PROPERTIES_EXTENDED)) { 217 217 docPropsExtendedPart = (DocPropsExtendedPart)part; 218 log. info("Set shortcut for docPropsExtendedPart");218 log.debug("Set shortcut for docPropsExtendedPart"); 219 219 return true; 220 220 } else if (relationshipType.equals(Namespaces.PROPERTIES_CUSTOM)) { 221 221 docPropsCustomPart = (DocPropsCustomPart)part; 222 log. info("Set shortcut for docPropsCustomPart");222 log.debug("Set shortcut for docPropsCustomPart"); 223 223 return true; 224 224 } else if (relationshipType.equals(Namespaces.DOCUMENT)) { 225 225 mainDoc = (MainDocumentPart)part; 226 log. info("Set shortcut for mainDoc");226 log.debug("Set shortcut for mainDoc"); 227 227 return true; 228 228 } else { -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/DocPropsCorePart.java
r1307 r1378 96 96 try { 97 97 98 // if (jc==null) {99 // setJAXBContext(Context.jc);100 // }101 102 98 setJAXBContext(org.docx4j.jaxb.Context.jcDocPropsCore); 103 99 Unmarshaller u = jc.createUnmarshaller(); … … 106 102 u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler()); 107 103 108 log.info("unmarshalling " + this.getClass().getName() + " \n\n");104 log.info("unmarshalling " + this.getClass().getName()); 109 105 110 106 jaxbElement = (CoreProperties) u.unmarshal( is ); 111 112 113 log.info("\n\n" + this.getClass().getName() + " unmarshalled \n\n" );114 107 115 108 } catch (Exception e ) { -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/DocPropsCustomPart.java
r933 r1378 124 124 u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler()); 125 125 126 log.info("unmarshalling " + this.getClass().getName() + " \n\n");126 log.info("unmarshalling " + this.getClass().getName() ); 127 127 128 128 jaxbElement = (Properties) u.unmarshal( is ); -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/DocPropsExtendedPart.java
r887 r1378 113 113 u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler()); 114 114 115 log.info("unmarshalling " + this.getClass().getName() + " \n\n" ); 116 115 log.info("unmarshalling " + this.getClass().getName() ); 117 116 jaxbElement = (Properties) u.unmarshal( is ); 118 119 120 log.info("\n\n" + this.getClass().getName() + " unmarshalled \n\n" );121 117 122 118 } catch (Exception e ) { -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/JaxbXmlPart.java
r1219 r1378 214 214 u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler()); 215 215 216 log. debug("unmarshalling " + this.getClass().getName() );216 log.info("unmarshalling " + this.getClass().getName() ); 217 217 jaxbElement = (E) XmlUtils.unwrap( 218 218 u.unmarshal( is )); 219 log.debug( this.getClass().getName() + " unmarshalled" );220 219 221 220 } catch (JAXBException e ) { -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/Part.java
r1050 r1378 130 130 public Part(PartName partName) 131 131 throws InvalidFormatException { 132 log.info( "Constructing " +partName.getName() );132 log.info( partName.getName() ); 133 133 this.partName = partName; 134 134 } -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/ThemePart.java
r887 r1378 97 97 u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler()); 98 98 99 log.info("unmarshalling " + this.getClass().getName() + " \n\n" ); 100 99 log.info("unmarshalling " + this.getClass().getName() ); 101 100 jaxbElement = (Theme) u.unmarshal( is ); 102 103 104 log.info("\n\n" + this.getClass().getName() + " unmarshalled \n\n" );105 101 106 102 } catch (Exception e ) { -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/FontTablePart.java
r887 r1378 61 61 setRelationshipType(Namespaces.FONT_TABLE); 62 62 } 63 64 /**65 * Unmarshal XML data from the specified InputStream and return the66 * resulting content tree. Validation event location information may67 * be incomplete when using this form of the unmarshal API.68 *69 * <p>70 * Implements <a href="#unmarshalGlobal">Unmarshal Global Root Element</a>.71 *72 * @param is the InputStream to unmarshal XML data from73 * @return the newly created root object of the java content tree74 *75 * @throws JAXBException76 * If any unexpected errors occur while unmarshalling77 */78 @Override79 public Fonts unmarshal( java.io.InputStream is ) throws JAXBException {80 81 try {82 83 // if (jc==null) {84 // setJAXBContext(Context.jc);85 // }86 87 Unmarshaller u = jc.createUnmarshaller();88 89 //u.setSchema(org.docx4j.jaxb.WmlSchema.schema);90 u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler());91 92 log.info("unmarshalling " + this.getClass().getName() + " \n\n" );93 94 jaxbElement = (Fonts) u.unmarshal( is );95 96 97 log.info("\n\n" + this.getClass().getName() + " unmarshalled \n\n" );98 99 } catch (Exception e ) {100 e.printStackTrace();101 }102 103 return jaxbElement;104 105 }106 63 107 64 /** -
trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/relationships/RelationshipsPart.java
r1307 r1378 428 428 429 429 PartName partName = part.getPartName(); 430 log. info("Loading part " + partName.getName() );430 log.debug("Loading part " + partName.getName() ); 431 431 432 432 part.setOwningRelationshipPart(this); … … 797 797 try { 798 798 799 // if (jc==null) {800 // setJAXBContext(Context.jc);801 // }802 803 799 Unmarshaller u = jc.createUnmarshaller(); 804 800 805 //u.setSchema(org.docx4j.jaxb.WmlSchema.schema);806 801 u.setEventHandler(new org.docx4j.jaxb.JaxbValidationEventHandler()); 807 802 808 log.info("unmarshalling " + this.getClass().getName() + " \n\n" );809 803 if (log.isDebugEnabled()) log.debug("\n"); 804 log.info("unmarshalling " + this.getClass().getName() ); 810 805 jaxbElement = (Relationships) u.unmarshal( is ); 811 812 813 log.info("\n\n" + this.getClass().getName() + " unmarshalled \n\n" );814 806 815 807 } catch (Exception e ) { … … 817 809 } 818 810 819 // jaxbElement = (Relationships)jaxbElement;820 811 resetIdAllocator(); 821 812
Note: See TracChangeset
for help on using the changeset viewer.
