Develop Custom Field Editors Using the OCE Toolkit

OCE Toolkit provides support for developing components of the Field Appearance type. Developers can create and manage custom field editors.

For a component of the Field Appearance type, you can do the following tasks:

  • Open, copy, or delete the component
  • Publish or unpublish the component
  • Export or import the component
  • Add or remove members on the component
  • View properties
  • Choose the component logo

You can filter a list of components by the Field Appearance type.

The following OCE Toolkit commands are available for developing custom field editors:

cec add-field-editor <name>                        Adds a field editor to a field in a content type.                       [alias:  afe]
  cec remove-field-editor <name>                     Removes a field editor from a field in a content type.                  [alias:  rfe]

------------------------
cec add-field-editor
------------------------
Usage: cec add-field-editor <name>

Adds a field editor to a field in a content type.

Options:
  --template, -t         The template the content type is from  [required]
  --contenttype, -c      The content type  [required]
  --field, -f            The field the field editor is for  [required]
  --contenttemplate, -n  Flag to indicate the template is a content template
  --help, -h             Show help  [boolean]

Examples:
  cec add-field-editor editor1 -t BlogTemplate -c BlogPost -f summary            Use editor1 as the appearance for field summary in content type BlogPost from local template at src/templates/BlogTemplate
  cec add-field-editor editor1 -t BlogTemplateContent -n -c BlogPost -f summary  Use editor1 as the appearance for field summary in content type BlogPost from local template at src/content/BlogTemplateContent
------------------------
cec remove-field-editor
------------------------
Usage: cec remove-field-editor <name>

Removes a field editor from a field in a content type.

Options:
  --template, -t         The template the content type is from  [required]
  --contenttype, -c      The content type  [required]
  --field, -f            The field the field editor is for  [required]
  --contenttemplate, -n  Flag to indicate the template is a content template
  --help, -h             Show help  [boolean]

Examples:
  cec remove-field-editor editor1 -t BlogTemplate -c BlogPost -f summary            Remove editor1 as the appearance for field summary in content type BlogPost from local template at src/templates/BlogTemplate
  cec remove-field-editor editor1 -t BlogTemplateContent -n -c BlogPost -f summary  Remove editor1 as the appearance for field summary in content type BlogPost from local template at src/content/BlogTemplateContent

These samples of Field Appearance components are included with OCE Toolkit:

  • TextFieldEditor
  • SliderFieldEditor
  • MapFieldEditor

The following image shows OCE Toolkit commands you can use to develop the sample Field Appearance components.

Description of develop-custom-field-editor-commands.png follows
Description of the illustration develop-custom-field-editor-commands.png

You can create the out-of-the-box Field Appearance components on your local server, test them, and then upload them to your Oracle Content and Experience instance. The following image shows these components on localhost:8085.


Description of custom-components-local-server.png follows
Description of the illustration custom-components-local-server.png

You can test each component, such as slider, on the local server. There you can select properties for the component and then save it.


Description of slider.png follows
Description of the illustration slider.png

For the map component, you can click around on the map to provide a location as the editor value.


Description of map1.png follows
Description of the illustration map1.png

You can edit the HTML file for a component to change its settings, such as background color.


Description of edit-component-html.png follows
Description of the illustration edit-component-html.png

You can use an OCE Toolkit command to associate a field editor with a field of a content type locally:

cec add-field-editor editor1 -t SimpleContent -n -c SimpleType -f title

cec add-field-editor slider -t SimpleContent -n -c SimpleType -f value

After you finish configuring and testing the custom field editors, you can upload them to your Oracle Content and Experience instance, using OCE Toolkit commands:

# upload editors
cec ulcp editor1,slider -p -s Latest

# upload content

cec cr Repo5 -s

cec upload-content SimpleContent -r Rpo5 -s

When you upload the custom field editors, your components are imported into your Oracle Content and Experience instance.


Description of componets-imported-server.png follows
Description of the illustration componets-imported-server.png