protected void handleImageRel(ConversionImageHandler imageHandler, String imgRelId, Part sourcePart) { Relationship rel = sourcePart.getRelationshipsPart().getRelationshipByID(imgRelId); Part part = null; String uri = null; boolean ignoreImage = false; setID(imgRelId); part = sourcePart.getRelationshipsPart().getPart(rel); /* a part == null is ok if it is an external image, * and hasn't been loaded (loadExternalTargets == false) * but the relationship can be external, * but the part avaiable (loadExternalTargets == true) */ if ((part != null) && (!(part instanceof BinaryPart))) { log.error("Invalid part type id: " + imgRelId + ", class = " + part.getClass().getName()); ignoreImage = true; } if (!ignoreImage) { uri = handlePart(imageHandler, this, rel, (BinaryPart)part); if (uri != null) { this.setSrc(uri); } } }
if (part.getRelationshipsPart()!= null && part.getRelationshipsPart().getJaxbElement()!=null && part.getRelationshipsPart().getJaxbElement().getRelationship()!=null && part.getRelationshipsPart().getJaxbElement().getRelationship().size()>0) { RelationshipsPart rrp = part.getRelationshipsPart(); log.debug("Found relationships " + rrp.getPartName() ); String relPart = PartName.getRelationshipsPartName(resolvedPartUri);
log.debug("Found a CustomXmlPart, named " + entry.getPartName().getName() ); String itemId = null; if (entry.getRelationshipsPart()==null) { continue; } else { log.debug(".. it has a rels part"); Relationship r = entry.getRelationshipsPart().getRelationshipByType( Namespaces.CUSTOM_XML_DATA_STORAGE_PROPERTIES); if (r==null) { (CustomXmlDataStoragePropertiesPart)entry.getRelationshipsPart().getPart(r); if (customXmlProps==null) { log.error(".. but the target seems to be missing?");
if (part.getRelationshipsPart()!=null) { removedParts.addAll( part.getRelationshipsPart().removeParts() ); // the recursive bit
if (part.getRelationshipsPart()==null) { } else { trimParts(output, part.getRelationshipsPart(), true); || part instanceof org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart || part instanceof org.docx4j.openpackaging.parts.WordprocessingML.HeaderPart) { if (part.getRelationshipsPart()==null) { } else { trimParts(output, part.getRelationshipsPart(), false); } else if (part instanceof org.docx4j.openpackaging.parts.WordprocessingML.GlossaryDocumentPart) { deletions.add(r ); trimParts(output, part.getRelationshipsPart(), true); } else { log.debug(part.getClass().getName());
if (sourcePart.getRelationshipsPart() == null) { RelationshipsPart.createRelationshipsPartForPart(sourcePart); String proposedRelId = sourcePart.getRelationshipsPart().getNextId();
RelationshipsPart rrp = part.getRelationshipsPart(false); //don't create if (rrp!= null ) {
/** * Create a notes slide and add it to slide relationships * * @param sourcePart * @param partName * @return the notes slide * @throws InvalidFormatException * @throws JAXBException */ public static NotesSlidePart createNotesSlidePart(Part sourcePart, PartName partName) throws Exception { String proposedRelId = sourcePart.getRelationshipsPart().getNextId(); NotesSlidePart notesSlidePart = new NotesSlidePart(partName); notesSlidePart.getSourceRelationships().add(sourcePart.addTargetPart(notesSlidePart, proposedRelId)); notesSlidePart.setJaxbElement(NotesSlidePart.createNotes()); return notesSlidePart; }
RelationshipsPart rrp = part.getRelationshipsPart(false); //don't create if (rrp!= null ) {
if (sourcePart.getRelationshipsPart() == null) { RelationshipsPart.createRelationshipsPartForPart(sourcePart); String proposedRelId = sourcePart.getRelationshipsPart().getNextId();
if (sourcePart.getRelationshipsPart() == null) { RelationshipsPart.createRelationshipsPartForPart(sourcePart); String proposedRelId = sourcePart.getRelationshipsPart().getNextId();
addTree(alterations.getPartsAdded(), thisRP.getPart(r).getRelationshipsPart() ); addTree(alterations.getPartsDeleted(), thisRP.getPart(r).getRelationshipsPart() ); } else { RelationshipsPart.getRelationshipByTarget(otherRP, r.getTarget()) ); if (thisPart.getRelationshipsPart()==null) { if (otherPart.getRelationshipsPart()!=null) { new Alteration( thisPart.getPartName(), toStorageFormat(thisPart.getRelationshipsPart()))); addTree(alterations.getPartsDeleted(), thisPart.getRelationshipsPart() ); if (otherPart.getRelationshipsPart()==null) { new Alteration( thisPart.getPartName(), toStorageFormat(thisPart.getRelationshipsPart()))); addTree(alterations.getPartsAdded(), thisPart.getRelationshipsPart() ); recurse(alterations, thisPart.getRelationshipsPart(), otherPart.getRelationshipsPart());
if (part.getRelationshipsPart(false)==null) { traverseRelationships(wordMLPackage, part.getRelationshipsPart(false), sb, indent + " ");
String proposedRelId = sourcePart.getRelationshipsPart().getNextId();
RelationshipsPart nextRP = nextSourcePart.getRelationshipsPart(); if (nextRP!=null) { list.add(
if (sourcePart.getRelationshipsPart() == null) { RelationshipsPart.createRelationshipsPartForPart(sourcePart); String proposedRelId = sourcePart.getRelationshipsPart().getNextId();
} else if ((getRId() != null) && (getRId().length() > 0) ) { rPart = conversionContext.getCurrentPart().getRelationshipsPart(); if (rPart == null) { log.error("RelationshipsPart is missing!");
} else { removedParts.addAll( parentPart.getRelationshipsPart().removePart( new PartName(xmlpart.getName())) ); newRP = parentPart.getRelationshipsPart(true); newRP = parentPart.getRelationshipsPart(true); newPart.setOwningRelationshipPart(parentPart.getRelationshipsPart()); newPart.getSourceRelationships().add( parentPart.getRelationshipsPart().getRel(new PartName(a.getPart().getName()))); otherPackage.getParts().put(newPart); newPart.setPackage( otherPackage );
protected void handleImageRel(ConversionImageHandler imageHandler, String imgRelId, Part sourcePart) { Relationship rel = sourcePart.getRelationshipsPart().getRelationshipByID(imgRelId); Part part = null; String uri = null; boolean ignoreImage = false; setID(imgRelId); part = sourcePart.getRelationshipsPart().getPart(rel); /* a part == null is ok if it is an external image, * and hasn't been loaded (loadExternalTargets == false) * but the relationship can be external, * but the part avaiable (loadExternalTargets == true) */ if ((part != null) && (!(part instanceof BinaryPart))) { log.error("Invalid part type id: " + imgRelId + ", class = " + part.getClass().getName()); ignoreImage = true; } if (!ignoreImage) { uri = handlePart(imageHandler, this, rel, (BinaryPart)part); if (uri != null) { this.setSrc(uri); } } }
/** * Create a notes slide and add it to slide relationships * * @param sourcePart * @param partName * @return the notes slide * @throws InvalidFormatException * @throws JAXBException */ public static NotesSlidePart createNotesSlidePart(Part sourcePart, PartName partName) throws Exception { String proposedRelId = sourcePart.getRelationshipsPart().getNextId(); NotesSlidePart notesSlidePart = new NotesSlidePart(partName); notesSlidePart.getSourceRelationships().add(sourcePart.addTargetPart(notesSlidePart, proposedRelId)); notesSlidePart.setJaxbElement(NotesSlidePart.createNotes()); return notesSlidePart; }