public abstract class OpcPackage extends Base implements PackageIdentifier
| Modifier and Type | Field and Description |
|---|---|
protected ContentTypeManager |
contentTypeManager |
protected java.util.HashMap<java.lang.String,CustomXmlPart> |
customXmlDataStorageParts |
protected DocPropsCorePart |
docPropsCorePart |
protected DocPropsCustomPart |
docPropsCustomPart |
protected DocPropsExtendedPart |
docPropsExtendedPart |
protected java.util.HashMap<ExternalTarget,Part> |
externalResources |
java.util.HashMap<java.lang.String,java.lang.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 |
|---|---|
void |
addDocPropsCorePart() |
void |
addDocPropsCustomPart() |
void |
addDocPropsExtendedPart() |
OpcPackage |
clone() |
OpcPackage |
cloneAs(java.lang.String targetContentType) |
ContentTypeManager |
getContentTypeManager() |
java.util.HashMap<java.lang.String,CustomXmlPart> |
getCustomXmlDataStorageParts()
keyed by item id (in lower case)
|
DocPropsCorePart |
getDocPropsCorePart()
Get the DocPropsCorePart, if any.
|
DocPropsCustomPart |
getDocPropsCustomPart()
Get DocPropsCustomPart, if any.
|
DocPropsExtendedPart |
getDocPropsExtendedPart()
Get the DocPropsExtendedPart, if any.
|
DrawingPropsIdTracker |
getDrawingPropsIdTracker() |
java.util.HashMap<ExternalTarget,Part> |
getExternalResources() |
OpcPackage |
getPackage() |
Parts |
getParts()
Retrieve the Parts object.
|
PartStore |
getSourcePartStore() |
PartStore |
getTargetPartStore() |
java.lang.String |
getTitle() |
boolean |
isNew()
Was this pkg created from scratch in docx4j, or loaded?
|
static OpcPackage |
load(java.io.File docxFile)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an existing File (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(java.io.File file,
Filetype type)
convenience method to load from a file, where you know the Filetype
(if it is Filetype.ZippedPackage, ZipFile will be used instead of ZipArchiveInputStream)
|
static OpcPackage |
load(java.io.File file,
Filetype type,
java.lang.String password)
convenience method to load from a file, where you know the Filetype
(if it is Filetype.ZippedPackage, ZipFile will be used instead of ZipArchiveInputStream)
|
static OpcPackage |
load(java.io.File docxFile,
java.lang.String password)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an existing File (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(java.io.InputStream inputStream)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an inputstream (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(java.io.InputStream is,
boolean docxFormat)
Deprecated.
|
static OpcPackage |
load(java.io.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(java.io.InputStream is,
Filetype type,
java.lang.String password)
convenience method to load a word2007 document
from an existing inputstream (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(java.io.InputStream inputStream,
java.lang.String password)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an inputstream (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(PackageIdentifier pkgIdentifier,
java.io.File docxFile)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an existing File (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(PackageIdentifier pkgIdentifier,
java.io.File docxFile,
java.lang.String password)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an existing File (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
static OpcPackage |
load(PackageIdentifier pkgIdentifier,
java.io.InputStream inputStream)
Convenience method to create a WordprocessingMLPackage
or PresentationMLPackage
from an inputstream (.docx/.docxm, .ppxtx or Flat OPC .xml).
|
java.lang.String |
name() |
void |
reset()
Reinit fields so this pkg object can be re-used.
|
void |
save(java.io.File file)
Convenience method to save a WordprocessingMLPackage
or PresentationMLPackage to a File.
|
void |
save(java.io.File outFile,
int flags)
Save this pkg to a File.
|
void |
save(java.io.File outFile,
int flags,
java.lang.String password)
Save this pkg to a file.
|
void |
save(java.io.OutputStream outStream)
Save this pkg to an OutputStream in the usual zipped up format
(Docx4J.FLAG_SAVE_ZIP_FILE)
|
void |
save(java.io.OutputStream outStream,
int flags)
Save this pkg to an OutputStream.
|
void |
save(java.io.OutputStream outStream,
int flags,
java.lang.String password)
Save this pkg to an OutputStream.
|
void |
setContentTypeManager(ContentTypeManager contentTypeManager) |
void |
setName(java.lang.String name)
Allocate a name to this package, for the purposes of Docx4jEvent,
and logging.
|
void |
setNew(boolean isNew) |
boolean |
setPartShortcut(Part part,
java.lang.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(java.lang.String title) |
addTargetPart, addTargetPart, addTargetPart, addTargetPart, getContentType, getPartName, getRelationshipsPart, getRelationshipsPart, getUserData, setContentType, setPartName, setRelationships, setUserDatapublic java.util.HashMap<java.lang.String,java.lang.String> handled
protected Parts parts
protected java.util.HashMap<ExternalTarget,Part> externalResources
protected java.util.HashMap<java.lang.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 DrawingPropsIdTracker getDrawingPropsIdTracker()
public java.util.HashMap<ExternalTarget,Part> getExternalResources()
public java.util.HashMap<java.lang.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 Basepublic boolean isNew()
public void setNew(boolean isNew)
public static OpcPackage load(PackageIdentifier pkgIdentifier, java.io.File docxFile) throws Docx4JException
docxFile - The docx fileDocx4JExceptionpublic static OpcPackage load(java.io.File docxFile) throws Docx4JException
docxFile - The docx fileDocx4JExceptionpublic static OpcPackage load(java.io.File docxFile, java.lang.String password) throws Docx4JException
docxFile - The docx filepassword - The password, if the file is password protected (compound)Docx4JExceptionpublic static OpcPackage load(PackageIdentifier pkgIdentifier, java.io.File docxFile, java.lang.String password) throws Docx4JException
docxFile - The docx filepassword - The password, if the file is password protected (compound)Docx4JExceptionpublic static OpcPackage load(java.io.InputStream inputStream) throws Docx4JException
inputStream - The docx fileDocx4JExceptionpublic static OpcPackage load(PackageIdentifier pkgIdentifier, java.io.InputStream inputStream) throws Docx4JException
inputStream - The docx fileDocx4JExceptionpublic static OpcPackage load(java.io.InputStream inputStream, java.lang.String password) throws Docx4JException
inputStream - The docx filepassword - The password, if the file is password protected (compound)Docx4JException@Deprecated public static OpcPackage load(java.io.InputStream is, boolean docxFormat) throws Docx4JException
is - docxFormat - Docx4JExceptionpublic static OpcPackage load(java.io.InputStream is, Filetype type) throws Docx4JException
is - docxFormat - Docx4JExceptionpublic static OpcPackage load(java.io.InputStream is, Filetype type, java.lang.String password) throws Docx4JException
is - docxFormat - Docx4JExceptionpublic static OpcPackage load(java.io.File file, Filetype type) throws Docx4JException
is - docxFormat - Docx4JExceptionpublic static OpcPackage load(java.io.File file, Filetype type, java.lang.String password) throws Docx4JException
is - docxFormat - Docx4JExceptionpublic void save(java.io.File file)
throws Docx4JException
Docx4JExceptionpublic void save(java.io.File outFile,
int flags)
throws Docx4JException
Docx4JExceptionpublic void save(java.io.File outFile,
int flags,
java.lang.String password)
throws Docx4JException
Docx4JExceptionpublic void save(java.io.OutputStream outStream)
throws Docx4JException
Docx4JExceptionpublic void save(java.io.OutputStream outStream,
int flags)
throws Docx4JException
Docx4JExceptionpublic void save(java.io.OutputStream outStream,
int flags,
java.lang.String password)
throws Docx4JException
Docx4JExceptionpublic boolean setPartShortcut(Part part, java.lang.String relationshipType)
BasesetPartShortcut in class Basepublic DocPropsCorePart getDocPropsCorePart()
public void addDocPropsCorePart()
public DocPropsExtendedPart getDocPropsExtendedPart()
public void addDocPropsExtendedPart()
public DocPropsCustomPart getDocPropsCustomPart()
public void addDocPropsCustomPart()
public void setTitle(java.lang.String title)
public java.lang.String getTitle()
public OpcPackage clone()
clone in class java.lang.Objectpublic OpcPackage cloneAs(java.lang.String targetContentType) throws Docx4JException
Docx4JExceptionpublic java.lang.String name()
name in interface PackageIdentifierpublic void setName(java.lang.String name)
Copyright © 2007–2023. All rights reserved.