String relPart = PartName.getRelationshipsPartName( part.getPartName().getName().substring(1) );
/** * Get the Relationships Part (if there is one) for a given Part. * Otherwise return null. * * @param zf * @param part * @return * @throws InvalidFormatException */ public RelationshipsPart getRelationshipsPart(Part part) throws Docx4JException, InvalidFormatException { // recurse via this parts relationships, if it has any String relPart = PartName.getRelationshipsPartName( part.getPartName().getName() ); RelationshipsPart rrp = getRelationshipsPartFromXmlPackage(part, relPart); if (rrp!=null) { part.setRelationships(rrp); } else { log.debug("No relationships " + relPart ); return null; } return rrp; }
String relPart = PartName.getRelationshipsPartName(resolvedPartUri);
String relPart = PartName.getRelationshipsPartName( part.getPartName().getName().substring(1) );
@Override public PartName getPartName() { // Calculate rels part name dynamically where possible; // this ensures it is named appropriately // if its source part's name changes // (eg AddPartBehaviour.RENAME_IF_NAME_EXISTS) if (this.getSourceP()!=null && (!(this.getSourceP() instanceof OpcPackage))) { try { return new PartName(PartName.getRelationshipsPartName( sourceP.getPartName().getName() )); } catch (InvalidFormatException e) { throw new RuntimeException(e); } } else { return super.getPartName(); } }
RelationshipsPart rrp = part.getRelationshipsPart(); log.debug("Found relationships " + rrp.getPartName() ); String relPart = PartName.getRelationshipsPartName(resolvedPartUri); log.debug("Cf constructed name " + relPart );
/** * Constructor. Creates an appropriately named .rels XML document. * * Often invoked via sourceP.getRelationshipsPart(true) // create rels part * * @param sourceP * Source part for these relationships * * @throws InvalidFormatException * If the specified URI is not valid. */ public RelationshipsPart(Base sourceP) throws InvalidFormatException { super(new PartName(PartName.getRelationshipsPartName( sourceP.getPartName().getName() )) ); // though we won't be using that, since it is dynamic this.sourceP = sourceP; init(); sourceP.setRelationships(this); // TODO - use setRelationships from here // like this in other constructors // in this class. org.docx4j.relationships.ObjectFactory factory = new org.docx4j.relationships.ObjectFactory(); jaxbElement = factory.createRelationships(); }
String relPart = PartName.getRelationshipsPartName( part.getPartName().getName().substring(1) );
/** * Get the Relationships Part (if there is one) for a given Part. * Otherwise return null. * * @param zf * @param part * @return * @throws InvalidFormatException */ public RelationshipsPart getRelationshipsPart(Part part) throws Docx4JException, InvalidFormatException { // recurse via this parts relationships, if it has any String relPart = PartName.getRelationshipsPartName( part.getPartName().getName() ); RelationshipsPart rrp = getRelationshipsPartFromXmlPackage(part, relPart); if (rrp!=null) { part.setRelationships(rrp); } else { log.debug("No relationships " + relPart ); return null; } return rrp; }
String relPart = PartName.getRelationshipsPartName(resolvedPartUri);
String relPart = PartName.getRelationshipsPartName( part.getPartName().getName().substring(1) );
@Override public PartName getPartName() { // Calculate rels part name dynamically where possible; // this ensures it is named appropriately // if its source part's name changes // (eg AddPartBehaviour.RENAME_IF_NAME_EXISTS) if (this.getSourceP()!=null && (!(this.getSourceP() instanceof OpcPackage))) { try { return new PartName(PartName.getRelationshipsPartName( sourceP.getPartName().getName() )); } catch (InvalidFormatException e) { throw new RuntimeException(e); } } else { return super.getPartName(); } }
RelationshipsPart rrp = part.getRelationshipsPart(); log.debug("Found relationships " + rrp.getPartName() ); String relPart = PartName.getRelationshipsPartName(resolvedPartUri); log.debug("Cf constructed name " + relPart );
/** * Constructor. Creates an appropriately named .rels XML document. * * Often invoked via sourceP.getRelationshipsPart(true) // create rels part * * @param sourceP * Source part for these relationships * * @throws InvalidFormatException * If the specified URI is not valid. */ public RelationshipsPart(Base sourceP) throws InvalidFormatException { super(new PartName(PartName.getRelationshipsPartName( sourceP.getPartName().getName() )) ); // though we won't be using that, since it is dynamic this.sourceP = sourceP; init(); sourceP.setRelationships(this); // TODO - use setRelationships from here // like this in other constructors // in this class. org.docx4j.relationships.ObjectFactory factory = new org.docx4j.relationships.ObjectFactory(); jaxbElement = factory.createRelationships(); }