content
Represents an Escenic content item, which is a generic
container for content: it could be a text article, an image or a
multimedia object such as an audio or video object. The kind of
content item represented by a content
element
is specified in the type
attribute.
Syntax
<content id="text"? (source="text" sourceid="text")? dbid="text"? exported-dbid="text"? state="(draft|submitted|approved|published|deleted)"? type="text"? publishdate="text"? delete-relations="text"? activatedate="text"? expiredate="text"? creationdate="text"? > <section-ref/>* <relation>...</relation>* <reference/>* <field>...</field>* <tag>...</tag>* <update/>? <uri>...</uri>? <author/>* <creator/>? <priority/>? </content>
Only one form of the relation
element may be used:
Typed relation.
Only one form of the field
element may be used:
Standard field.
Examples
This example imports a content item. It includes a reference to the author and to a section to which the content item is to belong. This section is set to be the content item's home section. Both the referenced author (i.e person) and the referenced section must already exist in the database or appear before this
content
element in the syndication file.<content source="ex" sourceid="3" type="news" state="published"> <author username="m.cicero"/> <section-ref source="ex" sourceid="s2" home-section="true"/> <field name="title">Ex Article 3</field> <field name="leadtext">Third article</field> <field name="body"> <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc venenatis erat at nisl. In hac habitasse platea dictumst.</p> <p>Sed venenatis purus iaculis turpis.</p> </field> </content>
This example imports an "image" content item. It includes a reference a section to which the content item is to belong. This section is set to be the content item's home section. The referenced section must already exist in the database or appear before this
content
element in the syndication file.Note the use of JSON syntax to include soft crop information in the
representations
field. For more information about this, see Importing Soft Crop Definitions.<content source="ex" sourceid="20" type="picture" state="published"> <section-ref source="ex" sourceid="s2" home-section="true"/> <field name="title">Croc</field> <field name="caption">A Croc on the beach</field> <field name="binary" title="crocodile">/tmp/escenic/import/croc.jpg</field> <field name="representations">{ "thumbnail": { "crop": { "width":400, "height":400, "x":0, "y":54 } }, "narrow": { "crop": { "width":250, "height":200, "x":0, "y":54 } }, "wide": { "crop": { "width":400, "height":400, "x":102, "y":100 } } }</field> </content>
Attributes
id="
text"
(optional)-
A unique identifier for this
content
element. It is only valid and unique within the current syndication file and can be used to enable the establishment of relationships between elements in the file. Other elements in the file haveid-ref
attributes that can be used to referencecontent
elements. If acontent
element does not have anid
attribute then it must have either adbid
attribute or both asource
and asourceid
attribute. Acontent
element may have several or all of these attributes, in which case any of them can be used for establishing relationships.The
id
attribute is not imported along with content items. Unless adbid
attribute has been specified, all imported content items are assigned new internal IDs during import. source="
text"
(optional)-
The name of the system from which this content item originates. Together with the
sourceid
attribute it forms a globally unique external identifier for the content item that can be used for establishing relationships between elements in the syndication file. Other elements in the file havesource
andsourceid
attributes that can be used for this purpose. If this attribute is specified then asourceid
attribute must also be specified. If acontent
element does not have asource
andsourceid
attribute then it must have either adbid
attribute or anid
attribute. Acontent
element may have several or all of these attributes, in which case any of them can be used for establishing relationships.If supplied,
source
andsourceid
are imported and stored with content items. Ifsource
andsourceid
are supplied anddbid
is not supplied, then they are used to lookup an existing content item. If a content item with matchingsource
andsourceid
is found, then this content item is updated; otherwise a new content item is created.If supplied,
source
andsourceid
are imported and stored when creating new content items, but not when updating existing content items. sourceid="
text"
(optional)-
The id of this content item in the system from which it originates. Together with the
source
attribute it forms a globally unique external identifier for thecontent
that can be used for establishing relationships between elements in the syndication file. Other elements in the file havesource
andsourceid
attributes that can be used for this purpose. If this attribute is specified then asource
attribute must also be specified. If acontent
element does not have asource
andsourceid
attribute then it must have either adbid
attribute or anid
attribute. Acontent
element may have several or all of these attributes, in which case any of them can be used for establishing relationships.If
source
andsourceid
are supplied anddbid
is not supplied, then they are used to lookup an existing content item. If a content item with matchingsource
andsourceid
is found, then this content item is updated; otherwise a new content item is created.If supplied,
source
andsourceid
are imported and stored when creating new content items, but not when updating existing content items. dbid="
text"
(optional)-
The internal Content Engine ID of this content item, which can be used when importing updated versions of existing content items. It can also be used for establishing relationships between elements in the syndication file. Other elements in the file have
dbid
attributes that can be used for this purpose. If acontent
element does not have adbid
attribute then it must have either asource
andsourceid
attribute or anid
attribute. Acontent
element may have several or all of these attributes, in which case any of them can be used for establishing relationships.You should only use the
dbid
attribute when importing updated versions of existing content items.This attribute is never present in syndication files that have been exported from a database. The ID is always written to the
exported-dbid
attribute in exported syndication files. exported-dbid="
text"
(optional)-
The internal Content Engine ID of this content item, which can be used to identify the content item in the database from which it was exported.
This attribute is generated during export from the , but ignored during import. It is provided mainly for information and debugging purposes.
state="
(draft|submitted|approved|published|deleted)"
(optional)-
The current state of this content item.
Allowed values are:
draft
(default)-
The content item is a draft. This is the default value when importing.
submitted
-
The content item is submitted for approval.
approved
-
The content item is approved for publishing.
published
-
The content item is published.
deleted
-
The content item has been deleted.
type="
text"
(optional)-
Defines the type of content item represented by this
content
element. For import, the value specified must be the name of a content type as defined in the target publication'scontent-type
resource. The value you specify here will then determine what kind offield
elements thecontent
element may own. publishdate="
text"
(optional)-
The date/time this content item was published, specified in the format:
yyyy-mm-dd hh:mm:ss.ffffffff
delete-relations="
text"
(optional)-
If this attribute is set to
true
when re-importing an existing content item, then all the content item's existing relations are deleted. activatedate="
text"
(optional)-
The date/time this content item was/is to be activated, specified in the format:
yyyy-mm-dd hh:mm:ss.ffffffff
expiredate="
text"
(optional)-
The date/time this content item expired/is to expire, specified in the format:
yyyy-mm-dd hh:mm:ss.ffffffff
creationdate="
text"
(optional)-
The date/time this content item was created, specified in the format:
yyyy-mm-dd hh:mm:ss.ffffffff
If specified, this attribute is used when importing new content items that do not already exist in the database. It is, however, ignored when importing updates to content items that already exist. If it is omitted when importing a new content item, then the new content item's creation date is set to the current date.