This chapter covers steps for developing your own editors using the Experience Manager Editor SDK.

You must create an editor module to contain your custom editors. Oracle Experience Manager Extensions includes a sample editor module that you can use as a reference.

In order to add your editors to the sample_editors.swf file, you must modify the sample_editors.mxml editor registry to include them.

To create an editor module for custom editors:

  1. Create an MXML registry file for your editor module.

    For the sample editor project, this is editor_sdk\reference\build\maven\src\main\flex\sample_editors.mxml.

  2. Define the editor namespace within a root <editor:EditorModule> element:

    <editor:EditorModule xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:editor="com.endeca.tools.pagebuilder.editor.*">
    
    </editor:EditorModule>
  3. Within the root <editor:EditorModule> element, add a <editor:registeredEditors> element that contains an <mx:Array>:

    <editor:EditorModule xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:editor="com.endeca.tools.pagebuilder.editor.*">
      <editor:registeredEditors>
        <mx:Array>
          
        </mx:Array>
      </editor:registeredEditors> 
    </editor:EditorModule>
  4. Within the <mx:Array> element, add an <editor:EditorEntry > element for each of your custom editors:

    <editor:EditorModule xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:editor="com.endeca.tools.pagebuilder.editor.*">
      <editor:registeredEditors>
        <mx:Array>
          <editor:EditorEntry/>
        </mx:Array>
      </editor:registeredEditors> 
    </editor:EditorModule>
  5. Specify the following attributes:

    <editor:EditorModule xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:editor="com.endeca.tools.pagebuilder.editor.*">
      <editor:registeredEditors>
        <mx:Array>
          <editor:EditorEntry 
            uri="http://endeca.com/sample/2010"
            localName="MyCustomEditor" 
            editor="com.endeca.tools.pagebuilder.samples.editors.MyCustomEditor" />
        </mx:Array>
      </editor:registeredEditors>
    </editor:EditorModule>
  6. Repeat Steps 4-5 for each editor you wish to register.

  7. Save and close the file.

  8. Build the editor module.

    For the sample editor module, this consists of the following steps:

  9. Upload the editor module to your application:

You must modify the editor configuration file to register new editors with Experience Manager. The file, editors.xml, is maintained in the Endeca Configuration Repository and stored locally within the <app dir>\config\import\configuration\tools\xmgr directory.

To register a custom editor:

  1. Navigate to the <app dir>\config\import\configuration\tools\xmgr directory of your deployed application.

    For the default Discover Electronics reference application, this is C:\Endeca\apps\Discover\config\import\configuration\tools\xmgr on Windows or /usr/local/endeca/apps/Discover/config/import/configuration/tools/xmgr on UNIX.

  2. Open the editors.xml file.

  3. Add an <EditorModule> element within the closing </EditorConfig> tag, and set the url attribute to your custom editor module.

    For example:

        ...
        <EditorModule url="/ifcr/sites/Discover/configuration/tools/xmgr/modules/sample_editors.swf">
        </EditorModule>
    </EditorConfig>

  4. To add additional editors, insert an <Editor> element inside the <EditorModule> element for each new editor that you wish to include.

    For example:

        ...    
        <EditorModule url="/ifcr/sites/Discover/configuration/tools/xmgr/modules/sample_editors.swf">
            <Editor name="http://endeca.com/sample/2010:RichTextEditor">
            </Editor>
        </EditorModule>
    </EditorConfig>

  5. To set default editor configuration, add an <EditorConfig> element within each <Editor> element:

    For example:

        ...
        <EditorModule url="/ifcr/sites/Discover/configuration/tools/xmgr/modules/sample_editors.swf">
            <Editor name="http://endeca.com/sample/2010:RichTextEditor">
                <EditorConfig sample="customAttribute">
                    <ExampleCustomEditorXML foo="bar" size="10" resizeable="false" />
                </EditorConfig>
            </Editor>
        </EditorModule>
    </EditorConfig>

  6. Save and close the file.

  7. Navigate to the <app dir>\control directory of your deployed application.

  8. Run the set_editors_config batch or shell script.

    This script uploads the updated editors.xml file and any editor modules in the <app dir>\config\import\configuration\tools\xmgr directory to the Endeca Configuration Repository.

The Experience Manager editor SDK includes a sample RichTextEditor and associated cartridge template that you can use as a reference when developing your own editors.

The source code for the RichTextEditor is available under editor_sdk\reference\build\maven\src\main\flex\com\endeca\tools\pagebuilder\samples\editors\RichTextEditor.mxml.

The Experience Manager Editor SDK includes a sample editor module with a Rich Text editor that you can install in your application.

To install the sample editor module and cartridge template:

  1. Create a directory for custom editor modules:

  2. Build the sample editor module:

  3. Register the sample editors:

  4. Upload your custom content:

  5. Upload a template that includes the custom editor:

If your implementation supports multiple locales, you can localize your custom editors.

You must do the following:

You must modify your editor module for custom editors to add locale support for to your SWF file.

To modify your editor module:

  1. Open the MXML registry file for your editor module.

    For the sample editor project, open editor_sdk\reference\build\maven\src\main\flex\sample_editors.mxml.

  2. Within the <editor:EditorModule> element, add a <mx:Metadata> declaration of one or more resource bundles to be included in the SWF.

    For example:

    <editor:EditorModule xmlns:mx="http://www.adobe.com/2006/mxml"
      xmlns:editor="com.endeca.tools.pagebuilder.editor.*">
      <mx:Metadata>
        [ResourceBundle("com.endeca.tools.pagebuilder.samples:SampleResources")]
      </mx:Metadata>
      <editor:registeredEditors>
        <mx:Array>
          <editor:EditorEntry
            uri="http://endeca.com/sample/2010"
            localName="RichTextEditor"
            editor="com.endeca.tools.pagebuilder.samples.editors.RichTextEditor" />
        </mx:Array>
      </editor:registeredEditors>
    </editor:EditorModule>
  3. Save and close the file.

  4. Rebuild the editor module.

    For the sample editor module, this consists of the following steps:

  5. Upload the editor module to your application:


Copyright © Legal Notices