The Content editor allows users to edit structured XML text in censhare Web. The Content editor is preconfigured based on the standard content structure.

Content Editor Storage Item Configuration

The storage node source allows editing of a XML storage item in the content editor and is configured using metadata on a "Content Editor Storage Item Configuration" asset. By default, it will use the master storage item of the context asset, which is typically the asset opened in the content editor. You can also use a different storage item type by setting its key in the "Storage Item Key" feature and use the storage item of another asset by specifying a censhare query XPath expression in the feature "Asset Reference (XPath)". E.g. to use the storage item of a text asset assigned to the edited asset you can use the following XPath:

cs:child-rel()[@key='user.']/cs:asset()[@censhare:asset.type='text.']

Content in content support is also configured on the node source assets.

RelaxNG Schema

In order to edit the content of the XML storage item, you must create RelaxNG schema (http://relaxng.org) for its structure. The schema must be placed as the master storage item in a "RelaxNG Schema" asset and linked to the node source asset using its "Content Editor Content Schema" feature.

Limitations:

  • The compact RelaxNG syntax is not supported.
  • Right now, only a subset of the XML Schema data type library is supported: boolean, string, integer (without limits)

You can also use a XSLT storage file instead of a "RelaxNG Schema" MIME type as schema definition. This allows to generate the RelaxNG schema using a XSL transformation. The id of the context asset of the node source is provided as a parameter named "contextAssetId".

Transformation

Optionally an XSL transformation can be configured as the storage item of the node source definition when loading it from the asset.

UI Definition and Localization

The storage node source also supports linking UI Definition and Localization assets.

Content Editor Metadata Configuration

The metadata node source allows editing of asset traits in the content editor and is configured using a "Content Editor Metadata Configuration" asset. By default, it will use the traits of the context asset, which is typically the asset opened in the content editor. You can also use a use the traits of another asset by specifying a censhare query XPath expression in the feature "Asset Reference (XPath)".

The actual traits to be edited must be specified in the master storage item of the metadata nodes source asset as XML.

<meta-data>
  <trait name="type"/>
  <trait name="mytrait">
    <property trait="display" name="name"/>
  </trait>
</meta-data>

The XML must have the element "meta-data" as its root and can contain one or more "trait" elements to define which traits should be available in the XML structure. A "trait" element must have a "name" attribute with a valid trait name unique to the configuration as its value. If the trait element is empty the name must reference an existing trait and all properties of this trait will be provided. You can also use a valid trait name and specify the properties to provide manually using "property" elements. A "property" element must have the attributes "trait" and "property" with the trait and name of an existing property as its values.

Content Editor Relations Configuration

The relation node source allows editing of relations to other assets and relation traits and is configured using a "Content Editor Relations Configuration" asset. By default, it will use the relations of the context asset, which is typically the asset opened in the content editor. You can also use a use the relations of another asset by specifying a censhare query XPath expression in the feature "Asset Reference (XPath)".

The actual relations and their traits to be edited must be specified in the master storage item of the relation node source asset as XML.

<relation-data>
  <relation key="user." direction="child">
    <trait name="mytrait">
      <property trait="traitname" name="propname"/>
    </trait>
  </relation>
</relation-data>

The XML must have the element "relation-data" as its root and can contain one or more "relation" elements to define which relations should be available in the XML structure. A "relation" element must have a "relation" attribute with an existing relation key as its value and a "direction" attribute with either "child" or "parent" as its value.

Content Editor List Configuration

The list node source allows editing a set of assets which are the result of a query and is configured using a "Content Editor List Configuration" asset. On the asset you must specify the query as a censhare query XPath using the "Asset Reference (XPath)" feature and attach another node source to be used to edit the query result in the XML structure using the "Content Editor Base Node Source" feature. For each asset in the query result an instance of the specified node source is initialized with the result asset as its context asset.