Friday, September 28, 2012

ADF - Removing the Application Name from URL (Weblogic)

In order to remove the root context of an ADF or WebCenter application or the application name from the URL, it's quite a simple Weblogic configuration change.

Change the root context of an application can be done from via changing the application.xml. However, this can be quite an involved change if you are using a continuous intergration server such as Hudson or Jenkins as you will need to modify the build scripts to decompile the .ear copy in the new application.xml and then recompile the .ear. 

You will be happy to know Oracle have made a simple yet not well documented fix for this. As per the instructions below: 

1) Go to http://127.0.0.1:7101/console

2) Environment > Servers > DefaultServer(admin) > Protocols Tab > HTTP Tab

3) Modify the "Default WebApp Context Root" to /application_name


4) Hit Save

5) Go to Deployments

6) Select FMW Welcome Application - Undeploy (Check the box and click delete)

7) Restart Weblogic Server.

Go to http://127.0.0.1:7101/ or the home page of your application http://127.0.0.1:7101/faces/home.jspx and your application should come up. 

If faces is also an issue, for you this can also be removed, with a little more effort and the use of a java filter.


WebCenter Portal - Linking Between Navigation Models

A navigation model in WebCenter is primarily used for the navigation and navigational structure of a WebCenter portal application  At a current clients site we ran into the issue of using multiple navigation models and linking to them without the context of another or the current navigation model.

After a lot of research and poking around with the framework I managed to figure out that WebCenter has an undocumented (I couldn't find the doco) method of allowing to you to provide the context of a navigation model through a query string in the URL. 

If you tried to go to a URL in WebCenter and you go to the below you URL you will be linked to the root level id called home in the default navigation model. As such if your refer to an id in another navigation model you will receive a 404 error. However, if add the location of the navigation model as a wcnav.model query string it seems to find it's navigation context.

Default Navigation Model: http://127.0.0.1:7101/testapp/faces/home
Test2 Navigation Model: http://127.0.0.1:7101/testapp/faces/home?wcnav.model=/oracle/webcenter/portalapp/navigations/test2_navigationModel1






This opens alot of doors in terms of WebCenters URLs. As with a little effort allows for bookmarkable, SEO friendly URLs.