Package com.independentsoft.office

# Class SharedObjects

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

public class SharedObjects extends Object
The Class SharedObjects.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `addAltChunk​(RelationshipItem relationship, byte[] buffer, String contentType)`
  Adds an altChunk part (an embedded HTML/RTF/XML document chunk), de-duplicating by relationship target.
  `String`
  `addChart​(RelationshipItem relationship, Object obj)`
  Adds the chart.
  `String`
  `addDiagram​(RelationshipItem relationship, Object obj)`
  Adds the diagram.
  `String`
  `addEmbeddedOleObject​(RelationshipItem relationship, Object obj)`
  Adds the embedded ole object.
  `String`
  `addFont​(RelationshipItem relationship, byte[] buffer)`
  Adds the font.
  `String`
  `addImage​(RelationshipItem relationship, byte[] buffer)`
  Adds the image.
  `String`
  `addTag​(RelationshipItem relationship, byte[] buffer)`
  Adds the tag part.
  `static SharedObjects`
  `create()`
  Creates the.
  `static void`
  `dispose()`
  Dispose.
  `HashMap<RelationshipItem,​String>`
  `getAltChunkContentTypes()`
  Gets the altChunk content types.
  `HashMap<RelationshipItem,​byte[]>`
  `getAltChunks()`
  Gets the altChunk parts.
  `Object`
  `getAttachedTemplateRelationshipItem()`
  Gets the attached template relationship item.
  `HashMap<RelationshipItem,​Object>`
  `getCharts()`
  Gets the charts.
  `Object`
  `getDataSourceFilePathRelationshipItem()`
  Gets the data source file path relationship item.
  `HashMap<RelationshipItem,​Object>`
  `getDiagrams()`
  Gets the diagrams.
  `HashMap<RelationshipItem,​byte[]>`
  `getEmbeddedChartObjects()`
  Gets the embedded chart objects.
  `HashMap<String,​String>`
  `getEmbeddedDocuments()`
  Gets the embedded documents.
  `HashMap<RelationshipItem,​Object>`
  `getEmbeddedOleObjects()`
  Gets the embedded ole objects.
  `HashMap<RelationshipItem,​byte[]>`
  `getFonts()`
  Gets the fonts.
  `HashMap<String,​Object>`
  `getFooters()`
  Gets the footers.
  `HashMap<RelationshipItem,​Object>`
  `getHeaderFooterEmbeddedOleObjects()`
  Gets the header footer embedded ole objects.
  `HashMap<RelationshipItem,​byte[]>`
  `getHeaderFooterImages()`
  Gets the header footer images.
  `HashMap<String,​Object>`
  `getHeaders()`
  Gets the headers.
  `List`
  `getHyperlinks()`
  Gets the hyperlinks.
  `HashMap<RelationshipItem,​byte[]>`
  `getImages()`
  Gets the images.
  `static SharedObjects`
  `getInstance()`
  Gets the single instance of SharedObjects.
  `Object`
  `getManifest()`
  Gets the manifest.
  `HashMap<String,​byte[]>`
  `getOdfImages()`
  Gets the odf images.
  `HashMap<String,​byte[]>`
  `getOleObjects()`
  Gets the ole objects.
  `HashMap<String,​String>`
  `getPreservedEmbeddedObjects()`
  `Object`
  `getRecipients()`
  Gets the recipients.
  `Object`
  `getRecipientsRelationshipItem()`
  Gets the recipients relationship item.
  `Object`
  `getSourceRelationshipItem()`
  Gets the source relationship item.
  `HashMap<RelationshipItem,​byte[]>`
  `getTags()`
  Gets the tags.
  `boolean`
  `isHeaderFooterEmbeddedOleObject()`
  Checks if is header footer embedded ole object.
  `boolean`
  `isHeaderFooterImage()`
  Checks if is header footer image.
  `String`
  `reserveControlXmlId​(String id)`
  Claims a document-unique xml:id for an ODF form control.
  `String`
  `reserveDrawingObjectId​(String id)`
  Claims a document-unique wp:docPr/@id.
  `void`
  `setAttachedTemplateRelationshipItem​(Object attachedTemplateRelationshipItem)`
  Sets the attached template relationship item.
  `void`
  `setDataSourceFilePathRelationshipItem​(Object dataSourceFilePathRelationshipItem)`
  Sets the data source file path relationship item.
  `void`
  `setHeaderFooterEmbeddedOleObject​(boolean isHeaderFooterEmbeddedOleObject)`
  Sets the header footer embedded ole object.
  `void`
  `setHeaderFooterImage​(boolean isHeaderFooterImage)`
  Sets the header footer image.
  `void`
  `setManifest​(Object manifest)`
  Sets the manifest.
  `void`
  `setRecipients​(Object recipients)`
  Sets the recipients.
  `void`
  `setRecipientsRelationshipItem​(Object recipientsRelationshipItem)`
  Sets the recipients relationship item.
  `void`
  `setSourceRelationshipItem​(Object sourceRelationshipItem)`
  Sets the source relationship item.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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()