FAQ for Customizations
This topic contains some frequently asked questions about Web Author customizations.
How can I prevent consecutive spaces from being inserted in documents?
- Create a plugin that implements the
AuthorDocumentFilter
class. It filters consecutive spaces from being inserted in the document. The filter should override all methods fromAuthorDocumentFilter
that intercept content changes. - Install the custom filter on all documents by implementing a
WebappEditingSessionLifecycleListener
that can be installed via aWorkspaceAccessPluginExtension
(WorkspaceAccess
extension in the plugin.xml file):public class CustomFilterInstaller implements WorkspaceAccessPluginExtension { @Override public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess) { WebappPluginWorkspace pluginWorkspace = (WebappPluginWorkspace)PluginWorkspaceProvider.getPluginWorkspace(); pluginWorkspace.addEditingSessionLifecycleListener(new WebappEditingSessionLifecycleListener() { @Override public void editingSessionStarted(String sessionId, AuthorDocumentModel documentModel) { documentModel.getAuthorDocumentController().setDocumentFilter(new CustomAuthorDocumentFilter(documentModel)); } });
Note: When instantiating the
AuthorDocumentFilter
, the
AuthorDocumentModel
object is passed because the filter needs it to check
for duplicate spaces.How can I customize the inserted table fragment for a DITA framework extension?
See the dita-extension-replace-insert-table-action sample
project that uses a Framework Extension Script (EXF) to extend the built-in DITA framework
to replace the default Insert Table action with another action that
uses an InsertFragmentOperation
to insert a CALS table element that has
@frame
, @colsep
, and @rowsep
attributes
already set.