Adding an Enps Content Type
Enps stories (like Escenic content
items) have a customized internal structure consisting of fields such as
title
, body
,
storySlug
and so on. Converting an Enps story into an
Escenic
content item therefore involves:
-
Selecting the Enps fields that contain relevant information for on-line content.
-
Mapping the selected Enps fields to appropriate fields in an Escenic content type.
To achieve this you need to define a specially structured content
type for handling Enps stories, and add it to your publication's
content-type
resource. The name of this content type
must be specified in the contentType
property of the
story creator configuration file (see Editing the Configuration File).
The enps content type must
-
contain one
field
element which has a childstoryid
element that belongs to thehttp://xmlns.escenic.com/2012/newsroom
namespace:<storyid xmlns="http://xmlns.escenic.com/2012/newsroom" />
The element must be empty.
The content item's
storyid
field will be populated with the Enpsstoryid
field. You are recommended to hide this field so that users do not inadvertently change its content.
The newsroom content type may also contain one or more other
field
elements that have child
field
elements belonging to the
http://xmlns.escenic.com/2012/newsroom
namespace:
<field xmlns="http://xmlns.escenic.com/2012/newsroom" xpath="xpath-expression"/>
Elements of this type must be empty, and have one attribute,
xpath
. Here is an example of a content type
definition containing all required newsroom field
elements:
<content-type name="newsroom" xmlns:newsroom="http://xmlns.escenic.com/2012/newsroom"> <ui:title-field>title</ui:title-field> <panel name="main"> <field name="title" type="basic" mime-type="text/plain"> <newsroom:field xpath="/mos/roStorySend/storySlug"/> </field> <field mime-type="application/xhtml+xml" type="basic" name="body"> <newsroom:field xpath="/mos/roStorySend/storyBody"/> </field> <field mime-type="text/plain" type="basic" name="storyid"> <ui:hidden/> <newsroom:storyid /> </field> <field mime-type="text/plain" type="basic" name="summary"> </field> </panel> ... </content-type>
A newsroom:field
element's
xpath
attribute must contain a valid
XPath expression that selects the Enps field you
want to appear in its parent field
. In the example
above, the content item's title
field will receive
content from the Enps storySlug
field (selected by the
XPath expression
/mos/roStorySend/storySlug
). In addition to this, the content item's body
field will receive content from the Enps storyBody
field (selected by the XPath expression
/mos/roStorySend/storyBody
)
In order to be able to configure these fields correctly, you need to know:
-
How to use XPath (see http://www.w3.org/TR/xpath/)
-
The structure of the roStorySend message created by Enps. For information about this, consult the appropriate Enps and MOS Protocol (see http://www.mosprotocol.com/MOS%20Files/MOS%20v28-510.htm) documentation.
The content type may also contain other fields that do not have
child newsroom:field
elements (like the
summary
field in the example above). Such fields will
simply be left empty and can, for example, be filled after import by
Content Studio
users.