Creating the Versions tab in the properties view
In this lesson, you add a "Versions" tab in the
properties view of both the Recipe and RecipeCollection objects. You
will customize RecipePropertiesViews.def to add
a tab named "Versions" that displays a list of versions for the Recipe
object. You also customize RecipeCollectionPropertiesView.def to
add a tab named "Versions" for the RecipeCollection object.
About this task
Procedure
- In the Enterprise Explorer view, expand LOBTools > WebContent > config > mycompany > recipe > propertiesViews.
- Open the RecipePropertiesViews.def file.
- Define the object properties section for versioning.
- Search for the following line of code:
<PropertyGroup groupTitle="${extRecipeResources.recipe_GeneralInformationSection}" open="true">
- Copy the following code snippet before the preceding
line of code so the object properties section will display before
the general section:
<PropertyGroup baseDefinitionName="wcfPropertyAssetInformationGroup" collapsable="true" open="true"/>
- Search for the following line of code:
- Enclose the object properties section and the general information
section within the tags <PropertyPane> and </PropertyPane>.
- Add the following code snippet before the line added
in the previous step.
<PropertyPane>
- Search for the next occurrence of the following line
of code:
</PropertyGroup>
- Add the following code snippet after the preceding line
of code:
</PropertyPane>
- Add the following code snippet before the line added
in the previous step.
- Add the Versions tab to the definitions file for the Recipe
object.
- Search for the following line of code:
<PropertyTabPane name="recipeAssociation" text="${extRecipeResources.associationTab}"> <PropertyChildListEditor baseDefinitionName="recRecipeAssociationList"/> </PropertyTabPane>
- Copy the following code snippet before the preceding
line of code so the Versions tab will display to the left of the association
tab:
<!-- This tab is for supporting version reference of a Recipe --> <PropertyTabPane name="manageVersionTab" text="${extRecipeResources.recipe_VersionDisplayTabname}"> <!-- Only show this tab if the object type is recipe, Content Version is enabled --> <EnablementAndCondition conditionId="recipeManageVersionTabCondition"> <EnablementCondition checkObjectDefinition="true" propertyName="objectType" enablementValue="Recipe" conditionId="recipeManageVersionObjectTypeCondition"/> <EnablementCondition contextName="contentVersionEnabled" enablementValue="true" conditionId="recipeContentVersionContextValueCondition"/> <EnablementCondition checkNewObject="true" enablementValue="false" conditionId="recipeContentVersionNewObjectCondition"/> <EnablementCondition enablementValue="" propertyName="objectVersionId" conditionId="noObjectVersionIdCondition"/> </EnablementAndCondition> <!-- Property Pane: Manage Version. This is an instantiation of the property pane definition which contains versions. --> <PropertyPane baseDefinitionName="wcfManageContentVersion"/> </PropertyTabPane>
- The
PropertyPaneTab
defines the widget that displays the list of versions. - The
EnablementAndCondition
defines four conditions that must be satisfied in order for the tab to be displayed in the user interface. TheconditionId
must be unique within thisPropertyTabPane
. - The first condition verifies that the property pane is displaying a version of the object type.
- The second condition ensures that the content versioning feature is enabled.
- The third condition ensures that the object is not a new object. The property pane is not displayed when a new object has been created but has not been saved.
- The fourth condition ensures that the property pane is not displayed when a version of the object is being displayed.
- The
- Search for the following line of code:
- Save and close the RecipePropertiesViews.def file.
- Add the Versions tab for the RecipeCollection object.
The RecipeCollectionPropertiesView.def file only defines one tab for display the General RecipeCollection information. You create a new tab for Versions to display version related information for the UIObject "RecipeCollection".
- Open the RecipeCollectionPropertiesView.def file.
- Add the new tab to the file.The complete RecipeCollectionPropertiesView.def file:
<Definitions> <!-- @Class: recCollectionProperties @Extends: wcfObjectProperties @Purpose: Recipe Collection Properties Notebook This class is used to display the properties notebook of an recipe collection. --> <ObjectProperties definitionName="recCollectionProperties" title="${extRecipeResources.recipeCollection_PropertiesTitle}"> <PropertyTabs name="tabs"> <!-- This tab is for RecipeCollection's general information --> <PropertyTabPane text="${extRecipeResources.recipeCollection_GenralDisplayTabname}"> <PropertyPane> <!-- To define the object properties section for version --> <PropertyGroup baseDefinitionName="wcfPropertyAssetInformationGroup" collapsable="true" open="true"/> <PropertyGroup groupTitle="${extRecipeResources.recipeCollection_GeneralInformationSection}" open="true"> <!-- Property: Name. An input box for the name property. --> <PropertyInputText promptText="${extRecipeResources.recipeCollectionName_DisplayName}" propertyName="collectionName" required="true"/> <!-- Property: Long Description. A rich text editor for the long description property. --> <PropertyInputMultiLineText objectPath="RecipeCollectionDescription" promptText="${extRecipeResources.recipeCollectionDesc_DisplayName}" propertyName="description"/> </PropertyGroup> </PropertyPane> </PropertyTabPane> <!-- This tab is for supporting version reference of a RecipeCollection --> <PropertyTabPane name="manageVersionTab" text="${extRecipeResources.recipeCollection_VersionDisplayTabname}"> <!-- Only show this tab if the object type is recipeCollection, Content Version is enabled --> <EnablementAndCondition conditionId="recipeCollectionManageVersionTabCondition"> <EnablementCondition checkObjectDefinition="true" propertyName="objectType" enablementValue="RecipeCollection" conditionId="recipeCollectionManageVersionObjectTypeCondition"/> <EnablementCondition enablementValue="" propertyName="objectVersionId" conditionId="noObjectVersionIdCondition"/> <EnablementCondition contextName="contentVersionEnabled" enablementValue="true" conditionId="recipeCollectionContentVersionContextValueCondition"/> <EnablementCondition checkNewObject="true" enablementValue="false" conditionId="recipeCollectionContentVersionNewObjectCondition"/> </EnablementAndCondition> <!-- Property Pane: Manage Version. This is an instantiation of the property pane definition which contains versions. --> <PropertyPane baseDefinitionName="wcfManageContentVersion"/> </PropertyTabPane> </PropertyTabs> </ObjectProperties> </Definitions>
- Save your changes.