Nov 26
ADF Table shows duplicate rows on CreateInsert
My particular page had a master-detail-detail editable table on it with a “CreateInsert” operation. The first time I hit the createInsert button the page came back with a clean empty row. Every consecutive createInsert operation resulted in a duplicate of the first created row. What was weird was that in debug mode, I could trace the create operation on the view object and the entity object so I knew that a new row was getting created. Even weirder was the fact on dropping a read only column for the primary key attribute, this particular column alone showed freshly created data.
After spending some time breaking my head over this, I came across this post on the forum – http://forums.oracle.com/forums/thread.jspa?messageID=4579932�. So, it appears that ADF treeTable binding requires that the source attribute of a ViewLink is a key attribute on the master data source. My View Links were based on multiple attributes and not all of them were a primary key in the database (although they should’ve been). I went ahead and made the source attributes at each ViewLink level part of the primary key on the corresponding entities. And voila! It worked. Lesson Learnt – Set up primary keys on the entities even if the database design does not specify them.
UserPrincipal missing in ADF context
This is apparently a bug in ADF 11.1.3. The UserPrincipal does not propagate to the ADF session. My application had a no. of queries that used the logged in user’s id as the bind variable’s value. I had used the Groovy expression - “viewObject.DBTransaction.session.userPrincipalName”. Unfortunately, none of my queries worked as expected. After furious Googling, I found out that this was a bug in ADF 11.1.3. Luckily enough, there is another way to fetch the UserPrinicpal – through ADFContext. The code for this – “ADFContext.getCurrent().getSecurityContext().getUserName();”.
To further simply this, I overrode the prepareSession method in my Application Module. In the overridden method, I fetched the user name from ADFContext and set the value into the session.
“session.getEnvironment().put(PropertyMetadata.USER_PRINCIPAL.getName(), currentUserName);”
protected void prepareSession(Session session) {
super.prepareSession(session);
String currentUser =
ADFContext.getCurrent().getSecurityContext().getUserName();
session.getEnvironment().put(PropertyMetadata.USER_PRINCIPAL.getName(),
currentUser);
}
Thanks to Andrejus for his post on the bug.
ADF Bug(?): Multiple entities with same attribute names cause ADF BC Validation errors to display incorrectly
This requires a post for itself. Coming up soon.
Nov 19
CyanogenMod nightlies are being churned out for the Commtiva z71 and clones. Using ROM Manager to install ROMs is so dead easy.
Look here for latest nightlies – http://mirror.teamdouche.net/?device=z71
Discussions of nightlies here – z71 Discussion of Nightlies/
ChangeLog and Code Reviews here – Cyanogenmod Reviews
How-To
- You will need a 2.1 ROM on your device first (official ROM or others). I had CMLEclair 1.2
- Root and su device (if not rooted already)
- Backup all your data/apps using 3rd party tools. I used Titanium Backup
- Install ROM Manager from the android market
- Open ROM Manager and choose Flash ClockworkMod Recovery. From device list choose Commtiva z71. Ensure you allow superuser access when ROM Manager requests
- Download the nightly zip to your sd card.
- Download Google Apps MDPI to your sd card. Read more here – http://wiki.cyanogenmod.com/index.php?title=Latest_Version/Google_Apps
- In ROM Manager choose option Install ROM from SD Card. You may queue the z71 ROM and Google Apps together. Also choose the option “Wipe Data and Cache”
- Allow ClockworkMod Recovery to do its magic.
Nov 19
SOLVED – here.
You may have seen the default tab that Webcenter Spaces displays – the one titled with the logged in username. This tab originates from the People Connections service and contains sub-tabs like “Gallery”, “Activity Stream”, “Message Board”, etc.

People Connections Tab
In my current project, there is a requirement to not display this tab. There does not seem to be any admin option to turn off this tab. Nor does the people connections tab (and also the Personal Space tab) allow the “Close this tab” option. If you use the “Maximised” site template, of course, the primary tab is displayed at one level below and so the PC tab does not show but neither do other group space tabs. That isn’t a workable solution either.
As a last option, I decided to dig into the webcenter application to see what was going on under the wraps. Turns out the tab is hard-wired into the menu model used by WC Spaces. What’s more, the application explicitly leaves out the “Close this tab” option. The only way I see to disable this tab (unless Oracle decides it’s useful and release a patch to enable this feature) is to create a custom site template, create a dummy menu model accessor in a custom bean and use this as the model for the tabs. In the menu model accessor, retrieve the built-in menu model “#{o_w_w_i_v_s_tabManager.menuModel}” and manipulate it at run-time. It isn’t as easy as it sounds. The roadblocks -
- Getting all the required class libraries containing the webcenter spaces classes. The key classes needed are WebCenterShellMenuModel, WebCenterShellTabModel
- Finding a way to actually manipulate the menu model
- Making the whole thing upgrade/patch proof.
- Most importantly, figuring out the copyright/legal implications of using the Webcenter application classes and manipulating an internal object.
I seem to have sorted 1 out. I am working on 2 during my off hours. First step of 2 is to actually identify the entry for this tab, retrieve it at run time and examine its properties.
Nov 08
Note: This is a very roughly put-together guide. I will spend some time in cleaning this up later.
I had someone ask for help on deploying a task flow to WebCenter Spaces and exposing it through a resource catalog. Here’s a quick run-through of how I do it. I will explain the essential building blocks and you should be able to implement it any way you like.
What you’ll need
1) Read the “Extending WebCenter Spaces” whitepaper on OTN.
2) Download the sample project that supplements the whitepaper.
Both these can be downloaded from OTN here. The easiest way to expose custom ADF task flows is to use the sample project and the ANT build file it contains. You can always customize the project to fit your requirements.
Building Blocks
1. Shared ADF Library
- Develop your ADF Taskflow and create an ADF Library out of it.
- Create a new WAR file (let’s call it custom-taskflow.war) including the ADF library jar(s) from step 1 in the WEB-INF/lib of the WAR. Optionally include a manifest to name your extension and setup version info.
- Deploy the WAR to the weblogic server to the WLS_Spaces and AdminServer managed server as a shared library. Note the deployed library’s name from the WLS Admin Console.
2. WebCenter Spaces Customisation
To expose the custom task flow in the Spaces catalog, you have to create and deploy a customisation shared library – “custom.webcenter.spaces”. The Webcenter Spaces installation should already contain a base version of this library.
Here we create and deploy a WS customisation that makes the task flow available on the Spaces catalog. You may choose to add the task flow to either the default personal catalog or the group spaces catalog.
- From the whitepaper sample project, copy the resource catalog required. You’ll find them in the path SourceFiles\catalog\oracle\adf\rc\metadata\scopedMD\defaultScope
- Edit the xml file and add your custom task flow to the resource catalog. To obtain the correct entry for your task flow
- Create a file system connection to the folder containing your ADF Library Jar (from Step 1a)
- Navigate to the task flow entry in the file system connection
- Right clock on the task flow and choose the option “Show Catalog Reference”
- You can copy the entire XML tag that shows up in the dialog.
- Optionally you can add attributes to this – title, description, etc for your task flow. See the entries already present in the source catalog for reference.
- Create a jar that contains the resource catalog. The path to the catalog in the JAR should be custom\oracle\adf\rc\metadata\scopedMD\defaultScope
- Create a WAR file to deploy this as a shared library. A few important points to note on this
- The WAR should contain the JAR from 2c in WEB-INF/lib
- The WAR should contain a weblogic.xml with a library reference entry pointing to the deployment name from 1C.
- The WAR should contain a manifest file that specifies the following mandatorily (See the sample project for reference)
Extension-Name: custom.webcenter.spaces
Specification-Version: <the specification version of the default custom.webcenter.spaces library>
Implementation-Version: <an implementation version higher than the current deployment>
- Deploy the WAR file as a shared library to the WLS_Spaces and AdminServer managed servers.
- Redeploy the webcenter application on WLS_Spaces for the changes to take effect.
Nov 04
This is on JDeveloper 11.1.1.3. YMMV
- ojdeploy does not understand “nocompile=false”
If you have the nocompile property set, then ojdeploy does not compile your project no matter what the value of the property.
- ojdeploy does not like relative paths in the properties
For e.g., my workspace path was getting constructed as “C:\folder\build\..\MyApp\MyApp.jws”. That didn’t work – ojdeploy did not create the task-flow-registry file. I had to make sure that the workspace path was “C:\folder\MyApp\MyApp.jws”
- Chris Muir reports on OTN that there is a bug cos of which ojdeploy is case-sensitive to Windows paths as well. http://forums.oracle.com/forums/thread.jspa?messageID=9119712#9119712. Come to think of it, this could’ve been the root cause for my point 2 failure.
Recent Comments