collection-view-definition

This element encloses the complete definition. It is required.

The collection-view-definition element includes the following elements and attributes.
view-definition-name
The view-definition-name attribute defines the name that will be used internally to represent the collection view definition. This name must be unique in the context of all the collection view definitions defined in WSRR. The view-definition-name attribute is required.
Note: It is possible to have a collection view definition and a detail view definition with the same view definition name.
items-per-page
The items-per-page attribute defines the default number of rows that are displayed in the collection view. The value for this attribute defaults to 20. A user can modify the number of rows displayed in the collection view by modifying his or her preferences for the view at runtime. The items-per-page attribute is optional.
messages
The messages element defines the title and description messages that are displayed on the collection view. It is required and contains the following elements, which must be specified in the order shown:
title-message
The title-message element defines the locale specific title name for the collection view. The element is required. The attributes of this element are as detailed for the ui-message element.

The title message is displayed in two places, as shown in the following figure where the title message is "WSDL documents".

Imported WSDL documents

The title message is also used in the breadcrumb trail for the page.

description-message
The description-resource-key attribute defines the key that will be used to lookup the locale specific description for the collection view. The attributes of this element are as detailed for the ui-message element.

The description resource key value is formatted by the web user interface using the Java™ class MessageFormat, where parameters are signified in curly braces with a number, for example {0} {1}. There are two different scenarios in which the parameters are different; when the collection view is used to show a collection of items related to a parent, for example the Fault Messages of a WSDL Operation, and when the collection view shows a collection of unrelated items, for example all WSDL Documents in WSRR.

If the collection view is used to show a collection of items related to a parent, {0} is replaced with the value of the name property of the parent entity and {1} is replaced with a translated string that describes the SDO type of the parent, for example "WSDL Document" is the string for the SDO type "WSDLDocument". In the following example, the name of the parent is "LowTouchClaimProcessBinding.wsdl" and the SDO type of the parent is "WSDLDocument".

Imported WSDL documents

If the collection view is showing a collection of unrelated items, {0} and {1} are replaced with blank strings. The description of such a collection view is shown here.

WSDL documents
Following are examples of description message key values.
collection.view.wsdl.documents.description=This is the collection of 
 WSDL documents present in the registry.
collection.view.imported.wsdl.documents.description=This is the collection of 
 WSDL documents imported by the {0} {1}.
column-definitions
The column-definitions element contains one or more column-definition elements. The column-definitions element is required and has the following optional attributes:
show-graph-view
A boolean value that switches on or off the display of an extra column that allows the user to display a graphical view of any entity in the collection of results. The default value is false.
graph-column
When the display of the extra graph column is enabled with the show-graph-view attribute, this attribute allows the position of the extra column to be altered in the view. The default is column 2, which typically means it will be the very next column after the entity name.
column-definition
The column-definition element defines a column to be displayed in the collection view. It defines the heading for the column and the name of the property with the value that will be displayed for each SDO in the collection. The column-definition element contains the following elements, which must be specified in the order shown:
heading-message
The heading-message element defines the key that will be used to lookup the locale specific display label for the column heading. This element is required. The attributes of this element are as detailed for the ui-message element.
property-name
The property-name element defines the name of the property with the value to be displayed. The name of the property is used to extract the property value from the underlying SDO. The type of the property to be displayed must be java.lang.String. The property element is required.

The property can either be modelled or user-defined. If a user-defined property is specified and it does not exist on the SDO in the row, an empty cell is shown in the row.

action
The action element defines that the column property value is to be rendered as an HTML link. It is optional, if omitted, the column is rendered as plain text.

Typically, displaying a column as a link allows the user to select the link to navigate to a detail view of the object displayed on the row in question.

The value of the action element specifies the result when a user clicks on the HTML link, which occurs on the item in the row that was clicked. The value of the action element must be one of the following values:

  • ViewDetail The value "ViewDetail" creates a link that shows a detail view of the entity in the row. The display-type element is optional; if present the detail view definition identified by the value of display-type is used in the detail view. If not present, the detail view definition for the SDO type of the target is used in the detail view.
  • ViewRelationshipDetail The value "ViewRelationshipDetail" creates a link to a collection view that shows the target entities of the custom user-defined relationship shown in the row. The entity in the row must be a user-defined relationship; the only way to navigate to a collection that contains this is by using the "ViewRelationships" action in a detail view definition. The value of the display-type element is ignored.
  • ViewPropertyDetail The value "ViewPropertyDetail" creates a link to a detail view that shows the name and value of the property in the row. The item in the row must be a property on an entity; the only way to navigate to a collection that contains this is by using the "ViewProperties" action in a detail view definition. The value of the display-type element is ignored.
display-type
The display-type element specifies the display type to be passed to an action for the column, if such an action is defined. This will then sometimes control the view definition used to display the results of the action. It is optional.
filterable
Controls whether the user can click on the column heading to sort the collection by the values in this column. The filterable element can have either of the following values:
  • true: the user can sort the collection by this column.
  • false: the user cannot sort the collection by this column.
Following is an example of a column-definitions element:
<column-definitions>
  <column-definition>
    <heading-message message-key="collection.view.column.name"/>
    <property-name>name</property-name>
    <action>ViewDetail</action>
  </column-definition>
  <column-definition>
    <heading-message message-key="collection.view.column.description"/>
    <property-name>description</property-name>
  </column-definition>
  <column-definition>
    <heading-message message-key="collection.view.column.version"/>
    <property-name>version</property-name>
  </column-definition>
</column-definitions>

A column-definitions element is displayed in the collection view as follows:

column-definitions element
button-definitions
The button-definitions element contains one or more button-definition elements. The button-definitions element is required and has no attributes.
button-definition
A button-definition element defines an action button that is displayed in the collection view. Action buttons allow actions to be performed for selected items in the collection view. Items in the collection view can be selected by checking the check box on the relevant row for the item in question.
Either the sequence of button-action, display-type, document-type, template-name, or the custom-action element is permitted. If a custom action is defined, only the custom-action element should be specified. If a button which drives a predefined button action is defined, the sequence of button-action, display-type, document-type, template-name is valid.
The button-definition element contains the following elements, which must be specified in the order shown:
button-message
The button-message element defines the locale specific display label for the column heading. This element is required. The attributes of this element are as detailed for the ui-message element.
button-action
The button-action element is required. It defines what happens when the button is clicked. It must be one of the following values:
  • createGenericObject The button navigates to the new concept page, which shows a detail view of a new concept and allows details of a new concept to be entered. The display-type element can specify an alternative detail view definition to use. You can use the model-reference element or the template-name element to specify the name of a business model template or a template to be used when the new object is created. The selected items are not affected.
  • loadDocument The button navigates to the load document page, where the document type is specified in the document-type element. The load document page opens without the document type selector and with a message directing the user to select a document of the specified type.
  • addProperty The button navigates to the detail view of a new property, which allows the user to create a new custom property on the selected items. The selected items will all have a copy of the new property added.
  • deleteItems The button action deletes the selected items. If the items cannot be deleted an error will be shown in the web user interface. For example, this will occur when the selected items are logical types derived from a physical document. Currently the following item types can be deleted using this button action: • Documents •Concepts A mixture of the above item types can all be selected and deleted at once. The selected items will be deleted.
  • addRelationship The button navigates to the new relationship wizard, which allows the user to create a new relationship on the selected items. The selected items will all have a new relationship as specified by the user added.
  • exportDocuments The button action will present the user with a file containing the items selected exported in the WSRR export format. The user will generally get a prompt from their web browser to save the export file. The selected items must be of type Document or a Concept. This action is only used on collection views that show collections of Documents or Concepts, for example the WSDL Document collection view.
  • addFavorites This will add the selected items to the user's favorites list. Any item can be added to favorites.
  • subscribe This allows the user to subscribe to the selected items. The button navigates to the new subscription page with the selected items entered in the Entity list field.
  • addClassifications The addClassifications button action navigates to the Classifications page where the user can classify the selected items. The selected items will all be classified with the classifications selected.
  • runSavedSearch This button action runs the saved search represented by the selected item. If the selected item is not a PropertyQuery or GraphQuery an error will be shown in the web user interface. Additionally a system persisted PropertyQuery cannot be run; this is a PropertyQuery with an empty queryExpression attribute. Only one item can be selected. If specified, the display-type element specifies the collection view display type name to use to display the results. If omitted, the "Results" display type name is used.
custom-action
The custom-action element defines the custom action for the button. For details, see Custom-action element reference.
display-type
The display-type element specifies the display type to be passed to an action for the button. This will then sometimes control the view definition used to display the results of the action. It is optional.
document-type
The document-type element is optional. It defines the type of document to be loaded for a load document action. The value must be one of the following values.
  • WSDLDocument
  • XMLDocument
  • XSDDocument
  • PolicyDocument
  • SCAModule
model-reference
The model-reference element is optional. It defines the name of the business model template used when a new object is being created. The value must equal the name of a business model template in WSRR.
template-name
The template-name element is optional. It defines the name of the template used when a new object is being created. The value must equal the name of a template in WSRR.
An example button-definitions element follows.
<button-definitions>
  <button-definition>
    <button-message message-key="collectionButton.new"/>
    <button-action>createGenericObject</button-action>
    <template-name>Application</template-name>
  </button-definition>
  <button-definition>
    <button-message message-key="collectionButton.deleteItems"/>
    <button-action>deleteItems</button-action>
  </button-definition>
  <button-definition>
    <button-message message-key="collectionButton.addProperties"/>
    <button-action>addProperty</button-action>
  </button-definition>
  <button-definition>
    <button-message message-key="collectionButton.addRelationship"/>
    <button-action>addRelationship</button-action>
  </button-definition>
  <button-definition>
    <button-message message-key="collectionButton.addClassifications"/>
    <button-action>addClassifications</button-action>
  </button-definition>
  <button-definition>
    <button-message message-key="collectionButton.export"/>
    <button-action>exportDocuments</button-action>
  </button-definition>
  <button-definition>
    <button-message message-key="collectionButton.subscribe"/>
    <button-action>subscribe</button-action>
  </button-definition>
  <button-definition>
    <button-message message-key="collectionButton.addFavorites"/>
    <button-action>addFavorites</button-action>
  </button-definition>
</button-definitions>

A set of buttons are displayed in the collection view as follows.

buttons in the collection view

Example

Following is an example of a collection-view-definition element:

<collection-view-definition
  xmlns="http://www.ibm.com/ServiceRegistry/CollectionViewDefinition"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.ibm.com/ServiceRegistry/
       CollectionViewDefinition ../../../schemas/CollectionViewDefinition.xsd"
  view-definition-name="SampleApplications">
  <messages>
    <title-message message-key="sample.collection.view.business.applications.title"/>
    <description-message
      message-key="sample.collection.view.business.applications.description"/>
  </messages>
  <column-definitions>
    <column-definition>
      <heading-message message-key="collection.view.column.name"/>
      <property-name>name</property-name>
      <action>ViewDetail</action>
    </column-definition>
  </column-definitions>
  <button-definitions>
    <button-definition>
      <button-message message-key="collectionButton.new"/>
      <button-action>createGenericObject</button-action>
      <template-name>Application</template-name>
    </button-definition>
  </button-definitions>
</collection-view-definition> 
The following screen capture shows how this collection view displays in the web user interface:
Screen capture of collection view example
The following example is the same as the previous example, but with a custom action button in place of the standard New button:
<collection-view-definition
  xmlns="http://www.ibm.com/ServiceRegistry/CollectionViewDefinition"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.ibm.com/ServiceRegistry/
       CollectionViewDefinition ../../../schemas/CollectionViewDefinition.xsd"
  view-definition-name="SampleApplications">
  <messages>
    <title-message message-key="sample.collection.view.business.applications.title"/>
    <description-message
      message-key="sample.collection.view.business.applications.description"/>
  </messages>
  <column-definitions>
    <column-definition>
      <heading-message message-key="collection.view.column.name"/>
      <property-name>name</property-name>
      <action>ViewDetail</action>
    </column-definition>
  </column-definitions>
  <button-definitions>
<button-definition>
      		<button-message message-key="get.name" resource-bundle-name="com.ibm.serviceregistry.customaction.examples.LabelsResourceBundle"/>
		<custom-action>
…
		</custom-action>
	</button-definition>
  </button-definitions>
</collection-view-definition>