close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2307

Table Of Contents

5.1.1.5 XML Editors

The following editors are available for XML fields:

RichTextField

Text component for editing text in only one line. The text must correspond to the coremedia-richtext-1.0.dtd. All the attributes from RichTextPane are valid.

RichTextPane

Text component for editing text which corresponds to the CoreMedia Rich Text DTD (lib/xml/coremedia-richtext-1.0.dtd). You can configure the RichTextPane with the following attributes:

Attribute Value Default Description
addStyleSheetGroups <StyleSheetGroupName> (<UsedOnElement>,<UsedOnElement> ,...)..  

Using this attribute, you can assign a style sheet group defined in the coremedia-richtext-1.0.css file to a property. The added style groups appear automatically in the corresponding attribute editor and in the toolbar. You need to replace <StyleSheetGroupName> with the name of the style sheet group as defined in the CSS file and <UsedOnElement> with the name of the element to which the style should be applied. The elements p, table, tr, td, li, ul, ol, a, img from the coremedia-richtext-1.0.dtd can be used. In addition, the special keywords inline, block and flow can be used. inline stands for any inline element, block for any block element and flow for any possible element (see Section 3.6.4, “Add to Content Editor” for details). A special keyword cannot be combined with any other element or keyword.

If you want to use a free text field to enter the value of a style sheet group, you have to add :string behind the name of the style sheet group. Be aware, that this free text will not be rendered specifically, because it is not defined in the coremedia-richtext-1.0.css file. It will appear as ordinary text. But you can define additional combo box entries, for example for some default values which will be rendered as defined in the CSS file.

Example: addStyleSheetGroups=" myGroup1:string(td) myGroup2:string"

showUnknownStyles true, false true If this attribute is "true" unknown styles will be shown in the attribute editor along with a button to remove them from the element. If set to "false", the unknown styles will not be shown.
nestedTablesAllowed true, false true If this attribute is set "true" you are allowed to use nested tables in the RichTextPane.
maximumTableCells Integer 250 This attribute defines the maximum number of table cells allowed for a newly created table.
spellCheckingEnabled true, false true This attribute enables or disables spell checking for the rich text pane.
internalLinkDocumentType Document type   Using this attribute, you can set a default document type used for the internal link chooser. For example, if you set internalLinkDocumentType="Article" only Article documents will be shown in the chooser by default.
internalLinkTarget new, replace, embed, other, none replace Using this attribute, you can configure the default targets for internal links in the RichTextPane
externalLinkTarget new, replace, embed, other, none new Using this attribute, you can configure the default targets for external links in the RichTextPane
imageDocumentType Document type   Using this attribute, you can set a default document type used for the image document chooser. For example, if you set imageDocumentType="Image" only Image documents will be shown in the chooser by default.

Table 5.5. Some attributes of the RichTextPane


The following attributes disable the respective menu items of the RichText pane.

  • enableTableAttributes="false"

  • enableTableModifying="false"

  • enableTableCellModifying="false"

  • enableInsertTables="false"

  • enableTables="false"

  • enableClassAttributes="false"

  • enableTextAlignment="false"

  • enableNumberedLists="false"

  • enableBulletList="false"

  • enableLists="false"

  • enableLanguages="false"

  • enableListIndention="false"

  • enableListOutdention="false"

  • enableInternalLinks="false"

  • enableExternalLinks="false"

  • enableLinks="false"

  • enableInsertImages="false"

  • enableSubScript="false"

  • enableSuperScript="false"

  • enableStrikeThrough="false"

  • enableUnderline="false"

  • enableBold="false"

  • enableItalic="false"

  • enableRemoveTextFormatting="false"

  • enableFontSize="false"

  • enableFontColor="false"

  • enableFont="false"

  • enableBackgroundColor="false"

  • enableHeadings="false"

  • enableBlockQuote="false"

  • If these attributes are set "false", you can disable the respective menu items and tools of the RichText pane. Default is "true". You must not use enableTables with other table settings (for example enableTableModifying), enableLinks with other link settings and enableLists with other list settings

In the following, you will find child elements of the <property> element with the editor class RichTextPane. You can use these elements to define the transformation of HTML elements of text in the clipboard into elements of the coremedia-richtext-1.0.dtd (see Example 5.2, “Example of PasteTransformation”) and to configure the file creation dialog.

This configuration affects copying within a RichtText pane as well as between an external application and a RichText pane. HTML elements which are neither configured using <PasteTransformation> nor included in the standard configuration (see Javadoc com.coremedia.cap.gui.richtext.RichTextPasteConfig) will be ignored.

The file creation dialogs of the RichText pane is used when you move a blob from the file system into a RichText pane. Use the child element < NewDocumentDialogSettings> for your settings.

<NewDocumentDialogSettings>

Child elements:

Parent element: <Property>

Use the <NewDocumentDialogSettings> element if you want to customize the file creation dialog.

Attribute Value Default Description
createPreselectedFolder true, false false If true, the preselected folder defined with preselectedResource will be created if it does not exist yet. Ignored if preselectedResourceId is set.
preselectedType Document type   Name of the preselected document type. If no preselected type is defined or the preselected type is not able to store the blob data, the first matching type will be used in a new dialog.
preselectedResource Resource path   Absolute path or path relative to the current document, which defines the preselected resource. Alternative to the preselectedResourceId attribute. When both attributes are given, the preselectedResourceId takes precedence unless no resource with the given id exists.
preselectedResourceId Integer   ID of the preselected resource. Alternative to the preselectedResource attribute. Additional feature available only using the id: Instead of specifying a folder id you may also specify a document id. In this case the document with the given id serves a kind of token where new documents will be created because the document will be created in the very same directory where the referenced document is in.
rootFolder Folder path   Name of the folder which defines the root of the file chooser dialog. Alternative use to the rootFolderId attribute. If both attributes are given, the rootFolderId takes precedence.
rootFolderId Integer   ID of the folder which defines the root of the file chooser dialog. Alternative use to the rootFolder attribute.
upperBound Document type   Configures the sub type of the shown document types. That is, you will only see document types which are super types of the defined document type (including the specified document type unless it is abstract). typePredicate overrides any bounds set.
lowerBound Document type   Configures the super type of the shown document types. That is, you will only see document types which are sub types of the defined document type (including the specified document type unless it is abstract). typePredicate overrides any bounds set.
typePredicate Class path   A class of type java.util.function.Predicate<Object> with a no-argument constructor which filters the shown document types. If you set a typePredicate it overrides any upperBound or lowerBound set.
resourceName Name   The name of the new document. If no resource name is defined, the name field will be empty. For all subsequent calls, the previously entered name will be used.
openDocument true, false true Defines the state of the Open document check box in the dialog. If true, the newly created document will automatically be opened.
fieldName Field name   Name of the preselected document field where the blob should be stored. If no name is defined or the document field is not able to store the blob data, the first matching field of the document type is shown.

Table 5.6. Attributes of NewDocumentDialogSettings


<PasteTransformation>

Child elements: <TransformElement>*, <IgnoreElement>*

Parent element: <Property>

Use the <PasteTransformation> element if you want to customize the paste operation of the RichText pane.

Attribute

Description

extendDefault

If this attribute is set to "true", the standard paste configuration will be extended by the new configuration. If it's set to "false", the standard configuration will be replaced by the new configuration. Default is "true".

Table 5.7. The attribute of the PasteTransformation element


<TransformElement>

Child element: <Attribute>*

Parent element: <PasteTransformation>

Use this element to match the HTML element from the clipboard with the element of the coremedia-richtext-1.0.dtd to insert.

Attribute

Description

name

The name of the HTML element which should be transformed.

to

The name of the element into which the HTML element should be transformed/which will be inserted into the RichText pane. If to is not set, the name of the HTML element will be used. Please notice, that only elements according to the coremedia-richtext-1.0.dtd are allowed.

Table 5.8. The attributes of the TransformElement element


<IgnoreElement>

Child element:

Parent element: <PasteTransformation>

Use this element to define HTML elements which should not be inserted into the RichText pane.

Attribute

Description

name

Name of the HTML element to ignore.

recursive

"false" (Default): Only the element defined in name will be ignored.

"true": The element defined in name and all contained elements will be recursively be ignored.

Table 5.9. Attributes of the IgnoreElement element


<Attribute>

Parent element: <TransformElement>

Use this element to define an attribute of an HTML element which should be inserted into the RichText pane. Attributes of an HTML element which are not matched by an <Attribute> element will be ignored. The only exception is the class attribute which will always be taken over.

Attribute

Description

name

Name of the attribute to be taken over.

value

Value, which should be assigned to the attribute defined in name. If no value is defined, the value from the HTML element will be used.

Table 5.10. Attributes of the Attribute element


The following example shows how to extend the standard configuration with two changed rules. <H1> elements will be transformed into a paragraph (<P> element) with font size 20 and <H2> elements will be ignored.

 <Documents>
	<Document type="Article">
		<Property name="Content" editorClass="RichTextPane">
			<PasteTransformation>
				<TransformElement name="H1" to="P">
					<Attribute name="class" value="font-size--20"/>
				</TransformElement>
				<IgnoreElement name="H2" recursive="false"/>
			</PasteTransformation>
		</Property>
	</Document>
</Documents>

Example 5.2. Example of PasteTransformation


PlainXmlPropertyEditor

A component to edit raw XML of arbitrary grammar with a simple plain text editor. It's useful for debugging, troubleshooting and small modifications without comfort. The editor displays XML tags and content as simple text. When the user tries to save invalid XML, a detailed XML error message appears.

<Documents>
    <Document type="XmlExample">
        <Property name="Xml" editorClass="PlainXmlPropertyEditor"/>
    </Document>    
</Documents>

<DocumentTypes>
    <DocumentType name="XmlExample">
         <PropertyType name="Xml">
            <ModelClass class="hox.corem.editor.toolkit.property.richtext.
                                                 impl.ConcurrentXmlPropertyModel"/>
        </PropertyType>
    </DocumentType>
</DocumentTypes>

Example 5.3. PlainXmlPropertyEditor configuration example


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.