Class SharedObjects

java.lang.Object
com.independentsoft.office.SharedObjects

public class SharedObjects extends Object
The Class SharedObjects.
  • Method Details

    • getInstance

      public static SharedObjects getInstance()
      Gets the single instance of SharedObjects.
      Returns:
      single instance of SharedObjects
    • create

      public static SharedObjects create()
      Creates the.
      Returns:
      the shared objects
    • dispose

      public static void dispose()
      Dispose.
    • reserveDrawingObjectId

      public String reserveDrawingObjectId(String id)
      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

      public String reserveControlXmlId(String id)
      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

      public String addImage(RelationshipItem relationship, byte[] buffer)
      Adds the image.
      Parameters:
      relationship - the relationship
      buffer - the buffer
      Returns:
      the string
    • addAltChunk

      public String addAltChunk(RelationshipItem relationship, byte[] buffer, String contentType)
      Adds an altChunk part (an embedded HTML/RTF/XML document chunk), de-duplicating by relationship target.
      Parameters:
      relationship - the relationship
      buffer - the content bytes
      contentType - the content type
      Returns:
      the relationship id
    • addFont

      public String addFont(RelationshipItem relationship, byte[] buffer)
      Adds the font.
      Parameters:
      relationship - the relationship
      buffer - the buffer
      Returns:
      the string
    • addTag

      public String addTag(RelationshipItem relationship, byte[] buffer)
      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 relationship
      buffer - the buffer
      Returns:
      the string
    • getTags

      public HashMap<RelationshipItem,​byte[]> getTags()
      Gets the tags.
      Returns:
      the tags
    • addChart

      public String addChart(RelationshipItem relationship, Object obj)
      Adds the chart.
      Parameters:
      relationship - the relationship
      obj - the obj
      Returns:
      the string
    • addDiagram

      public String addDiagram(RelationshipItem relationship, Object obj)
      Adds the diagram.
      Parameters:
      relationship - the relationship
      obj - the obj
      Returns:
      the string
    • addEmbeddedOleObject

      public String addEmbeddedOleObject(RelationshipItem relationship, Object obj)
      Adds the embedded ole object.
      Parameters:
      relationship - the relationship
      obj - the obj
      Returns:
      the string
    • getHyperlinks

      public List getHyperlinks()
      Gets the hyperlinks.
      Returns:
      the hyperlinks
    • getEmbeddedChartObjects

      public HashMap<RelationshipItem,​byte[]> getEmbeddedChartObjects()
      Gets the embedded chart objects.
      Returns:
      the embedded chart objects
    • getEmbeddedOleObjects

      public HashMap<RelationshipItem,​Object> getEmbeddedOleObjects()
      Gets the embedded ole objects.
      Returns:
      the embedded ole objects
    • getCharts

      public HashMap<RelationshipItem,​Object> getCharts()
      Gets the charts.
      Returns:
      the charts
    • getDiagrams

      public HashMap<RelationshipItem,​Object> getDiagrams()
      Gets the diagrams.
      Returns:
      the diagrams
    • getFonts

      public HashMap<RelationshipItem,​byte[]> getFonts()
      Gets the fonts.
      Returns:
      the fonts
    • getImages

      public HashMap<RelationshipItem,​byte[]> getImages()
      Gets the images.
      Returns:
      the images
    • getAltChunks

      public HashMap<RelationshipItem,​byte[]> getAltChunks()
      Gets the altChunk parts.
      Returns:
      the altChunks
    • getAltChunkContentTypes

      public HashMap<RelationshipItem,​String> getAltChunkContentTypes()
      Gets the altChunk content types.
      Returns:
      the altChunk content types
    • getHeaderFooterEmbeddedOleObjects

      public HashMap<RelationshipItem,​Object> getHeaderFooterEmbeddedOleObjects()
      Gets the header footer embedded ole objects.
      Returns:
      the header footer embedded ole objects
    • getHeaderFooterImages

      public HashMap<RelationshipItem,​byte[]> getHeaderFooterImages()
      Gets the header footer images.
      Returns:
      the header footer images
    • getHeaders

      public HashMap<String,​Object> getHeaders()
      Gets the headers.
      Returns:
      the headers
    • getFooters

      public HashMap<String,​Object> getFooters()
      Gets the footers.
      Returns:
      the footers
    • getRecipients

      public Object getRecipients()
      Gets the recipients.
      Returns:
      the recipients
    • setRecipients

      public void setRecipients(Object recipients)
      Sets the recipients.
      Parameters:
      recipients - the new recipients
    • getRecipientsRelationshipItem

      public Object getRecipientsRelationshipItem()
      Gets the recipients relationship item.
      Returns:
      the recipients relationship item
    • setRecipientsRelationshipItem

      public void setRecipientsRelationshipItem(Object recipientsRelationshipItem)
      Sets the recipients relationship item.
      Parameters:
      recipientsRelationshipItem - the new recipients relationship item
    • isHeaderFooterEmbeddedOleObject

      public boolean isHeaderFooterEmbeddedOleObject()
      Checks if is header footer embedded ole object.
      Returns:
      true, if is header footer embedded ole object
    • setHeaderFooterEmbeddedOleObject

      public void setHeaderFooterEmbeddedOleObject(boolean isHeaderFooterEmbeddedOleObject)
      Sets the header footer embedded ole object.
      Parameters:
      isHeaderFooterEmbeddedOleObject - the new header footer embedded ole object
    • isHeaderFooterImage

      public boolean isHeaderFooterImage()
      Checks if is header footer image.
      Returns:
      true, if is header footer image
    • setHeaderFooterImage

      public void setHeaderFooterImage(boolean isHeaderFooterImage)
      Sets the header footer image.
      Parameters:
      isHeaderFooterImage - the new header footer image
    • getSourceRelationshipItem

      public Object getSourceRelationshipItem()
      Gets the source relationship item.
      Returns:
      the source relationship item
    • setSourceRelationshipItem

      public void setSourceRelationshipItem(Object sourceRelationshipItem)
      Sets the source relationship item.
      Parameters:
      sourceRelationshipItem - the new source relationship item
    • getDataSourceFilePathRelationshipItem

      public Object getDataSourceFilePathRelationshipItem()
      Gets the data source file path relationship item.
      Returns:
      the data source file path relationship item
    • setDataSourceFilePathRelationshipItem

      public void setDataSourceFilePathRelationshipItem(Object dataSourceFilePathRelationshipItem)
      Sets the data source file path relationship item.
      Parameters:
      dataSourceFilePathRelationshipItem - the new data source file path relationship item
    • getAttachedTemplateRelationshipItem

      public Object getAttachedTemplateRelationshipItem()
      Gets the attached template relationship item.
      Returns:
      the attached template relationship item
    • setAttachedTemplateRelationshipItem

      public void setAttachedTemplateRelationshipItem(Object attachedTemplateRelationshipItem)
      Sets the attached template relationship item.
      Parameters:
      attachedTemplateRelationshipItem - the new attached template relationship item
    • getManifest

      public Object getManifest()
      Gets the manifest.
      Returns:
      the manifest
    • setManifest

      public void setManifest(Object manifest)
      Sets the manifest.
      Parameters:
      manifest - the new manifest
    • getOdfImages

      public HashMap<String,​byte[]> getOdfImages()
      Gets the odf images.
      Returns:
      the odf images
    • getOleObjects

      public HashMap<String,​byte[]> getOleObjects()
      Gets the ole objects.
      Returns:
      the ole objects
    • getEmbeddedDocuments

      public HashMap<String,​String> getEmbeddedDocuments()
      Gets the embedded documents.
      Returns:
      the embedded documents
    • getPreservedEmbeddedObjects

      public HashMap<String,​String> getPreservedEmbeddedObjects()