public class OpcPackage extends Base
Modifier and Type | Field and Description |
---|---|
protected ContentTypeManager |
contentTypeManager |
protected HashMap<String,CustomXmlPart> |
customXmlDataStorageParts |
protected DocPropsCorePart |
docPropsCorePart |
protected DocPropsCustomPart |
docPropsCustomPart |
protected DocPropsExtendedPart |
docPropsExtendedPart |
protected HashMap<ExternalTarget,Part> |
externalResources |
HashMap<String,String> |
handled
This HashMap is intended to prevent loops during the loading
of this package.
|
protected Parts |
parts
Package parts collection.
|
contentType, partName, relationships
Constructor and Description |
---|
OpcPackage()
Constructor.
|
OpcPackage(ContentTypeManager contentTypeManager)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
OpcPackage |
clone() |
ContentTypeManager |
getContentTypeManager() |
HashMap<String,CustomXmlPart> |
getCustomXmlDataStorageParts() |
DocPropsCorePart |
getDocPropsCorePart() |
DocPropsCustomPart |
getDocPropsCustomPart()
Get DocPropsCustomPart, if any.
|
DocPropsExtendedPart |
getDocPropsExtendedPart() |
HashMap<ExternalTarget,Part> |
getExternalResources() |
OpcPackage |
getPackage() |
Parts |
getParts()
Retrieve the Parts object.
|
PartStore |
getSourcePartStore() |
PartStore |
getTargetPartStore() |
String |
getTitle() |
static OpcPackage |
load(File docxFile)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an existing File (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(File docxFile,
String password)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an existing File (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(InputStream inputStream)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an inputstream (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(InputStream is,
boolean docxFormat)
Deprecated.
|
static OpcPackage |
load(InputStream is,
Filetype type)
convenience method to load a word2007 document
from an existing inputstream (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(InputStream is,
Filetype type,
String password)
convenience method to load a word2007 document
from an existing inputstream (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(InputStream inputStream,
String password)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an inputstream (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
void |
save(File file)
Convenience method to save a WordprocessingMLPackage
or PresentationMLPackage to a File.
|
void |
setContentTypeManager(ContentTypeManager contentTypeManager) |
boolean |
setPartShortcut(Part part,
String relationshipType)
Tell the source Part about this target Part, so the
source can use this part via a convenience method.
|
void |
setSourcePartStore(PartStore partStore) |
void |
setTargetPartStore(PartStore partStore) |
void |
setTitle(String title) |
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, setContentType, setRelationships, setUserData
public HashMap<String,String> handled
protected Parts parts
protected HashMap<ExternalTarget,Part> externalResources
protected HashMap<String,CustomXmlPart> customXmlDataStorageParts
protected ContentTypeManager contentTypeManager
protected DocPropsCorePart docPropsCorePart
protected DocPropsExtendedPart docPropsExtendedPart
protected DocPropsCustomPart docPropsCustomPart
public OpcPackage()
public OpcPackage(ContentTypeManager contentTypeManager)
contentTypeManager
- The content type manager to usepublic Parts getParts()
public HashMap<ExternalTarget,Part> getExternalResources()
public HashMap<String,CustomXmlPart> getCustomXmlDataStorageParts()
public ContentTypeManager getContentTypeManager()
public void setContentTypeManager(ContentTypeManager contentTypeManager)
public PartStore getSourcePartStore()
public void setSourcePartStore(PartStore partStore)
partStore
- the partStore to setpublic PartStore getTargetPartStore()
public void setTargetPartStore(PartStore partStore)
partStore
- the partStore to setpublic OpcPackage getPackage()
getPackage
in class Base
public static OpcPackage load(File docxFile) throws Docx4JException
docxFile
- The docx fileDocx4JException
public static OpcPackage load(File docxFile, String password) throws Docx4JException
docxFile
- The docx filepassword
- The password, if the file is password protected (compound)Docx4JException
public static OpcPackage load(InputStream inputStream) throws Docx4JException
inputStream
- The docx fileDocx4JException
public static OpcPackage load(InputStream inputStream, String password) throws Docx4JException
inputStream
- The docx filepassword
- The password, if the file is password protected (compound)Docx4JException
@Deprecated public static OpcPackage load(InputStream is, boolean docxFormat) throws Docx4JException
is
- docxFormat
- Docx4JException
public static OpcPackage load(InputStream is, Filetype type) throws Docx4JException
is
- docxFormat
- Docx4JException
public static OpcPackage load(InputStream is, Filetype type, String password) throws Docx4JException
is
- docxFormat
- Docx4JException
public void save(File file) throws Docx4JException
file
- The docx fileDocx4JException
public boolean setPartShortcut(Part part, String relationshipType)
Base
setPartShortcut
in class Base
public DocPropsCorePart getDocPropsCorePart()
public DocPropsExtendedPart getDocPropsExtendedPart()
public DocPropsCustomPart getDocPropsCustomPart()
public void setTitle(String title)
public String getTitle()
public OpcPackage clone()
Copyright © 2007-2013. All Rights Reserved.