/** * @return * @throws InvalidFormatException * @since 3.2.0, at which time related constructor was made private */ public static RelationshipsPart createPackageRels() throws InvalidFormatException { RelationshipsPart rp = new RelationshipsPart(new PartName("/_rels/.rels")); return rp; } private RelationshipsPart(PartName partname) throws InvalidFormatException {
public Part CreateDefaultXmlPartObject(String partName) throws InvalidFormatException { return new DefaultXmlPart(new PartName(partName)); }
public Part CreateMainDocumentPartObject(String partName) throws InvalidFormatException { return new MainDocumentPart(new PartName(partName)); }
public DiagramColorsPart() throws InvalidFormatException { super(new PartName("/word/diagrams/colors1.xml")); init(); }
public TagsPart() throws InvalidFormatException { super(new PartName("/ppt/tags/tag1.xml")); init(); }
public ThemeOverridePart() throws InvalidFormatException { super(new PartName("/ppt/theme/themeOverride1.xml")); init(); }
public DiagramLayoutHeaderPart() throws InvalidFormatException { super(new PartName("/diagrams/layoutheader1.xml")); init(); }
public TaskpanesPart() throws InvalidFormatException { super(new PartName("/word/taskpanes.xml")); init(); }
public FontTablePart() throws InvalidFormatException { super(new PartName("/word/fontTable.xml")); init(); }
public MainDocumentPart() throws InvalidFormatException { super(new PartName("/word/document.xml")); init(); }
public BibliographyPart() throws InvalidFormatException { super(new PartName("/customXml/item1.xml")); init(); }
public ThemePart() throws InvalidFormatException { super(new PartName("/word/theme/theme1.xml")); init(); }
public FontDataPart() throws InvalidFormatException { super( new PartName("/ppt/fonts/font1.fntdata") ); init(); }
public DiagramStylePart() throws InvalidFormatException { super(new PartName("/word/diagrams/quickStyle1.xml")); init(); }
public SlideMasterPart() throws InvalidFormatException { super(new PartName("/ppt/slideMasters/slideMaster1.xml")); init(); }
public StyleDefinitionsPart() throws InvalidFormatException { super(new PartName("/word/styles.xml")); init(); }
/** * Constructor. Also creates a new content type manager * */ public OpcPackage() { try { this.setPartName(new PartName("/", false)); contentTypeManager = new ContentTypeManager(); } catch (Exception e) { log.error(e.getMessage()); // TODO: handle exception } }
public static void main(String[] args) throws Exception { String outputfilepath = System.getProperty("user.dir") + "/sample-docs/xlsx/test-out.xlsx"; SpreadsheetMLPackage pkg = createPackage(); pkg.createWorksheetPart(new PartName("/xl/worksheets/sheet1.xml"), "Sheet1", 1); SaveToZipFile saver = new SaveToZipFile(pkg); saver.save(outputfilepath); System.out.println("\n\n done .. " + outputfilepath); } }
protected ConditionsPart createConditionsPart(WordprocessingMLPackage pkgOut, Conditions conditions) throws InvalidFormatException { conditionsPart = new ConditionsPart(new PartName("/customXml/item1.xml")); // name doesn't matter pkgOut.getMainDocumentPart().addTargetPart(conditionsPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); // Word will silently drop the CXPs if they aren't added to the MDP! addPropertiesPart(pkgOut, conditionsPart, "http://opendope.org/conditions"); conditionsPart.setJaxbElement(conditions); return conditionsPart; }
protected XPathsPart createXPathsPart(WordprocessingMLPackage pkgOut, Xpaths xpaths) throws InvalidFormatException { xPathsPart = new XPathsPart(new PartName("/customXml/item1.xml")); pkgOut.getMainDocumentPart().addTargetPart(xPathsPart, AddPartBehaviour.RENAME_IF_NAME_EXISTS); addPropertiesPart(pkgOut, xPathsPart, "http://opendope.org/xpaths"); xPathsPart.setJaxbElement(xpaths); return xPathsPart; }