OCEツールキットを使用したカスタム・フィールド・エディタの開発

OCEツールキットでは、フィールドの外観タイプのコンポーネントを開発するためのサポートを提供しています。開発者はカスタム・フィールド・エディタを作成および管理できます。

フィールドの外観タイプのコンポーネントの場合、次のタスクを実行できます。

  • コンポーネントを開いたり、コピーまたは削除します
  • コンポーネントを公開または非公開にします
  • コンポーネントをエクスポートまたはインポートします
  • コンポーネントのメンバーを追加または削除します
  • プロパティを表示します
  • コンポーネント・ロゴを選択します

フィールドの外観タイプでコンポーネントのリストをフィルタできます。

次のOCEツールキットのコマンドをカスタム・フィールド・エディタの開発に使用できます。

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

フィールドの外観コンポーネントの次のサンプルは、OCEツールキットに含まれています。

  • TextFieldEditor
  • SliderFieldEditor
  • MapFieldEditor

次の図は、サンプルのフィールドの外観コンポーネントの開発に使用できるOCEツールキットのコマンドを示しています。

GUID-7E4A4615-3933-460D-B1A4-8BB567AD6279-default.pngの説明が続きます
図GUID-7E4A4615-3933-460D-B1A4-8BB567AD6279-default.pngの説明

ローカル・サーバー上ですぐに使用可能なフィールドの外観コンポーネントを作成し、これらをテストしてから、Oracle Content Managementインスタンスにアップロードできます。次の図は、localhost:8085でこれらのコンポーネントを示しています。


GUID-B3F5C575-AFD2-4C09-B1AD-6F57D9C21EF6-default.pngの説明が続きます
図GUID-B3F5C575-AFD2-4C09-B1AD-6F57D9C21EF6-default.pngの説明

ローカル・サーバーでスライダなどの各コンポーネントをテストできます。コンポーネントのプロパティを選択して、これを保存します。


GUID-28AECCE7-556A-412D-ADC8-511053EBDDE5-default.pngの説明が続きます
図GUID-28AECCE7-556A-412D-ADC8-511053EBDDE5-default.pngの説明

マップ・コンポーネントの場合、マップの周りをクリックして、エディタ値として場所を指定できます。


GUID-F5DA12F7-4381-4154-80F7-D254C5944FF9-default.pngの説明が続きます
図GUID-F5DA12F7-4381-4154-80F7-D254C5944FF9-default.pngの説明

コンポーネントのHTMLファイルを編集して、背景色などの設定を変更できます。


GUID-4533E630-9BF9-492E-A34E-8641FB287199-default.pngの説明が続きます
図GUID-4533E630-9BF9-492E-A34E-8641FB287199-default.pngの説明

OCEツールキットのコマンドを使用すると、フィールド・エディタをコンテンツ・タイプのフィールドとローカルに関連付けることができます。

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

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

カスタム・フィールド・エディタの構成およびテストが完了すると、OCEツールキットのコマンドを使用して、これらをOracle Content Managementインスタンスにアップロードできます:

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

# upload content

cec cr Repo5 -s

cec upload-content SimpleContent -r Rpo5 -s

カスタム・フィールド・エディタをアップロードすると、コンポーネントがOracle Content Managementインスタンスにインポートされます。


GUID-E867244A-522C-43F1-AC5C-B00957B23B99-default.pngの説明が続きます
図GUID-E867244A-522C-43F1-AC5C-B00957B23B99-default.pngの説明