Package com.independentsoft.office
Class SharedObjects
java.lang.Object
com.independentsoft.office.SharedObjects
The Class SharedObjects.
-
Method Summary
Modifier and TypeMethodDescriptionaddAltChunk(RelationshipItem relationship, byte[] buffer, String contentType)Adds an altChunk part (an embedded HTML/RTF/XML document chunk), de-duplicating by relationship target.addChart(RelationshipItem relationship, Object obj)Adds the chart.addDiagram(RelationshipItem relationship, Object obj)Adds the diagram.addEmbeddedOleObject(RelationshipItem relationship, Object obj)Adds the embedded ole object.addFont(RelationshipItem relationship, byte[] buffer)Adds the font.addImage(RelationshipItem relationship, byte[] buffer)Adds the image.addTag(RelationshipItem relationship, byte[] buffer)Adds the tag part.static SharedObjectscreate()Creates the.static voiddispose()Dispose.Gets the altChunk content types.HashMap<RelationshipItem,byte[]>Gets the altChunk parts.Gets the attached template relationship item.Gets the charts.Gets the data source file path relationship item.Gets the diagrams.HashMap<RelationshipItem,byte[]>Gets the embedded chart objects.Gets the embedded documents.Gets the embedded ole objects.HashMap<RelationshipItem,byte[]>getFonts()Gets the fonts.Gets the footers.Gets the header footer embedded ole objects.HashMap<RelationshipItem,byte[]>Gets the header footer images.Gets the headers.Gets the hyperlinks.HashMap<RelationshipItem,byte[]>Gets the images.static SharedObjectsGets the single instance of SharedObjects.Gets the manifest.Gets the odf images.Gets the ole objects.Gets the recipients.Gets the recipients relationship item.Gets the source relationship item.HashMap<RelationshipItem,byte[]>getTags()Gets the tags.booleanChecks if is header footer embedded ole object.booleanChecks if is header footer image.Claims a document-unique xml:id for an ODF form control.Claims a document-unique wp:docPr/@id.voidsetAttachedTemplateRelationshipItem(Object attachedTemplateRelationshipItem)Sets the attached template relationship item.voidsetDataSourceFilePathRelationshipItem(Object dataSourceFilePathRelationshipItem)Sets the data source file path relationship item.voidsetHeaderFooterEmbeddedOleObject(boolean isHeaderFooterEmbeddedOleObject)Sets the header footer embedded ole object.voidsetHeaderFooterImage(boolean isHeaderFooterImage)Sets the header footer image.voidsetManifest(Object manifest)Sets the manifest.voidsetRecipients(Object recipients)Sets the recipients.voidsetRecipientsRelationshipItem(Object recipientsRelationshipItem)Sets the recipients relationship item.voidsetSourceRelationshipItem(Object sourceRelationshipItem)Sets the source relationship item.
-
Method Details
-
getInstance
Gets the single instance of SharedObjects.- Returns:
- single instance of SharedObjects
-
create
Creates the.- Returns:
- the shared objects
-
dispose
public static void dispose()Dispose. -
reserveDrawingObjectId
Claims a document-unique wp:docPr/@id. The drawing keeps the id it carries when that id is usable and not already taken in this save; anything else - unset, non-positive, unparseable, or a duplicate that a copied drawing brought over from its source - is replaced with the next free value. Uniqueness can only be decided here, where every drawing written in one save is visible; the element that writes the attribute sees one drawing and cannot know about others. This instance lives exactly one save (see create/dispose), so numbering restarts each time.- Parameters:
id- the id the drawing carries, or null- Returns:
- the id to write
-
reserveControlXmlId
Claims a document-unique xml:id for an ODF form control. OpenDocument 1.2 REQUIRES xml:id on every control (form:id is the deprecated 1.1 spelling, kept for compatibility), the value has to be an NCName, and xml:id is ID-typed so it must be unique across the whole document - which only this per-save instance can see. The control keeps the id it carries when that is a usable, unclaimed NCName; anything else gets the next free "control1", "control2"... This instance lives exactly one save (see create/dispose), so numbering restarts each time.- Parameters:
id- the id the control carries, or null- Returns:
- the id to write
-
addImage
Adds the image.- Parameters:
relationship- the relationshipbuffer- the buffer- Returns:
- the string
-
addAltChunk
Adds an altChunk part (an embedded HTML/RTF/XML document chunk), de-duplicating by relationship target.- Parameters:
relationship- the relationshipbuffer- the content bytescontentType- the content type- Returns:
- the relationship id
-
addFont
Adds the font.- Parameters:
relationship- the relationshipbuffer- the buffer- Returns:
- the string
-
addTag
Adds the tag part.Customer-data tag parts (p:custDataLst/p:tags). No dedupe: each registration gets its own part so every host part's relationship list stays self-contained (deduping across hosts would leave the second host's r:id without a matching relationship).
- Parameters:
relationship- the relationshipbuffer- the buffer- Returns:
- the string
-
getTags
Gets the tags.- Returns:
- the tags
-
addChart
Adds the chart.- Parameters:
relationship- the relationshipobj- the obj- Returns:
- the string
-
addDiagram
Adds the diagram.- Parameters:
relationship- the relationshipobj- the obj- Returns:
- the string
-
addEmbeddedOleObject
Adds the embedded ole object.- Parameters:
relationship- the relationshipobj- the obj- Returns:
- the string
-
getHyperlinks
Gets the hyperlinks.- Returns:
- the hyperlinks
-
getEmbeddedChartObjects
Gets the embedded chart objects.- Returns:
- the embedded chart objects
-
getEmbeddedOleObjects
Gets the embedded ole objects.- Returns:
- the embedded ole objects
-
getCharts
Gets the charts.- Returns:
- the charts
-
getDiagrams
Gets the diagrams.- Returns:
- the diagrams
-
getFonts
Gets the fonts.- Returns:
- the fonts
-
getImages
Gets the images.- Returns:
- the images
-
getAltChunks
Gets the altChunk parts.- Returns:
- the altChunks
-
getAltChunkContentTypes
Gets the altChunk content types.- Returns:
- the altChunk content types
-
getHeaders
Gets the headers.- Returns:
- the headers
-
getRecipients
Gets the recipients.- Returns:
- the recipients
-
setRecipients
Sets the recipients.- Parameters:
recipients- the new recipients
-
getRecipientsRelationshipItem
Gets the recipients relationship item.- Returns:
- the recipients relationship item
-
setRecipientsRelationshipItem
Sets the recipients relationship item.- Parameters:
recipientsRelationshipItem- the new recipients relationship item
-
getSourceRelationshipItem
Gets the source relationship item.- Returns:
- the source relationship item
-
setSourceRelationshipItem
Sets the source relationship item.- Parameters:
sourceRelationshipItem- the new source relationship item
-
getDataSourceFilePathRelationshipItem
Gets the data source file path relationship item.- Returns:
- the data source file path relationship item
-
setDataSourceFilePathRelationshipItem
Sets the data source file path relationship item.- Parameters:
dataSourceFilePathRelationshipItem- the new data source file path relationship item
-
getAttachedTemplateRelationshipItem
Gets the attached template relationship item.- Returns:
- the attached template relationship item
-
setAttachedTemplateRelationshipItem
Sets the attached template relationship item.- Parameters:
attachedTemplateRelationshipItem- the new attached template relationship item
-
getManifest
Gets the manifest.- Returns:
- the manifest
-
setManifest
Sets the manifest.- Parameters:
manifest- the new manifest
-
getOdfImages
Gets the odf images.- Returns:
- the odf images
-
getOleObjects
Gets the ole objects.- Returns:
- the ole objects
-
getEmbeddedDocuments
Gets the embedded documents.- Returns:
- the embedded documents
-
getPreservedEmbeddedObjects
-