close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2210

Table Of Contents

5.1.1.7 LinkList Editors

The following editors are available for editing linklist fields:

ComboBoxLinkListEditor

Allows selection of a document from a ComboBox, whose content consists of the documents of a folder. The path attribute determines the path of this folder. Automatically, only documents of appropriate type are shown. The emptySelection attribute configures the text displayed if no document is linked.

As with the GenericLinkListEditor, display is configured with a LinkListRenderer.

FolderLinkListEditor

A FolderLinkListEditor displays two JLists side by side. The left list contains the resources from the link list of the document. The right list contains resources that are determined by the path parameter which points to a CoreMedia folder. All documents in this folder can be selected and thus be inserted into the documents link list.

The following attributes can be used to configure the editor:

  • path: The path to the folder whose content will be displayed in the folder list.

  • showFolderListOnCheckOut: Indicates whether the folder list is shown when the document is checked out (true). If set to false, only the link list is displayed and the user must click a button to open the folder list.

  • listHeight: Sets the height in pixel of the two lists. If the lists are longer, a scrollbar is displayed. The default value is 100 which displays approximately five list entries with a standard font size. For ten lines set the value to 180.

In addition, you can configure the lists using the following sub elements. Use the attribute class to define the classes to use:

  • LinkListRenderer: Define a renderer which renders the content of the left link list.

  • FolderListRender: Sets the renderer for the right folder list. If not set, a default render is used to display an icon and the document name.

  • FolderListPredicate : Sets a predicate to filter the right folder list. If not set, all documents matching the given link list element type are displayed.

  • FolderListComparator : Sets a comparator to sort the right folder list. If not set, the folder list is sorted by document name.

Example:

<Property name="TestLinkList" editorClass="FolderLinkListEditor"
          path="/" listHeight="180" >

  <LinkListRenderer class=
"hox.corem.editor.toolkit.property.ImageLinkListRenderer"
    property="TestBlob"/>

</Property>
GenericLinkListEditor

Displays a list of the linked documents and allows links to be added/deleted/moved. Display of the documents is determined by the LinkListRenderer. This can be determined with a child element <LinkListRenderer class="Renderer class">.

The default is DocumentTypeLinkListRenderer, which displays document type icon and document name.

Other renderers are DocumentStateLinkListRenderer and ImageLinkListRenderer. The DocumentStateLinkListRenderer displays a state icon and the document name. The ImageLinkListRenderer displays Blob properties of the linked documents. The Blob property which should be used is determined by the property attribute of the LinkListRenderer element.

Example:

<LinkListRenderer class="ImageLinkListRenderer" property="small" />

You can configure the file chooser and file creation dialogs of the GenericLinkListEditor. Use the child element <DialogSettings> with the two respective child elements <NewDocumentDialogSettings> or <DocumentChooserSettings>. With the following attributes you can parameterize the dialogs:

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 it does not match the LinkList requirements, 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. If 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 (or documents will be chosen from) because the document will be created in (chosen from) 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.

Table 5.12. Attributes of NewDocumentDialogSettings and DocumentChooserSettings


For the <NewDocumentDialogSettings> element you can also use the following

two attributes:

Attribute Value Default Description
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.

Table 5.13. More attributes of NewDocumentDialogSettings


Example
<Document type="Dish">
  <Property name="pictures" editorClass="GenericLinkListEditor">
    <DialogSettings>
      <NewDocumentDialogSettings
      preselectedType="Picture"
      preselectedResource="/MenuSite/Fish"
      rootFolder="/MenuSite"
      upperBound="Picture"/>
    </DialogSettings>
  </Property>
</Document>    

Configured file creation dialog

Figure 5.1. Configured file creation dialog


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

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