Information about one or more frames is to be stored in the data pool. This information should be retrieved at a later time and applied to the same frames.

Some amount of frame information is stored in the data pool, with some metadata about what document it came from.

Since it is not always possible to associate frame information with its original frame unambigiously, it is possible to specify search criteria when writing (should you want to overwrite existing data) and restoring. Additionally, you can choose a behaviour, should the criteria match multiple search results.

Frame infos are only used by cScript functions and the layout rule "set frame geometry".

The frame info data is stored as follows:

The following information is stored in the data structure for a frame:

Publishing Server Attribute Attribut in XML, ODBC, SOAP Data Type Description
PLACEHOLDER_ID placeholderId Integer (not null) ID of the frame placeholder. Does not have to be specified. Defaults to 0 if unspecified.
FRAME_UID frameUID Integer (not null) InDesign® Frame ID
COMETGROUP_ID cometGroupID Integer (not null) ID of the comet group, as assigned by InDesign®. If the frame is part of no comet group, this defaults to 0.
TEMPLATE_ID templateId Integer (not null) ID of the template (pageitem) used to build the frame (Main ID of a smart template). Should the frame be created without a template, this defaults to 0.
FRAME_LABEL frameLabel varchar(255) (null) This value is set in the „Template Behaviour" panel. This is only set if the frame was created with a template, and if it has a label.
PUBPLAN_DOCUMENT_ID publicationPlannerDocumentId Integer (not null) Reference to the document in th eplanner (puc_document).
DOCUMENT documentName varchar(255) (null) File name of the InDesign® document the information was sourced from.
PATH documentPath varchar(1000) (null) Path to the directory containing the InDesign® document the information was sourced from.
PAGE page varchar(255) (null) The page the frame is located on in the document. This becomes important when a template spans multiple pages and a frame is repeated and written multiple times.
Note: The page count starts at 1, not with the pagination of the document within the publication.
LAYER layer varchar(255) (null) The layer the frame is located on.
SCRIPT_TAGS scriptTags CLOB XML structure containing the tags of a frame e.g.:
<scriptTags>
 <scriptTag>
  <key>AAA</key>
  <value>BBB</value>
 </scriptTag>
 <scriptTag>
  <key>FFF</key>
  <value>HHH</value>
 </scriptTag>
</scriptTags>
FRAMEINFO_ID frameInfoId varchar(255) (null) Value of the frame tag "frameInfoID" if it exists.
RECORD_ID recordId Integer (null) Record ID of the frame placeholder
RECORD_ID2 recordId2 Integer (null) Record ID 2 of the frame placeholder
RECORD_ID3 recordId3 Integer (null) Record ID 3 of the frame placeholder
RECORD_STRING_ID recordStringId varchar(255) (null) Record String ID of the frame placeholder
OBJ_ENTITY_CLASS objectEntityClass varchar(255) (null) ObjectEntityClass of the frame placeholder
OBJ_ENTITY_ID objectEntityId varchar(255) (null) ObjectEntityId of the frame placeholder
OBJ_GRP_ID objectGroupId varchar(255) (null) ObjectGroupId of the frame placeholder
OBJ_ID objectId varchar(255) (null) ObjectId of the frame placeholder
PARENT_OBJ_ENTITY_CLASS parentObjectEntityClass varchar(255) (null) ParentObjectEntityClass of the frame placeholder
PARENT_OBJ_ENTITY_ID parentObjectEntityId varchar(255) (null) ParentObjectEntityId of the frame placeholder
PARENT_OBJ_GRP_ID parentObjectGroupId varchar(255) (null) ParentObjectGroupId of the frame placeholder
PARENT_OBJ_ID parentObjectId varchar(255) (null) ParentObjectId of the frame placeholder
BUILT_BY_RECORD_ID builtByRecordId Integer(null)
BUILT_BY_RECORD_ID2 builtByRecordId2 Integer(null)
BUILT_BY_RECORD_ID3 builtByRecordId3 Integer(null)
BUILT_BY_RECORD_STRING_ID builtByRecordStringId varchar(255) (null)
BUILT_BY_OBJ_ENTITY_CLASS builtByObjectEntityClass varchar(255) (null)
BUILT_BY_OBJ_ENTITY_ID builtByObjectEntityId varchar(255) (null)
BUILT_BY_OBJ_GRP_ID builtByObjectGroupId varchar(255) (null)
BUILT_BY_OBJ_ID builtByObjectId varchar(255) (null)
BUILT_BY_OBJ_GRP_ID builtByObjectGroupId varchar(255) (null)
BUILT_BY_PARENT_OBJ_ENTITY_CLASS builtByParentObjectEntityClass varchar(255) (null)
BUILT_BY_PARENT_OBJ_ENTITY_ID builtByParentObjectEntityId varchar(255) (null)
BUILT_BY_PARENT_OBJ_GRP_ID builtByParentObjectGroupId varchar(255) (null)
BUILT_BY_PARENT_OBJ_ID builtByParentObjectId varchar(255) (null)
PLACEHOLDER_INFO1 placeholderInfo1 varchar(255) (null) PlaceholderInfo1 of the frame placeholder
PLACEHOLDER_INFO2 placeholderInfo2 varchar(255) (null) PlaceholderInfo2 of the frame placeholder
ASSORTMENT assortment varchar(255) (null)
COUNTRY country varchar(255) (null)
LANGUAGE language varchar(255) (null)
WELL well varchar(255) (null)
X_POS_ABSOLUTE xPositionAbsolute Float (not null) X-Position of the upper left corner of the InDesign® document (specified in Points)
Y_POS_ABSOLUTE yPositionAbsolute Float (not null) Y-Position of the upper left corner of the InDesign® document (specified in Points)
X_POS_RELATIVE xPositionRelative Float (null) X-Position relative to the upper left corner of the comet group (specified in Points). If no comet group is given, this is set to 0.
Y_POS_RELATIVE yPositionRelative Float (null) Y-Position relative to the upper left corner of the comet group (specified in Points). If no comet group is given, this is set to 0..
WIDTH width Float (not null) Width of the frame in Points
HEIGHT height Float (not null) Height of the frame in Points
FRAME_ROTATION frameRotation Float (not null) Rotation of the frame
FRAME_SKEW frameSkew Float (not null) Skew of the frame
FRAME_TYPE frameType varchar(30) (not null) Type of the frame. Valid values are: "text", "graphic", "unknown"
OBJECT_STYLE objectStyle varchar(255) (null) Name of the frame's object style
IMAGE_X_OFFSET imageXOffset Float (null) X-Offset of the image within the frame (specified in Points).
Note: only applicable to image frames
IMAGE_Y_OFFSET imageYOffset Float (null) Y-Offset of the image within the frame (specified in Points).
Note: only applicable to image frames
IMAGE_X_SCALE imageXScale Float (null) X-Scale factor of the image within the frame.
Note: only applicable to image frames
IMAGE_Y_SCALE imageYScale Float (null) Y-Scale factor of the image within the frame.
Note: only applicable to image frames
IMAGE_ROTATION imageRotation Float (null) Rotation of the image within the frame.
Note: only applicable to image frames
IMAGE_SKEW imageSkew Float (null) Skew of the angle within the frame.
Note: only applicable to image frames
CREATEDON createdOn Datetime Date of initial write of the frame info instance.
UPDATEDON updatedOn Datetime Date of most recent update of the frame info instance.
CREATEDBY createdBy varchar(50) (not null) User who initially wrote the frame info instance.
UPDATEDBY updatedBy varchar(50) (not null) User who most recently updated the frame info instance.

To associate stored frame information with a frame in InDesign®, different search criteria are required, depending on your project. Search criteria can be separated into the search space (filters which documents will be searched) and frame search methods (filters frame information). All relevant cScript functions expect both parameters to be set, as does the "set frame geometry" layoutrule. If a record matches all search criteria (i.e. all data matches the currently selected frame in InDesign®), the record is considered a match.

The search space limits the search to a specific set of documents. The search space is specified by the docType script parameter. The following values are accepted:

Name Identifier in the script
Current Document kLocalDoc

Die Rahmensuchkriterien geben an, welche Werte eines Datensatzes mit denen des aktuellen InDesign® Rahmens verglichen werden sollen. Die Rahmensuchkriterien entsprechen dem Skriptparameter frameSearchFlags. Folgende Rahmensuchkriterien stehen zur Verfügung:

Name Identifier in the script Notes
Default kUseDefault
templateId kUseTemplateId
frameLabel kUseFrameLabel
recordStringId kUseRecordStringId
buildByRecordStringId kUseBuildByRecordStringId
placeHolderId kUsePlaceholderId
frameType kUseFrameType
scriptTags kUseScriptTags
frameUID kUseFrameUID
placeHolderInfo1 kUsePlaceholderInfo1
placeHolderInfo2 kUsePlaceholderInfo2
placeHolderInfo2 kUsePlaceholderInfo2
frameInfoId kUseFrameInfoId
recordId kUseRecordId Not available in Pubserver connections!
recordId2 kUseRecordId2
recordId3 kUseRecordId3
buildByRecordId kUseBuildByRecordId
buildByRecordId2 kUseBuildByRecordId2
buildByRecordId3 kUseBuildByRecordId3

Note:
The parameter kUseDefault is equivalent to kUseTemplateId + kUseFrameLabel + kUseRecordStringId + kUseBuildByRecordStringId.

Note:
The parameter kUseFrameInfoId uses the frame label (script tag) with the key „frameInfoId“ for identification. This first has to be initialized. To do so, use the helper function frame::set_frameinfoid.

All search criteria can arbitrarily combined in cScript as a sum.

You can configure the behaviour for cases where multiple frame infos match the search criteria using the script parameter conflictBehavior. The following values are accepted:
Name Identifier in the script Description
Ignore kThrowError Ignores the frame and does not execute any actions. Additionally, an error is written to the log file.
Use latest kUseLatest Uses the record with the most recent updatedOn date.

When restoring frame infos, not all recorded information needs to be applied to the frame. The script parameter propertyFlags determines, which fields are restored. The following values are accepted:

Field Name Identifier in the script
SCRIPT_TAGS kApplyScriptTags
PAGE kApplyPage
LAYER kApplyLayer
X_POS_ABSOLUTE kApplyXPosAbs
Y_POS_ABSOLUTE kApplyYPosAbs
X_POS_RELATIVE kApplyXPosRel
Y_POS_RELATIVE kApplyYPosRel
WIDTH kApplyWidth
HEIGHT kApplyHeight
FRAME_ROTATION kApplyFrameRotate
FRAME_SKEW kApplyFrameSkew
IMAGE_X_OFFSET kApplyImageXOffset
IMAGE_Y_OFFSET kApplyImageYOffset
IMAGE_X_SCALE kApplyImageXScale
IMAGE_Y_SCALE kApplyImageYScale
IMAGE_ROTATION kApplyImageRotate
IMAGE_SKEW kApplyImageSkew
OBJECT_STYLE kApplyObjectStyle

cScript functions are provided for writing and restoring frame infos for individual frames, frames in a comet group, arbitrary lists of frames, and for all frames in a document.

To use constants such as kApplyWidth or kUseFrameLabel, you will need to include internal/frameinfos.h your scripts.

The following functions are provided for writing frame infos:

The following functions are provided for restoring frame infos:

To restore frame infos, the layout rule "set frame geometry" is provided. Its parameters match the script parameters:

Name Script parameter
Search Space documentType
Search Method frameSearchFlags
Restore Fields propertyFlags
Conflict Behaviour conflictBehavior

In order to use frame infos, an extension to the data model is required. The following MySQL statement creates the required table:

CREATE TABLE `comet_frameinfo` (
`ID` int(30) NOT NULL AUTO_INCREMENT,
`placeholderId` int(30) NOT NULL DEFAULT '0',
`frameUID` int(30) NOT NULL,
`cometGroupId` int(30) NOT NULL DEFAULT '0',
`templateId` int(30) NOT NULL,
`frameLabel` varchar(255) DEFAULT NULL,
`publicationPlannerDocumentId` varchar(255) DEFAULT NULL,
`documentName` varchar(255) DEFAULT NULL,
`documentPath` varchar(1000) DEFAULT NULL,
`page` int(30) DEFAULT NULL,
`layer` varchar(255) DEFAULT NULL,
`scriptTags` text,
`recordId` int(30) DEFAULT NULL,
`recordId2` int(30) DEFAULT NULL,
`recordId3` int(30) DEFAULT NULL,
`recordStringId` varchar(255) DEFAULT NULL,
`objectEntityClass` varchar(255) DEFAULT NULL,
`objectEntityId` varchar(255) DEFAULT NULL,
`objectGroupId` varchar(255) DEFAULT NULL,
`objectId` varchar(255) DEFAULT NULL,
`parentObjectEntityClass` varchar(255) DEFAULT NULL,
`parentObjectEntityId` varchar(255) DEFAULT NULL,
`parentObjectGroupId` varchar(255) DEFAULT NULL,
`parentObjectId` varchar(255) DEFAULT NULL,
`builtByRecordId` int(30) DEFAULT NULL,
`builtByRecordId2` int(30) DEFAULT NULL,
`builtByRecordId3` int(30) DEFAULT NULL,
`builtByRecordStringId` varchar(255) DEFAULT NULL,
`builtByObjectEntityClass` varchar(255) DEFAULT NULL,
`builtByObjectEntityId` varchar(255) DEFAULT NULL,
`builtByObjectGroupId` varchar(255) DEFAULT NULL,
`builtByObjectId` varchar(255) DEFAULT NULL,
`builtByParentObjectEntityClass` varchar(255) DEFAULT NULL,
`builtByParentObjectEntityId` varchar(255) DEFAULT NULL,
`builtByParentObjectGroupId` varchar(255) DEFAULT NULL,
`builtByParentObjectId` varchar(255) DEFAULT NULL,
`placeholderInfo1` varchar(255) DEFAULT NULL,
`placeholderInfo2` varchar(255) DEFAULT NULL,
`assortment` varchar(255) DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
`language` varchar(255) DEFAULT NULL,
`well` varchar(255) DEFAULT NULL,
`xPositionAbsolute` float NOT NULL,
`yPositionAbsolute` float NOT NULL,
`xPositionRelative` float DEFAULT NULL,
`yPositionRelative` float DEFAULT NULL,
`width` float NOT NULL,
`height` float NOT NULL,
`frameRotation` float NOT NULL DEFAULT '0',
`frameSkew` float NOT NULL DEFAULT '0',
`frameType` varchar(30) NOT NULL,
`objectStyle` varchar(255) DEFAULT NULL,
`imageXOffset` float DEFAULT NULL,
`imageYOffset` float DEFAULT NULL,
`imageXScale` float DEFAULT NULL,
`imageYScale` float DEFAULT NULL,
`imageRotation` float DEFAULT NULL,
`imageSkew` float DEFAULT NULL,
`createdOn` datetime DEFAULT NULL,
`updatedOn` datetime DEFAULT NULL,
`createdBy` varchar(50) DEFAULT NULL,
`updatedBy` varchar(50) DEFAULT NULL,
`frameInfoId` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;