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/>*
    <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 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 have id-ref attributes that can be used to reference content elements. If a content element does not have an id attribute then it must have either a dbid attribute or both a source and a sourceid attribute. A content 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 a dbid 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 have source and sourceid attributes that can be used for this purpose. If this attribute is specified then a sourceid attribute must also be specified. If a content element does not have a source and sourceid attribute then it must have either a dbid attribute or an id attribute. A content element may have several or all of these attributes, in which case any of them can be used for establishing relationships.

If supplied, source and sourceid are imported and stored with content items. If source and sourceid are supplied and dbid is not supplied, then they are used to lookup an existing content item. If a content item with matching source and sourceid is found, then this content item is updated; otherwise a new content item is created.

If supplied, source and sourceid 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 the content that can be used for establishing relationships between elements in the syndication file. Other elements in the file have source and sourceid attributes that can be used for this purpose. If this attribute is specified then a source attribute must also be specified. If a content element does not have a source and sourceid attribute then it must have either a dbid attribute or an id attribute. A content element may have several or all of these attributes, in which case any of them can be used for establishing relationships.

If source and sourceid are supplied and dbid is not supplied, then they are used to lookup an existing content item. If a content item with matching source and sourceid is found, then this content item is updated; otherwise a new content item is created.

If supplied, source and sourceid 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 a content element does not have a dbid attribute then it must have either a source and sourceid attribute or an id attribute. A content 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's content-type resource. The value you specify here will then determine what kind of field elements the content 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.