This document contains information about migrating from ADF Faces to the current Apache Trinidad Podling code.

1.) View layer

JSP

The Taglib (prefix and URI) has been changed from:

<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af" %>

to

<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr" %>

Facelets

XML NS has been changed from:

xmlns:af="http://xmlns.oracle.com/adf/faces"

to

xmlns:tr="http://myfaces.apache.org/trinidad"

JSF Tags

The following table is based on comparing Trinidad 1.2.2-branch against 10.1.3.3 JDEVADF_10.1.3.3.0_NT_070619.1129.4157

10.1.3 Tag

Trinidad Tag

Attributes in 10.1.3 but not in Trinidad

Attributes in Trinidad but not in 10.1.3

Facets in 10.1.3 but not in Trinidad

Facets in Trinidad but not in 10.1.3

attribute

f:attribute

N/A

N/A

N/A

N/A

commandMenuItem

commandNavigationItem

readOnly
type

destination
partialSubmit
targetFrame
visited

<none>

<none>

goMenuItem

commandNavigationItem

longDesc
onblur
onfocus
readOnly
type

action
actionListener
immediate
launchListener
partialSubmit
returnListener
useWindow
visited
windowHeight
windowWidth

<none>

<none>

menuBar

navigationPane hint="bar"

startDepth

disabled
hint
level
title

<none>

<none>

menuButtons

navigationPane hint="buttons"

startDepth

disabled
hint
level
title

<none>

<none>

menuChoice

navigationPane hint="choice"

onblur
onchange
onfocus
startDepth

hint
level

<none>

<none>

menuList

navigationPane hint="list"

listStyle
startDepth

disabled
hint
level
title

<none>

<none>

menuPath

breadCrumbs

<none>

<none>

<none>

<none>

menuTabs

navigationPane hint="tabs"

startDepth

disabled
hint
level
title

<none>

<none>

menuTree

navigationTree

disclosureListener
startDepth
treeState

disclosedRowKeys
rowDisclosureListener
startLevel

<none>

<none>

objectIcon

icon

<none>

<none>

<none>

<none>

objectImage

image

align
borderWidth
height
width

<none>

<none>

<none>

objectLegend

legend

<none>

<none>

<none>

<none>

objectMedia

media

<none>

<none>

<none>

<none>

objectSeparator

separator

<none>

inlineStyle
styleClass

<none>

<none>

objectSpacer

spacer

<none>

<none>

<none>

<none>

panelBorder

panelBorderLayout

<none>

<none>

<none>

<none>

panelForm

panelFormLayout

width

<none>

<none>

<none>

panelGroup

panelGroupLayout

<none>

<none>

<none>

<none>

panelHorizontal

panelHorizontalLayout

<none>

<none>

<none>

<none>

processTrain

train

<none>

<none>

<none>

<none>

region

<not available> see Region Migration

N/A

N/A

N/A

N/A

regionDef

<not available> see Region Migration

N/A

N/A

N/A

N/A

selectInputColor

inputColor

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

selectInputDate

inputDate

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

selectInputText

inputListOfValues

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

TBD

TBD

showOneChoice

panelChoice

<none>

<none>

<none>

<none>

showOnePanel

panelAccordion

<none>

discloseMany
discloseNone

<none>

<none>

showOneRadio

panelRadio

<none>

<none>

<none>

<none>

showOneTab

panelTabbed

<none>

<none>

<none>

<none>

tableSelectMany

rowSelection="multiple" on table/treeTable and the children of the tableSelectMany added into the actions facet (wrapped in a panelGroupLayout layout="horizontal" if more than one child is present)

N/A

N/A

N/A

N/A

tableSelectOne

rowSelection="single" on table/treeTable and the children of the tableSelectOne added into the actions facet (wrapped in a panelGroupLayout layout="horizontal" if more than one child is present)

N/A

N/A

N/A

N/A

validator

f:validator

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

chart

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

componentDef

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

componentRef

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

facetRef

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

group

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

inputNumberSpinbox

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

outputDocument

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

validateDateRestriction

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

validateDoubleRange

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

validateLength

N/A

N/A

N/A

N/A

Expected "=" to follow "not"

validateLongRange

N/A

N/A

N/A

N/A

chooseColor

chooseColor

<none>

<none>

<none>

<none>

chooseDate

chooseDate

<none>

<none>

<none>

<none>

column

column

bandingShade
formatType
gridVisible

align
defaultSortOrder

<none>

<none>

commandButton

commandButton

<none>

icon

<none>

<none>

commandLink

commandLink

<none>

<none>

<none>

<none>

convertColor

convertColor

convertMessageDetail (mapped to messageDetailConvert)

messageDetailConvert (was convertMessageDetail)

<none>

<none>

convertDateTime

convertDateTime

convertBothMessageDetail (mapped to messageDetailConvertBoth)
convertDateMessageDetail (mapped to messageDetailConvertDate)
convertTimeMessageDetail (mapped to messageDetailConvertTime)

messageDetailConvertBoth (was convertBothMessageDetail)
messageDetailConvertDate (was convertDateMessageDetail)
messageDetailConvertTime (was convertTimeMessageDetail)

<none>

<none>

convertNumber

convertNumber

convertCurrencyMessageDetail (mapped to messageDetailConvertCurrency)
convertNumberMessageDetail (mapped to messageDetailConvertNumber)
convertPatternMessageDetail (mapped to messageDetailConvertPattern)
convertPercentMessageDetail (mapped to messageDetailConvertPercent)

messageDetailConvertCurrency (was convertCurrencyMessageDetail)
messageDetailConvertNumber (was convertNumberMessageDetail)
messageDetailConvertPattern (was convertPatternMessageDetail)
messageDetailConvertPercent (was convertPercentMessageDetail)

<none>

<none>

document

document

<none>

<none>

<none>

<none>

forEach

forEach

<none>

<none>

<none>

<none>

form

form

<none>

<none>

<none>

<none>

goButton

goButton

longDesc

icon

<none>

<none>

goLink

goLink

longDesc

<none>

<none>

<none>

importScript

importScript

<none>

<none>

<none>

<none>

inputFile

inputFile

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

inputHidden

inputHidden

<none>

<none>

<none>

<none>

inputText

inputText

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

iterator

iterator

<none>

<none>

<none>

<none>

message

message

tip(message no longer displays help content)

<none>

<none>

<none>

messages

messages

<none>

<none>

<none>

<none>

outputFormatted

outputFormatted

<none>

<none>

<none>

<none>

outputLabel

outputLabel

anchor(anchors are created automatically when there is a facesMessage)
messageDescUrl
messageTargetFrame
messageType (messageType added automatically based on message(s) for the component pointed to in the 'for' attribute)

<none>

<none>

<none>

outputText

outputText

<none>

<none>

<none>

<none>

page

page

disclosureListener
messageType
quickLinksShown
title

disclosedRowKeys
rowDisclosureListener

<none>

<none>

panelBox

panelBox

width

contentStyle

<none>

<none>

panelButtonBar

panelButtonBar

<none>

halign

<none>

<none>

panelHeader

panelHeader

shortText

<none>

<none>

<none>

panelLabelAndMessage

panelLabelAndMessage

anchor
contentStyleClass
message
messageDescUrl
messageTargetFrame
messageType
tip
valign

labelStyle

<none>

<help>

panelList

panelList

<none>

listStyle

<none>

<none>

panelPage

panelPage

chromeType
messageType
quickLinksShown
title (put inside of an outputText value="title here" inside the "branding" facet where other content may already be and if so then wrap all with a panelGroupLayout layout="horizontal")

auxiliary1Size
auxiliary2Size
auxiliaryGlobalSize

actions (use as an index child)
brandingApp (use as one of the children of a panelGroupLayout layout="horizontal" in the contextGlobal facet)
brandingAppContextual (use as one of the children of a panelGroupLayout layout="horizontal" in the contextGlobal facet)
contextSwitcher (use auxiliaryGlobal)
infoSupplemental (use auxiliary2)
menu1 (use navigation1)
menu2 (use navigation2)
menu3 (use navigation3)
menuGlobal (use navigationGlobal)
menuSwitch (use auxilary1)
messages (use as a first indexed child)

auxiliary1 (was menuSwitch)
auxiliary2 (was infoSupplemental)
auxiliaryGlobal (was contextSwitcher)
contextGlobal (was brandingApp and brandingAppContextual)
navigation1 (was menu1)
navigation2 (was menu2)
navigation3 (was menu3)
navigationGlobal (was menuGlobal)
toolbar1
toolbar2
toolbarGlobal

panelPageHeader

panelPageHeader

<none>

<none>

menu1
menu2
menuGlobal

navigation1
navigation2
navigationGlobal

panelPartialRoot

<none>

<none>

<none>

<none>

<none>

panelSideBar

panelSideBar

<none>

<none>

<none>

<none>

panelTip

panelTip

<none>

<none>

<none>

<none>

poll

poll

<none>

<none>

<none>

<none>

processChoiceBar

processChoiceBar

<none>

<none>

<none>

<none>

progressIndicator

progressIndicator

<none>

<none>

<none>

<none>

resetActionListener

resetActionListener

<none>

<none>

<none>

<none>

resetButton

resetButton

<none>

<none>

<none>

<none>

returnActionListener

returnActionListener

rtexprvalue

deferred-value

<none>

<none>

selectBooleanCheckbox

selectBooleanCheckbox

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

selectBooleanRadio

selectBooleanRadio

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

selectItem

selectItem

<none>

<none>

<none>

<none>

selectManyCheckbox

selectManyCheckbox

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

selectManyListbox

selectManyListbox

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

selectManyShuttle

selectManyShuttle

<none>

<none>

<none>

<none>

selectOneChoice

selectOneChoice

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

selectOneListbox

selectOneListbox

messageDescUrl
messageTargetFrame
tip
valign

contentStyle
unselectedLabel

<none>

help

selectOneRadio

selectOneRadio

messageDescUrl
messageTargetFrame
tip
valign

contentStyle

<none>

help

selectOrderShuttle

selectOrderShuttle

<none>

<none>

<none>

<none>

selectRangeChoiceBar

selectRangeChoiceBar

<none>

<none>

<none>

<none>

setActionListener

setActionListener

<none>

<none>

<none>

<none>

showDetail

showDetail

<none>

<none>

<none>

<none>

showDetailHeader

showDetailHeader

shortText

messageType

<none>

<none>

showDetailItem

showDetailItem

<none>

flex

<none>

toolbar

singleStepButtonBar

singleStepButtonBar

<none>

<none>

<none>

<none>

subform

subform

<none>

<none>

<none>

<none>

switcher

switcher

<none>

<none>

<none>

<none>

table

table

banding
bandingInterval
disclosureAllListener
disclosureListener
selectionState

autoSubmit
columnBandingInterval
disclosedRowKeys
horizontalGridVisible
rowBandingInterval
rowDisclosureListener
rowSelection
selectedRowKeys
verticalGridVisible

selection

<none>

tree

tree

disclosureListener
treeState
selectionState

disclosedRowKeys
focusListener
rowDisclosureListener
selectedRowKeys
selectionListener

<none>

<none>

treeTable

treeTable

banding
bandingInterval
disclosureAllListener
disclosureListener
treeState
selectionState

autoSubmit
columnBandingInterval
disclosedRowKeys
horizontalGridVisible
rowBandingInterval
rowDisclosureListener
rowSelection
selectedRowKeys
verticalGridVisible

selection

<none>

validateByteLength

validateByteLength

maximumMessageDetail (mapped to messageDetailMaximum)

messageDetailMaximum (was maximumMessageDetail)

<none>

<none>

validateDateTimeRange

validateDateTimeRange

maximumMessageDetail (mapped to messageDetailMaximum)
minimumMessageDetail (mapped to messageDetailMinimum)
notInRangeMessageDetail (mapped to messageDetailNotInRange)

messageDetailMaximum (was maximumMessageDetail)
messageDetailMinimum (was minimumMessageDetail)
messageDetailNotInRange (was notInRangeMessageDetail)

<none>

<none>

validateRegExp

validateRegExp

noMatchMessageDetail (mapped to messageDetailNoMatch)

messageDetailNoMatch (was noMatchMessageDetail)

<none>

<none>

We recommend changing the prefix (though this is a matter of preference, and not required):

<af:form>
  <af:inputText label="Your name" id="input1" value="#{helloWorldBacking.name}" required="true"/>
</af:form>

would become:

<tr:form>
  <tr:inputText label="Your name" id="input1" value="#{helloWorldBacking.name}" required="true"/>
</tr:form>

In addition, some components have been renamed. For instance, the ADF component

<af:selectInputDate />

is now named:

<tr:inputDate />

For a detailed list of all renamed components take a look at the Components renaming page.

Note:- tr:navigationPane does not support spacer.

New components

Trinidad include a set of new components that were not existing in ADF Faces like inputNumberSpinbox, outputDocument and panelAccordion with show many option. Make sure to check out the (TBD add component doc link here) to see if one of them answer one your need that ADF Faces was not.

Deprecated components

The following components were deprecated and might be desupported in the future, their usage is therefore discouraged.

TBD

Deprecated attributes

The following attributes were deprecated and might be desupported in the future, their usage is therefore discouraged.

TBD

Table/treeTable Selection

Desupported components

The following components no longer exists and cannot be used anymore.

<af:menu*/>

Desupported attributes/facets

The following attributes/facets no longer exists and cannot be used anymore.

Tip

valign

messageDescUrl and messageTargetFrame

af:table/af:treeTable selection facet

In order to make table/treeTable rows selectable in Trinidad, you should use the rowSelection attribute instead.

The "adfFacesContext" EL object

The ADF EL object

#{adfFacesContext}

has been renamed to:

#{requestContext}

As an example of its usage:

 #{requestContext.agent}

(The EL expression #{requestContext.agent} returns an object that describes the client agent that is making the request and is to display the rendered output.)

Region Migration

The 10.1.3 region was composed of the following artifacts:

To achieve equivalent functionality, separation, and reusability, the following changes must be made:

  1. For each af:region, add a unique request-scope managed bean with the following implementation:
    • public UIComponent getAttributesHolder()
      {
        return _attributesHolder;
      }
      
      public void setAttributesHolder(UIComponent component)
      {
        _attributesHolder = component;
      }
      
      public List getAttributes()
      {
        if (_attributesHolder == null)
        {
          throw new IllegalStateException(
            "The managed bean's attributes holder binding was not established.");
        }
      
        ArrayList attrs = new ArrayList();
        Map<String,Object> attributes = _attributesHolder.getAttributes();
        attrs.add(attributes);
        return attrs;
      }
      
      private UIComponent _attributesHolder = null;
  2. For each af:region, swap it out with the following JSP content that creates a naming container and establishes an EL-accessible Map of attributes for consumption by the included JSP:
    • <tr:group binding="#{customBean.attributesHolder}">
        <f:attribute name="title" value="Snow Fall Conditions"/>
        <f:attribute name="bindings" value="#{bindings.region1}"/>
      </tr:group>
      <tr:iterator id="regionLikeContainer1" var="attrs" value="#{customBean.attributes}">
        <jsp:include page="myRegionDefinitionFragment.jsp"/>
      </tr:iterator>
    • The "customBean" variable is the unique managed bean created during step 1.
    • The value of the f:attribute whose name="bindings" is the "value" from af:region.
    • The "var" on the iterator replaces the "var" in the old af:regionDef. It must not collide with other "vars" inside or else you may encounter a stack overflow at runtime. The iterator only has one stamp.
    • The page identified in the JSP include is the JSP fragment that used to be defined in the region-metadata.xml file.
  3. In the region definition JSP fragment file:
    • Remove the af:regionDef tag
    • Ensure that any EL referring to the "var" defined on the regionDef corresponds to the "var" declared in the usage page.
    • If you have any EL that pulls objects off of a "bindings" object, be sure to qualify it with the "var" name, e.g. "#{attrs.bindings}".

Adding Oracle ADF Faces Rich Client Pages to Trinidad Project

After you migrated ADF 10.1.3 project to Trinidad, if you add ADF Faces Rich Client pages to the project, when you start your application with a Trinidad page, followed by navigating to an ADF Faces Rich Client page, you run into the exception similar to the following:

To workaround this issue, please assign the application launching Trinidad page with a window name by adding a script tag <trh> in the page document as following:

For an application with both Trinidad and Rich Client pages, the navigation rules should be defined in adfc-config.xml. Please refer to the following table for supported and non-supported cases.

Use case

Supported?

Trinidad page to Trinidad page, POST (useWindow=false)

Yes

Trinidad page to Trinidad page, POST (useWindow=true)

No

Trinidad page to Trinidad page, GET

Yes

Trinidad page to Rich Client page, POST (useWindow=false)

Yes

Trinidad page to Rich Client page, POST (useWindow=true)

No

Trinidad page to Rich Client page, GET

Yes

Rich Client page to Trinidad page, POST (useWindow=false)

Yes

Rich Client page to Trinidad page, POST (useWindow=true)

Yes

Rich Client page to Trinidad page, GET

Yes

Rich Client page to Rich client page, POST (useWindow=false)

Yes

Rich Client page to Rich Client page, POST (useWindow=true)

Yes

Rich Client page to Rich Client page, GET

Yes

Note that for Trinidad application without any rich client pages, the navigation rules should be defined in faces-config.xml as before, it works when using POST or GET.

2.) XML configuration

web.xml

For the web.xml file you have to change some entries.

For the ResourceServlet only the package has changed (oracle.adf.view.faces.webapp). For Trinidad change it like

<servlet>
  <servlet-name>resources</servlet-name>
  <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
</servlet>

NOTE that it still maps to the "/adf/*" url-pattern. There is no "/trinidad/*" yet.

<servlet-mapping>
  <servlet-name>resources</servlet-name>
  <url-pattern>/adf/*</url-pattern>
</servlet-mapping>

The formal AdfFacesFilter is now named TrinidadFilter. The TrinidadFilter is available in the same package like the ResourceServlet. A possible configuration might be

<filter>
  <filter-name>trinidad</filter-name>
  <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
</filter>
...
<filter-mapping>
  <filter-name>trinidad</filter-name>
  <servlet-name>faces</servlet-name>
</filter-mapping>

For ADF Faces you could specify some context parameters inside the web.xml. With Trinidad that's possible too, but the prefixes of all parameters have been renamed. Here is an example of two entries:

ADF Faces

<context-param>
  <param-name>oracle.adf.view.faces.USE_APPLICATION_VIEW_CACHE</param-name>
  <param-value>false</param-value>
</context-param>
<context-param>
  <param-name>oracle.adf.view.faces.ALTERNATE_VIEW_HANDLER</param-name>
  <param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<context-param>
  <param-name>oracle.adfinternal.view.faces.DISABLE_CONTENT_COMPRESSION</param-name>
  <param-value>true</param-value>
</context-param>

Trinidad

<context-param>
  <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
  <param-value>false</param-value>
</context-param>
<context-param>
  <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
  <param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<context-param>
  <param-name>org.apache.myfaces.trinidadinternal.DISABLE_CONTENT_COMPRESSION</param-name>
  <param-value>true</param-value>
</context-param>

The rule is that the prefix 'oracle.adf.view.faces' is now 'org.apache.myfaces.trinidad'.

faces-config.xml

For the faces-config.xml file you only need to change the entry of the RenderKit ID. Here is an example:

<application>
  <default-render-kit-id>
    oracle.adf.core
  </default-render-kit-id>
  ...
</application>

With Trinidad you must do the following:

<application>
  <default-render-kit-id>
    org.apache.myfaces.trinidad.core
  </default-render-kit-id>
  ...
</application>

ADF/Trinidad specific XML files

The two formal ADF Faces configuration files

adf-faces-skins.xml
adf-faces-config.xml

are now named:

trinidad-skins.xml
trinidad-config.xml

The formal skin namespace

http://xmlns.oracle.com/adf/view/faces/skin

is now

http://myfaces.apache.org/trinidad/skin

The formal namespace for the "adf-faces-config"

http://xmlns.oracle.com/adf/view/faces/config

was changed (for the trinidad-config.xml file) to

http://myfaces.apache.org/trinidad/config

and the root element renamed from <adf-faces-config> to <trinidad-config>.

Skinning

For skinning, you need to know that the RenderKit IDs have been changed from

oracle.adf.core
oracle.adf.desktop
oracle.adf.pda

to:

org.apache.myfaces.trinidad.core
org.apache.myfaces.trinidad.desktop
org.apache.myfaces.trinidad.pda

Some skinning keys have changed. The doc showing how to migrate 10.1.3 skinning selectors to Trinidad skinning selector is available here: http://wiki.apache.org/myfaces/Skinning_Selector_Migration_from_ADF_to_Trinidad

A skin which looks like the default Oracle BLAF oracle skin is being created for Trinidad (Trinidad JIRA 918: https://issues.apache.org/jira/browse/TRINIDAD-918). The oracle skin used special Oracle Skin renderers for some components, like tabs. Those renderers no longer exist in Trinidad.

10.1.3 rendered images from image 'bits', like button start, button end, etc. Trinidad no longer supports this. There have been discussions about this on the Trinidad user and dev lists where you can look for the most recent information on this.

Converting ADF 10.1.3 Menus to Trinidad Menus XMLMenuModel

Trinidad adds an out-of-the-box menu model to easily create your menu system...

The ADF Faces 10.1.3 Menu Model

It is important that the reader go to http://bali.us.oracle.com:2020/releases/oracle.faces/ea19/devguide/menus.html (note: this link will change over time as ADF Faces continues in its development, so please check to make sure you are looking at the latest iteration of the menu mode documentation) and carefully read the entire contents of this page which describes the menu model developed in ADF Faces for 10.1.3.

Specifying the 10.1.3 Menu Nodes and Their Attributes

Let's start with a sample menu/navigation tree:

                    Menu
            /         |       \
         global0   global1  global2
         /     \
       tab0   tab1
      /    \
  subtab0 subtab1

10.1.3 Menu Nodes as Beans in faces-config.xml

In 10.1.3, these nodes would be represented as managed beans in the faces-config.xml file. This is lengthy, unwieldy and does not allow one to easily understand the hierarchical structure of the tree at a glance.

    <!-- create the menuModel nodes -->

    <managed-bean>
     <managed-bean-name>global2</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <managed-property>
       <property-name>label</property-name>
       <value>Global2</value>
     </managed-property>
     <managed-property>
       <property-name>viewId</property-name>
       <value>/menuDemo/global2.jspx</value>
     </managed-property>
     <managed-property>
       <property-name>outcome</property-name>
       <value>goToGlobal2</value>
     </managed-property>
   </managed-bean>

   <managed-bean>
     <managed-bean-name>global1</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <managed-property>
       <property-name>label</property-name>
       <value>Global1</value>
     </managed-property>
     <managed-property>
       <property-name>viewId</property-name>
       <value>/menuDemo/global1.jspx</value>
     </managed-property>
     <managed-property>
       <property-name>outcome</property-name>
       <value>goToGlobal1</value>
     </managed-property>
   </managed-bean>

    <managed-bean>
     <managed-bean-name>global0</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <managed-property>
       <property-name>children</property-name>
       <list-entries>
         <value-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</value-class>
         <value>#{tab0}</value>
         <value-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</value-class>
         <value>#{tab1}</value>
       </list-entries>
     </managed-property>
     <managed-property>
       <property-name>label</property-name>
       <value>Global0</value>
     </managed-property>
     <managed-property>
       <property-name>viewId</property-name>
       <value>/menuDemo/global0.jspx</value>
     </managed-property>
     <managed-property>
       <property-name>outcome</property-name>
       <value>goToGlobal0</value>
     </managed-property>
   </managed-bean>

    <managed-bean>
     <managed-bean-name>tab0</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <managed-property>
       <property-name>children</property-name>
       <list-entries>
         <value-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</value-class>
         <value>#{subTab0}</value>
         <value-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</value-class>
         <value>#{subTab1}</value>
       </list-entries>
     </managed-property>
     <managed-property>
       <property-name>label</property-name>
       <value>Tab0</value>
     </managed-property>
     <managed-property>
       <property-name>viewId</property-name>
       <value>/menuDemo/tab0.jspx</value>
     </managed-property>
     <managed-property>
       <property-name>outcome</property-name>
       <value>goToTab0</value>
     </managed-property>
   </managed-bean>

    <managed-bean>
     <managed-bean-name>tab1</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <managed-property>
       <property-name>label</property-name>
       <value>Tab1</value>
     </managed-property>
     <managed-property>
       <property-name>viewId</property-name>
       <value>/menuDemo/tab1.jspx</value>
     </managed-property>
     <managed-property>
       <property-name>outcome</property-name>
       <value>goToTab1</value>
     </managed-property>
   </managed-bean>

    <managed-bean>
     <managed-bean-name>subTab0</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <managed-property>
       <property-name>label</property-name>
       <value>Subtab0</value>
     </managed-property>
     <managed-property>
       <property-name>viewId</property-name>
       <value>/menuDemo/subtab0.jspx</value>
     </managed-property>
     <managed-property>
       <property-name>outcome</property-name>
       <value>goToSubTab0</value>
     </managed-property>
   </managed-bean>

    <managed-bean>
     <managed-bean-name>subTab1</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <managed-property>
       <property-name>label</property-name>
       <value>Subtab1</value>
     </managed-property>
     <managed-property>
       <property-name>viewId</property-name>
       <value>/menuDemo/subtab1.jspx</value>
     </managed-property>
     <managed-property>
       <property-name>outcome</property-name>
       <value>goToSubTab1</value>
     </managed-property>
   </managed-bean>

Specifying the Trinidad XML Menu Model Nodes

In the XML Menu Model, the Nodes and their attributes are specified in one or more xml files via metadata. This is much less unwieldy than the 10.1.3 method, a lot more easily edited, and clearly shows the hierarchical structure of the menu tree through its indentation levels. We start with a brief explanation of the menu metadata before showing the actual metadata for our sample tree.

XMLMenuModel Menu Metadata

There are four possible, different node types in a menu model's metdata:

To learn about each of the attributes of these nodes, it is strongly suggested that the reader go to http://aseng-wiki.us.oracle.com/asengwiki/display/ASDevADFFaces/XMLMenuModel+Runtime#metadata and read about each type of node and its attributes.

XMLMenuModel Custom Node Attributes

Please see http://aseng-wiki.us.oracle.com/asengwiki/display/ASDevADFFaces/XMLMenuModel+Runtime#CustomAttributes for a complete explanation of custom node attributes in the XMLMenuModel.

XMLMenuModel Sample Menu Metadata

Here again is our sample tree structure representing a menu.

                    Menu
            /         |       \
         global0   global1  global2
         /     \
       tab0   tab1
      /    \
  subtab0 subtab1

The metadata for such a structure would look like this:

<?xml version="1.0" encoding="iso-8859-1"?>
<menu xmlns:"http://myfaces.apache.org/trinidad/menu">
  <itemNode id="gin0" label="global0" action="goToGlobal0"
            focusViewId="/menuDemo/global0.jspx">
    <itemNode id="in1" label="tab1" action="goToTab0"
              focusViewId="/menuDemo/tab0.jspx">
      <itemNode id="in11" label="subtab1" action="goToSubTab0"
                focusViewId="/menuDemo/subtab0.jspx"/>
      <itemNode id="in12" label="subtab2" action="goToSubTab1"
                focusViewId="/menuDemo/subtab1.jspx"
                customAttribute1="myCustomAttrValue"/> <!-- example custom attribute -->
    </itemNode>
    <itemNode id="in2" label="tab1" action="goToTab1"
              focusViewId="/menuDemo/tab1.jspx"/>
  </itemNode>
  <itemNode id="gin1" label="global1" icon="/components/images/globalhelp.gif"
            action="goToGlobal1"
            focusViewId="/menuDemo/global1.jspx"/>
  <itemNode id="gin2" label="global2" icon="/components/images/globalprefs.gif
            action="goToGlobal2"
            focusViewId="/menuDemo/global2.jspx"/>
</menu>

Specifying the Menu Model

In 10.1.3, the Menu Model is specified by 2 managed beans in the faces-config.xml The first bean (at the bottom) is an adapter bean that actually calls another bean to get is model:

   <!-- create the treemodel -->
   <managed-bean>
     <managed-bean-name>menuTreeModel</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.TreeModelAdapter</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <managed-property>
       <property-name>childProperty</property-name>
       <value>children</value>
     </managed-property>
     <managed-property>
       <property-name>listInstance</property-name>
       <list-entries>
         <value-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</value-class>
         <value>#{global0}</value>
         <value>#{global1}</value>
         <value>#{global2}</value>
       </list-entries>
     </managed-property>
   </managed-bean>

   <!-- create the menuModel -->
   <managed-bean>
     <managed-bean-name>menuModel</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.menu.MenuModelAdapter</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>
     <managed-property>
       <property-name>viewIdProperty</property-name>
       <value>viewId</value>
     </managed-property>
     <managed-property>
       <property-name>instance</property-name>
       <value>#{menuTreeModel.model}</value>
     </managed-property>
   </managed-bean>

In the XMLMenuModel, the bean is the model. The "source" managed-property contains the path to the menu’s metadata.

     <!-- managed bean menu model -->
     <managed-bean>
       <managed-bean-name>root_menu</managed-bean-name>
       <managed-bean-class>org.apache.myfaces.trinidad.model.XMLMenuModel</managed-bean-class>
       <managed-bean-scope>request</managed-bean-scope>
       <managed-property>
         <property-name>source</property-name>
         <value>/WEB-INF/menu-metadata.xml</value>
       </managed-property>
     </managed-bean>

The "setSource" method of the XMLMenuModel will be called with the location of the menu model's metadata, as specified in the "managed-property" element. IMPORTANT NOTE: the scope for the menu model MUST be "request".

Navigation-rules and cases are the same in the faces-config.xml in 10.1.3 as they are using the XMLMenuModel. The difference lies in how the navigation-case <from-outcome> is specified by each model. For example, in the case of the 10.1.3 model, each menu node is specified by a bean in the faces-config.xml. The managed bean for our "global0" menu node is:

    <managed-bean>
     <managed-bean-name>global0</managed-bean-name>
     <managed-bean-class>oracle.adfdemo.view.faces.menu.DemoMenuItem</managed-bean-class>
     <managed-bean-scope>none</managed-bean-scope>
     <managed-property>
       <property-name>label</property-name>
       <value>Global0</value>
     </managed-property>
     <managed-property>
       <property-name>viewId</property-name>
       <value>/menuDemo/global0.jspx</value>
     </managed-property>
     <managed-property>
       <property-name>outcome</property-name>
       <value>goToGlobal0</value>
     </managed-property>
   </managed-bean>

while the metadata for the same node in the XMLMenuModel is simply:

  <itemNode id="gin0" label="global0" action="goToGlobal0"
            focusViewId="/menuDemo/global0.jspx">

Both would have the same navigation-case in the faces-config.xml file:

<navigation-rule>
  <navigation-case>
    <from-outcome>goToGlobal0</from-outcome>
    <to-view-id>/menuDemo/global0.jspx</to-view-id>
  </navigation-case>
           .
           .
           .
</navigation-rule>

Adding a Menu to a Page

Below is an example of syntax typical of a .jspx file that adds a menu (using a menu model) to an af:page in 10.1.3:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:af="http://xmlns.oracle.com/adf/faces" >
  <jsp:directive.page contentType="text/html;charset=utf-8"/>
  <f:view>
    <af:document title="Menu Demo">
      <af:form>
        <af:page var="foo" value="#{menuModel.model}" title="Title">
          <f:facet name="nodeStamp">
            <af:commandMenuItem text="#{foo.label}"
                                action="#{foo.getOutcome}"
                                type="#{foo.type}"/>
           </f:facet>
           <!-- the Page Contents here -->
          <jsp:include page="/menuDemo/menuDemo_content.jspx"/>
        </af:page>
      </af:form>
    </af:document>
  </f:view>
</jsp:root>

Using the Trinidad XMLMenuModel, as seen below, there are differences of note. Notice that almost all of the tags are Trinidad tags (<tr:…/>) instead of the adf-faces <af:…/> tags. Also notice that inside of the nodestamping, a “commandNavigationItem” is used instead of “commandMenuItem”.

  <?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
     <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2"
               xmlns:f="http://java.sun.com/jsf/core"
               xmlns:tr="http://myfaces.apache.org/trinidad" >
       <jsp:directive.page contentType="text/html;charset=utf-8"/>
       <f:view>
         <tr:document title="Trinidad Menu Demo">
           <tr:form>
             <tr:page title="Welcome to the Trinidad Menu Demo"
                      var="menuInfo" value="#{root_menu}">
               <f:facet name="nodeStamp">
                 <tr:commandNavigationItem label="#{menuInfo.label}"
                                           action="#{menuInfo.doAction}"
                                           destination="#{menuInfo.destination}"
                                           icon="#{menuInfo.ico}"
                                           rendered="#{menuInfo.rendered}"/>
               </f:facet>
               <!-- the Page Contents here -->
               <jsp:include page="/menuDemo/menuDemo_content.jspx"/>
             </tr:page>
           </tr:form>
         </tr:document>
       </f:view>
     </jsp:root>

3.) Java files

JSF 1.2

Trinidad 1.2 uses JSF 1.2, so API's have changed accordingly, for example MethodBinding -> MethodExpression

With Trinidad 1.2, tr:validator and tr:attribute tags are no longer supported. The corresponding f:validator and f:attribute tags are now completely identical in functionality.

Package Names

If you use the ADF Faces API inside your Java files, for instance inside your backing beans, you must change the package names and in some cases also the class names.

The formal ADF Faces API was:

oracle.adf.view.faces.**

Inside Trinidad it's changed to

org.apache.myfaces.trinidad.**

Here is a simple example for the new import of the 'Agent' interfaces.

Instead of

import oracle.adf.view.faces.context.Agent;

use

import org.apache.myfaces.trinidad.context.Agent;

Classes Removed or Renamed

Since some class names have been changed, here is a list of all classes from the ADF Faces API, which have been renamed during the move to Trinidad.

ADF Faces API

Apache Trinidad API

AdfFacesContext

RequestContext

AdfFacesFilter

TrinidadFilter

ADFLogger

TrinidadLogger

ADF!LogRecord*

TrinidadLogRecord*

Class in 10.1.3

Class in Trinidad

AbstractPropertyMap

Not Available

AdfFacesContext

RequestContext

AdfFacesContextFactory

RequestContextFactory

AdfFacesFilter

TrinidadFilter

AdfFacesFilterHelper

Not Available

ContextWrapper

Not Available

ContextWrapperFactory

Not Available

CoreCommandMenuItem

Not Available

CoreGoMenuItem

Not Available

CoreMenuBar

Not Available

CoreMenuButtons

Not Available

CoreMenuChoice

Not Available

CoreMenuList

Not Available

CoreMenuPath

Not Available

CoreMenuTabs

Not Available

CoreMenuTree

Not Available

CoreObjectIcon

CoreIcon

CoreObjectImage

CoreImage

CoreObjectLegend

CoreLegend

CoreObjectMedia

CoreMedia

CoreObjectSeparator

CoreSeparator

CoreObjectSpacer

CoreSpacer

CorePanelBorder

CorePanelBorderLayout

CorePanelForm

CorePanelFormLayout

CorePanelGroup

CorePanelGroupLayout

CorePanelHorizontal

CorePanelHorizontalLayout

CorePanelPartialRoot

Not Available

CoreProcessTrain

CoreTrain

CoreSelectInputColor

CoreInputColor

CoreSelectInputDate

CoreInputDate

CoreSelectInputText

CoreInputListOfValues

CoreShowOneChoice

CorePanelChoice

CoreShowOnePanel

CorePanelAccordion

CoreShowOneRadio

CorePanelRadio

CoreShowOneTab

CorePanelTabbed

CoreTableSelectMany

Not Available

CoreTableSelectOne

Not Available

CurrencySet

Not Available

DefaultingPathMap

Not Available

DisclosureAllEvent

Not Available

!IOWrapperFactory

Not Available

!MDSDocumentChangeManager

Not Available

NullChangeManager

Not Available

PathSet

Not Available

RequestWrapper

Not Available

ResponseWrapper

Not Available

SessionWrapper

Not Available

!UIXMenuPath

Not Available

!UIXMenuTree

Not Available

!UIXRegion

Not Available

!UIXTableSelectMany

Not Available

!UIXTableSelectOne

Not Available

Not Available

Base64InputStream

Not Available

Base64OutputStream

Not Available

ChartDrillDownEvent

Not Available

ChartDrillDownListener

Not Available

ChartModel

Not Available

ClassLoaderUtils

Not Available

ClientRowKeyManager

Not Available

ClientRowKeyManagerFactory

Not Available

!Configurator

Not Available

CoreBreadCrumbs

Not Available

CoreChart

Not Available

CoreCommandNavigationItem

Not Available

CoreInputNumberSpinbox

Not Available

CoreNavigationPane

Not Available

CoreNavigationTree

Not Available

CoreOutputDocument

Not Available

CorePanelPopup

Not Available

CoreRenderer

Not Available

CoreStatusIndicator

Not Available

DateListProvider

Not Available

DateRestrictionValidator

Not Available

DoubleRangeValidator

Not Available

ExternalContextDecorator

Not Available

FormData

Not Available

!Icon

Not Available

IntegerUtils

Not Available

InternalView

Not Available

LengthValidator

Not Available

ListFromCollection

Not Available

LocaleContext

Not Available

LoggerBundle

Not Available

LongRangeValidator

Not Available

MethodBindingMethodExpression

Not Available

MethodExpressionMethodBinding

Not Available

PageFlowScopeProvider

Not Available

PageResolver

Not Available

PartialPageContext

Not Available

RenderUtils

Not Available

RenderingContext

Not Available

RowDisclosureEvent

Not Available

RowDisclosureListener

Not Available

RowKeySetChangeEvent

Not Available

RowKeySetImpl

Not Available

RowKeySetTreeImpl

Not Available

SetActionListener

Not Available

!Skin

Not Available

SkinAddition

Not Available

SkinFactory

Not Available

TrinidadLogRecord

Not Available

TrinidadLogger

Not Available

TypeRepository

Not Available

TypedRenderer

Not Available

!UIXChart

Not Available

!UIXComponentELTag

Not Available

!UIXComponentRef

Not Available

!UIXDecorateCollection

Not Available

!UIXGroup

Not Available

!UIXNavigationHierarchy

Not Available

!UIXNavigationLevel

Not Available

!UIXNavigationPath

Not Available

!UIXNavigationTree

Not Available

!UIXShowMany

Not Available

ValueBindingValueExpression

Not Available

ValueExpressionValueBinding

Not Available

!XMLMenuModel

Here is a short example of how to use one of the renamed classes

RequestContext.getCurrentInstance().isPostback();

* TrinidadLogRecord class is not a public class, it's only visible inside the org.apache.myfaces.trinidad.logging package.

Other API Changes

Class in 10.1.3

Class in Trinidad

Change

AdfFacesContext

RequestContext

'processScope' was renamed 'pageFlowScope' in Trinidad. Please see http://myfaces.apache.org/trinidad/devguide/communicatingBetweenPages.html

AdfFacesContext

RequestContext

getAccessibilityMode() now returns an enumerated type

AdfFacesContextFactory

RequestContextFactory

createContext(ContextWrapper context, RequestWrapper request) removed, use createContext(javax.faces.context.ExternalContext ec) instead

CoreImportScript

CoreImportScript

public final void CoreImportScript.setNames(java.lang.String) has been removed. There is a setNames(java.lang.String[] names). If you're using the importScript tag to set the names then no migration is needed

DateTimeConverter

DateTimeConverter

DateTimeConverter.getDateFormat() takes an extra parameter to indicate whether the date format will be used for parsing a string.

ExtendedRenderer

ExtendedRenderer

ExtendedRenderer implements LifecycleRenderer, see LifecycleRenderer changes below

LifecycleRenderer

LifecycleRenderer

all methods now return a boolean indicating whether the lifecycle was processed

UIX!ComponentBase

UIX!ComponentBase

addAttributeChange(PropertyKey attribute, java.lang.Object attributeValue) is removed, use addAttributeChange(java.lang.String attributeName, java.lang.Object attributeValue)

UIX!ComponentBase

UIX!ComponentBase

getLocalClientId is removed on UIX!ComponentBase. In cases where you are using UIX!Collection you can call getContainerClientId() instead.

UIX!SelectInput

UIX!SelectInput

UIX!SelectInput.ACTION_KEY removed, use UIX!SelectInput.ACTION_EXPRESSION_KEY

internal package

An adfinternal package, which has been changed to trinidadinternal; no migration will be available for any code using these APIs, as they were were not supported for use by clients.

JSF 1.2 support in Trinidad

This wiki has details on JSF 1.2 and Trinidad:

The JSF RI version used in ADF Faces 10.1.3.x is different than the JSF RI version used in Trinidad. f:convertDateTime with pattern attribute that evaluated to null use to return null. With latest JSF RI, f:convertDateTime with pattern attribute that evaluates to null returns an empty string. The JSF RI bug can be seen here: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=323

from_ADF_to_Trinidad (last edited 2010-03-22 22:56:32 by MinLu)