Friday, May 13, 2011

Add LoV to new and existing taskflow


Configuring a new portal site is easy, right?! However this statement is probably made by someone who knows his way around.
To ease this process the development team can assist there portal administrators by introducing LoV (List of Values) for the available taskflows. This applies to new and existing taskflow, yes you can add List of Values to existing taskflows.
There is following types of LoV:
  • Static LOV
    To display a list of predefined values.
  • Dynamic LOV
    To display a list of values generated by evaluating an EL value that is computed when the page is run.
  • Global LOV
    To display a global list of values that can be used in any task flow in the application.
  • Picker
    To display all values in a picker format, for example, a document picker.
This post will only go through a Static example, however the other options are straight forward.


Assume following scenario to understand the context:
Step one create a new WebCenter Portal Project, add a desired navigation, add few pages, make sure they are customizable and support composer. All pages will be empty so the administrator has to add the taskflow  using the Runtime administration and edit the page.
It will look something like this:
The parameters now are open text boxes that is completely open, even though we declared them mandatory, one problem here is that we cannot guarantee the value the user will enter
There is an remedy for this, by using the new Oracle Composer extension file, pe_ext.xml
We are now going to introduce LoV for parameters  Colour and Language parameter, the process below can be repeated for any taskflow, new or existing.
Create new XML file called pe_ext.xml under Portal\adfmsrc\META-INF
Add following xml chunk:

   1: <?xml version="1.0" encoding="UTF-8" ?> 
   2: <pe-extension xmlns="">   
   3:   <lov-config> 
   4:   </lov-config> 
   5: </pe-extension>
Now we are going to add the taskflow reference for the affected taskflow
Add following:

   1: <task-flow-definition taskflow-id="/oracle/webcenter/siteresources/scopedMD/shared/taskflow/demo-taskflow.xml#demo-taskflow">
   3: </task-flow-definition>

The best approach to find the id for the taskflow is to open the resource catalog in runtime and copying it


Now the final part, each parameter can now be configured with one of the four options of LoV, below is two static examples:
Parameter Colour

   1: <name>Colour</name>   
   2:      <enumeration inline="true">     
   3:              <item>       
   4:                       <name>Blue Colour</name>       
   5:                       <value>Blue</value>
   6:                       <description>Select ... Blue</description>     
   7:               </item>     
   8:               <item>       
   9:                    <name>Green Colour</name>       
  10:                    <value>Green</value>       
  11:                    <description>Select ... Green</description>    
  12:                </item>   
  13:          </enumeration> 
  14: </input-parameter-definition>

Parameter Language

   1: <input-parameter-definition>    
   2:       <name>Language</name>   
   3:       <enumeration inline="true"> 
   4:              <item>       
   5:                  <name>English</name>       
   6:                  <value>en</value>       
   7:                  <description>Select ... English</description>     
   8:             </item>     
   9:             <item>       
  10:                   <name>Swedish</name>
  11:                   <value>sv</value>       
  12:                   <description>Select ... Swedish</description>     
  13:              </item>   
  14:          </enumeration> 
  15: </input-parameter-definition> 
The entire xml should look like this:
Deploy the Portal project to see following result:


For more information on how to configure LoV see documentation:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.