Adding an iNEWS Content Type
iNEWS stories (like Escenic content items) have a customized internal structure consisting of fields such as title
, body
, slug
and so on. Converting an iNEWS story into an Escenic content item therefore involves:
Selecting the iNEWS fields that contain relevant information for on-line content.
Mapping the selected iNEWS fields to appropriate fields in an Escenic content type.
To achieve this you need to define a specially structured content type for handling iNEWS 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 FTP Poller configuration file (see Editing the Configuration File).
The newsroom content type must
contain one
field
element which has a childbody
element that belongs to thehttp://xmlns.escenic.com/2012/newsroom
namespace:<body xmlns="http://xmlns.escenic.com/2012/newsroom" />
The element must be empty.
This field will receive the content from the iNEWS
body
field (selected by the XPath expression/nsml/body
)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 INEWSstoryid
field. You are recommended to hide this field so that users do not inadvertently change its content. It is used to store the dynamic part of an iNEWS story'sstoryid
, which changes every time a new version of the story is saved, and The Newsroom plug-in uses it when polling to determine whether or not a story has been updated in iNEWS.
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="/nsml/fields/string[@id='title']"/> </field> <field mime-type="application/xhtml+xml" type="basic" name="body"> <newsroom:body /> </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 iNEWS field you want to appear in its parent field
. In the example above, the content item's title
field will receive content from the iNEWS title
field (selected by the XPath expression /nsml/fields/string[@id='title']
)
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 XML files published on the iNEWS FTP server. For information about this, consult the appropriate iNEWS 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.