Skip to content

uEdit Document Model

maria121206 edited this page Nov 12, 2014 · 3 revisions

uEdit uses a document model to describe the document edited by the uEdit application. There are two types of documents, each corresponding to one of the two modes of uEdit. For the mode of document editing there is a document object of the type UEditDocument that is available via getDocument() method of the uEdit application object. For the mode of rich text editing, the document is actually a rich text document, accessible through the getText() method of the uEdit application object. Its type is UEditRichText.

This entry describes the structure of the two document objects.

UEditDocument

UEditDocument describes a full document with pages and boxes. The following diagram shows the different structures contained in UEditDocument:

UEditDocument members

Each box in the diagram signifies an object. The name of the member in the container is the top text, and the bottom is the type of the object. For example, the spreads of the document are accessible via the spreads array of the UEditDocument object and they are of type UEditSpread.

The following structures exist in a UEditDocument:

  • Master Spreads [UEditMaster] - Master spreads define common spreads properties. For example, they define the pages dimensions and margins. The master spreads of a document are available through its masterSpreads member. It is a key/value map between a master name and the matching spread master object.
  • Spreads [UEditSpread] - A spreads in uEdit is a single row of pages. In Adobe InDesign it is common to have multiple pages in the same spread. XLIM document model allows just one page per spread. UEdit can display multiple pages in the same spread, however such documents are illegal for later XLIM product. As such, this ability should be used for visual purposes only. Spreads refer to their child pages through the pages member, where each page is represented by a UEditPage object. The page content is defined through its array of boxes, where each box is an area of content on the page. Its type would be UEditBox. Boxes can have as content either images, text, line or just simple fills or empty frames.
  • Texts [UEditText] - Texts in uEdit (as in Adobe InDesign) can flow from one box to another, where boxes are frames for the text. The text will flow between the boxes according to their order, and may possibly overflow if there is too much text for the frames to contain. Text in uEdit can contain styled text as well as inline images that flow with the text. Due to being available for multiple frames usage, texts are not owned by UEditBox objects. Rather, they are owned by the document directly through its texts member.
  • Layers [UEditLayer] - Layers are document-wide objects that organize boxes in a z-order. Layers are ordered from bottom to top and any box in the document has a reference to one of them. In a layer, boxes have an internal z-order as well, which is implied by the order of the boxes in the boxes array on the page (which is ordered in z-order in itself). Layers can be turned on and off, this way implementing versioning in the document. A layer may contain a certain content setup targeted to one purpose, and another layer can contain another setup. Commonly visible layers can contain shared content. The layers of a document are available through its layers array. Each UEditBox object also has a reference to its layer through its layer member.
  • Content Objects [UEditContentObject] - Content objects are the personalization variables present in the document. A content object has a type signifying its content type - for example, image, text or style. A document holds a registry of the content objects used in it through its contentObjectsDict member, mapping a content object name to its respective object. The objects are normally used to determine the type of a content object where necessary. For example, to realize if an ADOR used in text is text ADOR or text file ADOR, consult the contentObjectsDict of the document.
  • SwatchList [UEditSwatchList] - The colors used in a page to draw text, frames and fills are described through a swatch list. Each color used in the document has a matching UEditSwatch that describes both its RGB and CMYK values, to allow usage in different environments (e.g. uEdit and Print). The swatch list of a document is accessible through its swatchList member.

UEditRichText

UEditRichText represents a rich text document. Such document is represented by XMPie XNIP format and may be used as a rich text input for a text ADOR or a text file ADOR in the XMPie echo system. The following diagram shows the different structures contained in UEditRichText:

UEditRichText members

The document model shares some members with UEditDocument - swatch list for colors (swatchList), and the registry of content objects (contentObjectsDict) - with the same meanings. UEditRichText does not have pages or boxes as content, instead it has a single text object. It is accessible through the rootText member.