Event Content Type Definition

In order to be able to use the Live Center plug-in, you need to add a suitably configured event content type to your publication's content-type resource. For general information about the content-type resource and how to edit it, see the Escenic Content Engine Resource Reference.

An event content type needs to contain the following special elements:

  • A parameter element with the name com.escenic.live-center.content-type and the value true:

    <parameter name="com.escenic.live-center.content-type" value="true"/>

    This element identifies the content type as a Live Center event.

  • A ui:decorator element with the name com.escenic.livecenter.LiveEventDecorator

    <ui:decorator name="com.escenic.livecenter.LiveEventDecorator" />
  • A field element with the name livecenter. You can control the visibility of the field with the <ui:visibility/> element (see Controlling Field Visibility).

  • Five parameters identifying fields in the content type that are used by Live Center for special purposes. These must have the names com.escenic.live-center.content-type.field.entry-type, com.escenic.live-center.content-type.field.visibility-in-editor, com.escenic.live-center.content-type.field.clear-author-field-on-submit, com.escenic.live-center.content-type.field.subscription and com.escenic.live-center.content-type.field.video and their value attributes must reference the appropriate content type fields. For example:

    <parameter name="com.escenic.live-center.content-type.field.entry-type" value="entryType"/>
    <parameter name="com.escenic.live-center.content-type.field.visibility-in-editor" value="disableEvent"/>
    <parameter name="com.escenic.live-center.content-type.field.clear-author-field-on-submit" value="clearAuthor"/>
    <parameter name="com.escenic.live-center.content-type.field.subscription" value="subscriptions"/>
    <parameter name="com.escenic.live-center.content-type.field.video" value="video"/>

The following listing shows a complete event content type definition from which unnecessary elements such as labels have been removed:

<content-type name="event" >
  <ui:title-field>title</ui:title-field>
  <ui:decorator name="com.escenic.livecenter.LiveEventDecorator" />
  <parameter name="com.escenic.live-center.content-type" value="true"/>
  <parameter name="com.escenic.live-center.content-type.field.entry-type" value="entryType"/>
  <parameter name="com.escenic.live-center.content-type.field.clear-author-field-on-submit" value="clearAuthor"/>
  <parameter name="com.escenic.live-center.content-type.field.visibility-in-editor" value="disableEvent"/>
  <parameter name="com.escenic.live-center.content-type.field.subscription" value="subscriptions"/>
  <parameter name="com.escenic.live-center.content-type.field.video" value="video"/>
  <parameter name="com.escenic.index.summary.fields" value="description"/>
  <panel name="main">
    <field name="title" type="basic" mime-type="text/plain"/>

    <field name="description" type="basic" mime-type="text/plain"/>

    <field name="entryType" type="enumeration">
      <enumeration value="football"/>
      <enumeration value="simple"/>
      ...
     <constraints>
        <required>true</required>
      </constraints>
    </field>

    <field name="disableEvent" type="boolean">
    </field>

    <field name="clearAuthor" type="boolean">
    </field>

    <field name="subscriptions" type="complex">
      <required>false</required>
      <array default="0"/>
      <complex>
        <field type="enumeration" name="source">
          <enumeration value="twitter"/>
          <enumeration value="rss"/>
          <enumeration value="youtube"/>
          <enumeration value="instagram"/>
          <constraints>
            <required>true</required>
          </constraints>
        </field>
        <field mime-type="text/plain" type="basic" name="query">
          <constraints>
            <required>true</required>
          </constraints>
        </field>
      </complex>
    </field>

    <field name="video" type="complex">
      <array default="1"/>
      <complex>
        <field mime-type="text/plain" type="basic" name="mime-type">
          <constraints>
            <required>true</required>
          </constraints>
        </field>
        <field mime-type="text/plain" type="basic" name="url">
          <constraints>
            <required>true</required>
          </constraints>
        </field>
      </complex>
    </field>
    <field name="livecenter" type="basic" mime-type="application/json"> 
      <ui:label>Live Center</ui:label>
      <ui:hidden/>
    </field>
  </panel>
</content-type>

The content type's visibility in editor field (that is, the field pointed to by the com.escenic.live-center.content-type.field.visibility-in-editor parameter – disableEvent in the example shown above) should be defined as a boolean field. This field can be used to determine whether or not live events are visible in the Live Center editor.

The content type's clear author on submit (that is, the field pointed to by the com.escenic.live-center.content-type.field.clear-author-field-on-submit parameter – clearAuthor in the example shown above) should be defined as a boolean field. This field can be used to determine whether or not the author field will be cleared after submitting or publishing an entry in Live Center editor.

The content type's entry type field (that is, the field pointed to by the com.escenic.live-center.content-type.field.entry-type parameter – entryType in the example shown above) should defined as an enumeration field, and the enumeration values should be the names of entry types defined in an entry-type resource (see The entry-type Resource).