Customizing the Content Completion Assistant Using a Configuration File
Oxygen XML Author gathers information from the associated schemas (DTDs, XML Schema, RelaxNG) to determine the proposals that appear in the Content Completion Assistant. Oxygen XML Author also includes support that allows you to customize the Content Completion Assistant to suit your specific needs.
There are two ways to customize the Content Completion Assistant in Oxygen XML Author:
- You can add, modify, or remove actions that are proposed for each particular document type (framework) by using the Content Completion subtab in the Document Type Association configuration dialog box. To access this subtab, open the Preferences dialog box , go to Document Type Association, use the New, Edit, Duplicate, or Extend button, click on the Author tab, and then the Content Completion subtab.
- You can use a cc_config.xml configuration file that is specific to each document type (framework) to configure the values that are proposed in certain contexts, to customize the attributes or elements that are proposed, or to customize how certain aspects of the proposals are rendered in the interface. The rest of the topics in this section explain how you can use this configuration file to customize the content completion.
Setting up the Content Completion Configuration File
- Create a new resources folder (if it does not already exist) in the frameworks directory for the particular document type (for example, OXYGEN_INSTALL_DIR/frameworks/dita/resources).
- Open the Preferences dialog box and go to Document Type Association. Select the particular document type, click the Edit button, and in the Classpath tab add a link to that resources folder (if it does not already exist).
- Create a new configuration file or edit an existing one.
- To easily create a new configuration file, you can use the Content Completion Configuration document template that is included in Oxygen XML Author (). The document template includes details about how each element and attribute is used in the configuration file.
- If a configuration file (cc_config.xml) already exists for the particular document type (in the resources folder), you can modify this existing file.
-
If you extend a framework, you need to copy the content of the cc_config.xml file from the base framework and modify it (e.g. create a resources folder in your framework extension folder and place the file there). You also need to make sure that the folder that contains the cc_config.xml file in your extension (e.g. resources) is listed in the Classpath tab before the one from the base framework.
If you only want to make small changes or add extra rules in your custom content completion configuration file, you need to name it cc_config_ext.xml and all the rules inside it are merged with the base cc_config.xml file. The merging is done by taking all the rules specified in the cc_config_ext.xml file into consideration after processing the set of rules from the base cc_config.xml file.
- Make the appropriate changes to your custom configuration file.
- Save the file in the resources folder for the particular document type, using the fixed name: cc_config.xml (for example, OXYGEN_INSTALL_DIR/frameworks/dita/resources/cc_config.xml).
- Restart the application and open an XML document. In the Content Completion
Assistant you should see your customizations.Tip:In some cases, you can simply use the
Refresh
(F5) action to test your customizations, without
having to restart the application.Attention:In the Classpath tab, if you have references to multiple resources folders, each with its own cc_config.xml file, the first reference listed in the Classpath tab takes precedence and the multiple configuration files are not combined.
Resources
To see more ideas for various advanced customization possibilities (including how to insert or reject proposals for the content completion assistant), watch our Webinar: Working with DITA in Oxygen - Customizing the Editing Experience.