62 Customizing Asset Forms for the Contributor Interface
When you customize asset forms in the Oracle WebCenter Sites: Contributor interface, you can also modify the asset form headers and also build single-valued and multi-valued attribute editors for some supported data types.
Topics:
About Asset Forms Customization
You can modify an asset form’s header and customize or build an attribute editor.
See Customizing Attribute Editorsand Building an Attribute Editor.
Note:
Unlike other components of the Contributor interface, asset forms are not in the Contributor framework. Therefore, requests for asset forms are not processed by the UI Controller.
Modifying the Header of Asset Forms
You can modify the header of an asset form by creating a custom assettype-specific element and including additional stylesheets or JavaScript code.
To modify the header of an asset form, create a custom assettype-specific element in the OpenMarket/Xcelerate/AssetType/<AssetTypeName>/
directory.
You can include additional stylesheets or JavaScript code instead of modifying the body of the HTML pages. The name of the element must be Header
.
Building an Attribute Editor
You can create a custom attribute editor for the data types supported in WebCenter Sites. You can also customize the look and feel of some existing ready-to-use attribute editors.
See Customizing Attribute Editors.
This topic describes how to build a custom attribute editor that supports a single value of data type text
, string
, integer
, or money
. This section also provides pointers and sample code for implementing a multi-valued attribute editor for the same data types.
Note:
To create a custom attribute editor for the blob
or asset
data type, base your implementation on the UPLOADER
attribute editor for the blob
type and the PICKASSET
attribute editor for the asset
data type.
Topics:
Creating a Dojo Widget and its Template
This section describes how to create a Dojo widget to handle a single value of data type text
, string
, integer
, or money
.
This section includes the following topics:
Defining the Attribute Editor as a Presentation Object
This section describes how to define input tags (presentation objects) for flex attributes. It also describes how to assign arguments that the input tags can pass from the attribute editor to the display elements.
To define the attribute editor:
Creating the Attribute Editor Element
This section describes how to create an element that shows an "edit" view of an attribute (single-valued) when it displays in a New or Edit form. This element must be located in the OpenMarket/Gator/AttributeTypes
directory in the ElementCatalog
table. The element name must exactly match the name of the tag you defined in Defining the Attribute Editor as a Presentation Object, so that it can be invoked by the tag (in this example, MYATTREDITOR
).
Creating the Attribute Editor
This topic describes how to create an attribute editor asset to make it available to content contributors on their content management sites. This asset supports the input types you defined in Creating the Attribute Editor Element, for example, check boxes, radio options, and drop-down lists. The developer selects this editor when creating or modifying the attribute.
Implementing a Multi-Valued Attribute Editor
In Creating the Attribute Editor Element, the second example shows the implementation for a single-valued attribute editor.
-
To implement a multi-valued attribute editor for
text
,integer
,string
, ormoney
data types, write a code similar to the code in the following example:<%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld" %> <%@ taglib prefix="ics" uri="futuretense_cs/ics.tld" %> <%@ taglib prefix="satellite" uri="futuretense_cs/satellite.tld" %> <%// // OpenMarket/Gator/AttributeTypes/CustomTextAttributeEditor // // INPUT // // OUTPUT //%> <%@ page import="COM.FutureTense.Interfaces.FTValList" %> <%@ page import="COM.FutureTense.Interfaces.ICS" %> <%@ page import="COM.FutureTense.Interfaces.IList" %> <%@ page import="COM.FutureTense.Interfaces.Utilities" %> <%@ page import="COM.FutureTense.Util.ftErrors" %> <%@ page import="COM.FutureTense.Util.ftMessage"%> <cs:ftcs> <% IList attributeValueList = ics.GetList("AttrValueList", false); boolean hasValues = null != attributeValueList && attributeValueList.hasData(); String attributeValue = hasValues ? attributeValueList.getValue("value") : ""; %> <ics:if condition='<%= "no".equals(ics.GetVar("MultiValueEntry")) %>'> <ics:then> <div dojoType='<%= ics.GetVar("editorName") %>' name='<%= ics.GetVar("cs_SingleInputName") %>' value='<%= attributeValue %>' > </div> </ics:then> <ics:else> <ics:callelement element="OpenMarket/Gator/AttributeTypes/RenderMultiValuedTextEditor"> <ics:argument name="editorName" value='<%= ics.GetVar("editorName") %>' /> <ics:argument name="editorParams" value='<%= ics.GetVar("editorParams") %>' /> <ics:argument name="multiple" value="true" /> <ics:argument name="maximumValues" value='<%= ics.GetVar("maximumValues") %>' /> </ics:callelement> </ics:else> </ics:if> </cs:ftcs>
If the code in the example above is used, then the multi-valued attribute editor looks similar to the editor in this figure.
Note the following points about the code example:
-
You can instantiate a multi-valued widget, which uses a single-valued widget to render multi-valued representations.
-
The
MultiValueEntry
variable with theno
value indicates that the attribute editor renders a single value. Changing the variable value toyes
enables the attribute editor to render multiple values. -
You can implement a multi-valued widget that accepts values in the JSON object or in any other format.
-
For a multi-valued attribute editor, the
RenderMultiValuedTextEditor
element creates hidden input nodes required forSave
logic. The value of each node is sent to the server. -
The multi-valued widget is rendered by calling the
OpenMarket/Gator/AttributeTypes/RenderMultiValuedTextEditor
element using the following code in the previous example:<ics:else> <ics:callelement element="OpenMarket/Gator/AttributeTypes/RenderMultiValuedTextEditor"> <ics:argument name="editorName" value='<%= ics.GetVar("editorName") %>' /> <ics:argument name="editorParams" value='<%= ics.GetVar("editorParams") %>' /> <ics:argument name="multiple" value="true" /> <ics:argument name="maximumValues" value='<%= ics.GetVar("maximumValues") %>' /> </ics:callelement> </ics:else> </ics:if>
-
-
To create a custom attribute editor for the
blob
orasset
data type, base your implementation on theUPLOADER
attribute editor for theblob
type and thePICKASSET
attribute editor for theasset
data type.