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"? delete-authors="text"? staged="text"? activatedate="text"? expiredate="text"? creationdate="text"? last-modified="text"? first-published="text"? keep-last-modified="(true|false)"? > <section-ref/>* <relation>...</relation>* <reference/>* <field>...</field>* <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.
Only one form of the tag
element may be used:
Content tag.
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 to 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>
This example imports a content item and inserts it into four different sections, two of which belong to a different publication. One of the local sections is set to be the content item's home section. In addition, one of the remote sections is set to be the content item's home section in that publication.
<content source="ex" sourceid="99" type="news" state="published"> <section-ref unique-name="sports" home-section="true"/> <section-ref unique-name="ece_frontpage"/> <section-ref unique-name="sports" home-section="true" publication-name="other"/> <section-ref unique-name="ece_frontpage" publication-name="other"/> <field name="title">Local Cup Fiasco</field> <field name="leadtext">...</field> <field name="body">...</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. Importing a content item with this state publishes any staged changes. For further information, see the description of the
staged
attribute. 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
If specified, this attribute is used when importing new content items that do not already exist in the database. When importing updates to content items that already exist it is used as follows:
-
If the publishing status of the content item is not being changed by the import operation, then it is ignored
-
If the existing content item was not published and the new imported content item is published, then it is used
If
publishdate
is omitted when importing a new content item, then:-
If the publishing status of the content item is not being changed by the import operation, the publish date is left unset
-
If the existing content item was not published and the new imported content item is published, the publish date is set to the current date
-
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. delete-authors="
text"
(optional)-
If this attribute is set to
true
when re-importing an existing content item, then all the content item's authors are deleted. staged="
text"
(optional)-
If set to
true
, this attributes specifies that the imported content item is intended to be treated as a staged revision to a published content item. It only makes sense to set this attribute if staging is enabled for the content item you are importing. For a full description of the content item staging concept, see the Escenic Content Engine Advanced Developer Guide.If staging is enabled, then this attribute determines how the content item is handled after it has been imported. In combination with the
state
attribute, it makes the entire staging workflow available in the syndication module.The following table shows the effect of the
state
andstaged
attributes on the imported content item. The term "draft" is used to mean a content item version in any state other thanpublished
.staged
is not setstaged="false"
staged="true"
state = "published"
, content item NOT already publishedThe existing draft is updated with the imported content and published .
The existing draft is updated with the imported content and published .
The existing draft is updated with the imported content and published .
state = "published"
, content item already publishedAny existing revised draft is updated with the imported content and published. If no revised draft exists, then the published version is updated with the imported content.
Any existing revised draft is updated with the imported content and published. If no revised draft exists, then the published version is updated with the imported content.
Any existing revised draft is updated with the imported content and published. If no revised draft exists, then the published version is updated with the imported content.
state != "published"
, content item NOT already publishedThe existing draft is updated with the imported content.
The existing draft is updated with the imported content.
The existing draft is updated with the imported content.
state != "published"
, content item already publishedAny existing revised draft is updated with the imported content. If no revised draft exists, then the published version is updated with the imported content.
The existing published version is updated with the imported content and then unpublished.
A revised draft is created based on the published version, then updated with the imported content. The original published version is still published.
If staging is not enabled for the content item you are importing, then the
state
attribute is ignored.This attribute is set by the export subsystem when the export of staged content items (that is, revised drafts of published content items) is enabled. It is set to
true
when exporting a staged content item. 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.
last-modified="
text"
(optional)-
The date/time this content item was last modified, 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. When importing updates to content items that already exist it is ignored and the updated content item's last modified date is set to the current date.
If it is omitted when importing a new content item, then the new content item's last modified date is set to the current date.
first-published="
text"
(optional)-
The date/time this content item was first published, 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. When importing updates to content items that already exist it is ignored and the updated content item's first published date is left unchanged.
If it is omitted when importing a new content item and the content item is in the published state, then the new content item's first published date is set to the current date.
keep-last-modified="
(true|false)"
(optional)-
Determines whether or not an existing content item's last modified date is changed during import:
-
If
keep-last-modified
is set totrue
then the last modified date is not changed. -
If
keep-last-modified
is set tofalse
then the last modified date is set to the current date.
When importing new content items that do not already exist in the database, this attribute is ignored.
-