To allow parameter passing to the bounded task flows that will be launched on a separated tab, we need to modify the dynamicTabShellDefinition.xml file in the oracle-page-templates-ext.jar. Below is the step by step procedure to do this:
- Copy the oracle-page-templates-ext.jar from %MiddlewareHome%\jdeveloper\adfv\jlib\ folder
- Create a new folder in drive C like C:\temp and paste the copied jar.
- Extract the contents of the jar.
- Open command prompt and navigate to the C:\temp folder.
- Enter the following command:
jar xf oracle-page-templates-ext.jar
- If the jar command cannot be recognized, then you need to add the java bin folder path into the "Path" system variables. Ex. "C:\Oracle\Middleware\jdk160_14_R27.6.5-32\bin;"
- Delete the jar that we have copied into the temp directory. We do this so that we can easily repack a jar later.
- In windows explorer, browse the "dynamicTabShellDefinition.xml" file in "C:\temp\oracle\ui\pattern\dynamicShell\model" directory
- Right click the file and click "open with...". Open it with JDeveloper.
- Modify the parameter definition to as follows:
<parameters> <parameter id="tabContext" value="${viewScope.tabContext}"/> <parameter id="parameterMap" value="${requestScope.parameterMap}"/> </parameters>
- Redefine all the taskFlow/region bindings to define the "parametersMap" attribute value to "#{bindings.parameterMap}".
<taskFlow id="r0" taskFlowId="${viewScope.tabContext.taskflowIds[0]}" activation="deferred" xmlns="http://xmlns.oracle.com/adf/controller/binding" parametersMap="#{bindings.parameterMap}"> <parameters> <parameter id="tabContext" value="${bindings.tabContext}" xmlns="http://xmlns.oracle.com/adfm/uimodel"/> </parameters> </taskFlow>
You need to do this to all the 15 region definition. - Save your modification.
- Repackage the file in a jar. Open a command prompt navigate to the temp folder we created earlier then run the following command:
jar cfM0 oracle-page-templates.jar *
0 (Zero)
You can give the jar a different name if you like. - Modify libraries and classpath.
- Open your application in JDeveloper.
- Right-click your ViewController project and click project properties.
- Remove the Oracle Extended Page Templates in the classpath entries.
- Add the jar file that we created in the step above.
If you wanted to see a sample test case using the ADF UI Shell that connects to HR Schema, see the following post:
UI Shell in Action
Cheers!
Hi Pino,
ReplyDeleteI have used similar approach, but with just one dynamic task flow definition in my page definition with paramMap, when there is a need to switch several task flows dynamically within a single region which have different number of parameters (names, data types).
You can check my blog at http://tiahbb.blogspot.com
Regards,
Tiah
I have read your post but it seems that it is not in any way related to the ADF UI Shell. This post is specific to the Oracle Dynamic Tabs template.
ReplyDeleteregards,
Pino
Update to this post: The new UI Shell with fixes and support for parameter passing has already been released. Check it out through JDeveloper "Check for Updates".
ReplyDeleteHi Pino,
ReplyDeleteI have a question relating to UI shell but unrelated to the current blog post
How can I customize the UI shell close tab behaviour? By default, the TabContext does provide the service of checking whether a tab is dirty or not. But I want a layer of abstraction above the tabContext where I could do custom actions while closing a tab. However UI shell doesn't seem to provide a handle on the TAB CLOSE icon. Could you suggest me a direction to head into?
Hi Vinit,
ReplyDeleteYou are right that the UI Shell does not provide a handle on the TAB CLOSE icon, but you could modify the UI Shell to support it. I suggest that you read this post: http://soadev.blogspot.com/2010/08/loosely-coupled-bounded-task-flows.html
Regards,
Pino