protected static Part deepCopyPart(OpcPackage opcPackage, Base targetParent, Part sourcePart, Set<String> relationshipTypes) throws Docx4JException { //check if already handled Part ret = opcPackage.getParts().get(sourcePart.getPartName()); if (ret == null) { // ret = copyPart(sourcePart, opcPackage, ((relationshipTypes == null) || relationshipTypes.contains(sourcePart.getRelationshipType())) ); opcPackage.getParts().put(ret); targetParent.setPartShortcut(ret, ret.getRelationshipType()); } return ret; }
for (Entry<PartName,Part> entry : pkg.getParts().getParts().entrySet() ) {
for (Entry<PartName,Part> entry : opcPackage.getParts().getParts().entrySet() ) {
HashMap<PartName, Part> parts = pkg.getParts().getParts();
getPackage().getParts().put(part);
log.debug("Getting part /" + resolvedPartUri ); Part part = packageIn.getParts().get(new PartName("/" + resolvedPartUri));
return getPackage().getParts().get( new PartName(uri, true )); } catch (InvalidFormatException e) { log.error("Couldn't get part using PartName: " + uri, e);
log.warn(this.getPartName().getName() + " not attached to any package"); } else { this.getPackage().getParts().remove(getPartName());
/** * @param index * @throws Pptx4jException * @since 3.0 */ public void removeSlide(int index) throws Pptx4jException { List<SldId> sldIds = this.getJaxbElement().getSldIdLst().getSldId(); int zeroBasedCount = sldIds.size() -1; if (index< 0 || index>zeroBasedCount) { throw new Pptx4jException("No slide at index " + index + ". (There are " + sldIds.size() + " slides) "); } Presentation.SldIdLst.SldId entry = this.getJaxbElement().getSldIdLst().getSldId().remove(index); Relationship rel = this.getRelationshipsPart().getRelationshipByID(entry.getRid()); Part part = this.getRelationshipsPart().getPart(rel); this.getPackage().getParts().remove(part.getPartName()); this.getRelationshipsPart().removeRelationship(rel); }
part = pkg.getParts().getParts().get(new PartName("/" + resolvedPartUri)); if (source.setPartShortcut(part, relationshipType ) ) { log.debug("Convenience method established from " + source.getPartName()
part = pkg.getParts().getParts().get(new PartName("/" + resolvedPartUri)); if (source.setPartShortcut(part, relationshipType ) ) { log.debug("Convenience method established from " + source.getPartName()
log.info("adding part with proposed name: " + newPartName.getName()); if (this.getPackage().getParts().get( newPartName )!=null) { part = this.getPackage().getParts().get( newPartName ); this.getPackage().getParts().getParts() ); } else { newPartName = getNewPartName( proposedName, "." , this.getPackage().getParts().getParts() ); if (this.getPackage().getParts().get( newPartName )!=null && mode.equals(AddPartBehaviour.OVERWRITE_IF_NAME_EXISTS)) { if (this.getPackage().getParts().get( newPartName )!=null) {
protected static Part deepCopyPart(OpcPackage opcPackage, Base targetParent, Part sourcePart, Set<String> relationshipTypes) throws Docx4JException { //check if already handled Part ret = opcPackage.getParts().get(sourcePart.getPartName()); if (ret == null) { // ret = copyPart(sourcePart, opcPackage, ((relationshipTypes == null) || relationshipTypes.contains(sourcePart.getRelationshipType())) ); opcPackage.getParts().put(ret); targetParent.setPartShortcut(ret, ret.getRelationshipType()); } return ret; }
for (Entry<PartName,Part> entry : pkg.getParts().getParts().entrySet() ) {
return getPackage().getParts().get( new PartName(uri, true )); } catch (InvalidFormatException e) { log.error("Couldn't get part using PartName: " + uri, e);
log.warn(this.getPartName().getName() + " not attached to any package"); } else { this.getPackage().getParts().remove(getPartName());
/** * @param index * @throws Pptx4jException * @since 3.0 */ public void removeSlide(int index) throws Pptx4jException { List<SldId> sldIds = this.getJaxbElement().getSldIdLst().getSldId(); int zeroBasedCount = sldIds.size() -1; if (index< 0 || index>zeroBasedCount) { throw new Pptx4jException("No slide at index " + index + ". (There are " + sldIds.size() + " slides) "); } Presentation.SldIdLst.SldId entry = this.getJaxbElement().getSldIdLst().getSldId().remove(index); Relationship rel = this.getRelationshipsPart().getRelationshipByID(entry.getRid()); Part part = this.getRelationshipsPart().getPart(rel); this.getPackage().getParts().remove(part.getPartName()); this.getRelationshipsPart().removeRelationship(rel); }