X

Best Practices from Oracle Development's A‑Team

Extreme Customizations - LoV for Navigation Parameters

Introduction

When composing a new portal application there is various important steps that has to be taken into account, one of them is navigation model. For a very comprehensive portal experience and low cost of ownership the navigation model must be flexible enough so the business can take ownership of this asset. Today this can be hard to realize since the navigation administration in run-time leaves a lot of room for mistakes. One step into making this less error prone and more user friendly is to allow the user to configure the navigation model and its associated parameters from predefined value lists or pickers. A picker is a more complete component that will support the user when setting values on important parameters.  Lately we have investigated what effort it would take to support list-of-values (LoV's) and pickers in the navigation model and we found this to be pretty trivial. This post will in short explain how this can be implemented using existing architecture.

Main Article

Step 1 - Create Customization Application

  • Create a new WebCenter Spaces Task flow Customization Application

The name here indicates this only applies to WebCenter Spaces, this is however not the case.

  • Enable the application to show libraries by selecting the filter menu and selecting Show libraries
  • Restart JDeveloper using Role: Customization Developer

Step 2 - Add customization to navigation editor

  • Now you should see all libraries in the View Controller project
  • browse to following jar file and location: WebCenter Navigation Editor
  • Location: oracle.webcenter.navigationeditor.view.resourceeditor.jsff
  • Locate following snippet, towards the end of the file:
<af:showDetailItem id="sdip" text="#{neb.PARAMETERS}"    rendered="#{pageFlowScope.resourceEditorBean.parametersAvailable}">    <af:panelGroupLayout id="pglp" layout="scroll">       <af:panelFormLayout id="pflp" labelWidth="30%">          <af:iterator value="#{pageFlowScope.resourceEditorBean.sourceValues}"             var="srcx" id="its">             <af:group id="g1">                <af:iterator value="#{pageFlowScope.resourceEditorBean.parameters}" var="prm" id="itp">                    <af:panelLabelAndMessage label="#{prm.displayName}"                        rendered="#{prm.visibleOnTab and prm.source == srcx}"                        id="plam22">                       <pedc:showProperty id="ot7" simple="true"                           columns="#{prm.name == 'xml' ? 80 : 40}"                           rows="#{prm.name == 'xml' ? 10 : 1}"                           taskFlowId="#{prm.taskFlowId}"                           taskFlowParam="#{prm.name}"                           unselectedLabel="#{neb.NO_SELECTION}"                           shortDesc="#{prm.description}"                           value="#{prm.value}"/>                    </af:panelLabelAndMessage>                </af:iterator>             </af:group>          </af:iterator>       </af:panelFormLayout>    </af:panelGroupLayout> </af:showDetailItem>
  • Update taskflowId property to include a dummy taskflow name: for example:  /oracle/webcenter/portalapp/taskflows/nav-lov-support.xml#nav-lov-support

Best practice is to support both the current EL expression and the dummy task flow, the idea is if no task flow is present this property will be empty, at this stage you should inject the dummy task flow name

  • Save the Customization project, this will be deployed to the actual portal when the last configuration is done

Step 3 - Prepare Portal Application for the customization

  • Open the Portal Application that you will deploy the customization to
  • Open Portal project and navigate to WebContent
  • Create a new Bounded Taskflow called nav-lov-support.xml in following location /oracle/webcenter/portalapp/taskflows
  • Make sure to set a default activity on the taskflow, i.e. an empty page
  • Register Taskflow as a resource by right clicking the Taskflow and select Create Portal Resource. Leave all fields as default

This Taskflow is only used as a placeholder for our parameter extensions used in the navigation model

  • Finally we are about to setup the Page Editor Extension file (pe_ext.xml) in following location: Portal\adfmsrc\META-INF
  • Add following markup to the empty xml file (pe_ext.xml)
<?xml version="1.0" encoding="UTF-8" ?>    <pe-extension xmlns="http://xmlns.oracle.com/adf/pageeditor/extension">       <lov-config>          <task-flow-definition taskflow-id="/oracle/webcenter/portalapp/taskflows/nav-lov-support.xml#nav-lov-support">             <input-parameter-definition>                <name>color</name>                <enumeration inline="true">                <item>                   <name>Blue</name>                   <value>BLUE</value>                   <description></description>                </item>                <item>                   <name>Green</name>                   <value>GREEN</value>                   <description></description>                </item>                <item>                   <name>Red</name>                   <value>RED</value>                   <description></description>                </item>                </enumeration>             </input-parameter-definition>           </task-flow-definition>        </lov-config>    </pe-extension>
  • The new parameter that will have value support in the navigation model parameters in run-time in this example will be color, the values that the user can pick from is (Blue, Green, Red). The next step is to test this
  • The best approach to test parameters in Navigation Model is by allowing the navigation entry inherit the parameter from the selected page, therefore I recommend for this instance to just add a page parameter to the home.jspx page called color. You can leave the parameter value empty since this will be set in run-time in the navigation model

Result

extremecust_1

 

 

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha

Recent Content