Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Thursday, November 29, 2012

ADF 11g: Deleting customizations metadata from MDS

ADF 11g offers powerful ways to change or override the pieces of fusion applications via customization and personalization. It can be done in many ways like by administrator at run time to show hide certain components at different levels or layers like at site level, global lever etc. For meeting more specific needs the consultants can do the design time customizations by opening jdeveloper and then bundle them to override the behavior or application flow. Another interesting possibility is to extend fusion applications. One of the example for extension is say the application offers a Task flow showing employee and department data in a tree table structure.  You may want to manipulate this data in a totally different way and hence this may not be satisfied by customizing. At this point, extension comes to the rescue. What you can do is simply create a new bounded task flow with a new view activity as per your requirements. Then you can  customize the existing task flow by dropping your created bounded task flow and making it a default activity. To be able to ship it you will need to package your task flow artifacts as a adf library jar and the customization done as a mar file. Then the packaged adf library jar will be required to place in the exploded ear of your application in the WEB-INF/lib folder (assuming you only created a UI artifacts and reused existing model).

For the mar file deployment, you will need to login to Enterprise Manager of your application server which is usually at http://your server:port/em location. In the em, after choosing your deployed application you will need to select MDS from the menu and have to import the mar file. On bouncing the server the newly created task flow will be launched instead of the one that was earlier present.

There are situations when you may have to revert back to the original task flow so to be able to do you will need to delete the imported metadata. Two of the ways to do that is by:
1. Customization Manager which can be accessed by anyone with administrator privileges.
2. By using the wlst console

The focus of this post is on point 2 and here is how you can do that:

To start the wlst console use:
/wlst.sh 

There are many places where wlst.sh may exist depending upon the weblogic version. Fusion applications also provide its own version of wlst.sh through the shipped libraries during the installation. Some of the typical locations are in


atgpf/common/bin/wlst.sh
DefaultDomain/config/fmwconfig/wlst.sh

wlst commands need either online or offline mode for them to work. So, the one being discussed here to delete metadata it needs the online mode. Which means you need to connect to the server on wlst console before running the command. So to connect you need to use:

connect('weblogic userna,e','weblogic1 password,'t3://server name:port')

Once connected you can first see the imported meta data and then delete it. To get the metadata imported into the app you can use:




exportMetadata(application='You Deployed App name',server='wls server name',toLocation='/tmp/myrepos',docs='/**')

This will export all the mds meta data . You can selectively export by changing the docs option. 


Finally, to delete the metadata like in this case we want to delete just for the customized task flow you can use:

deleteMetadata(application='You Deployed App name',server='wls server name', docs='/WEB-INF/.../ExistingTaskFlow.xml.xml')

This should do the job and as I mentioned earlier the docs option can be changed to delete more than one artifact or all by using /**

Reference: http://docs.oracle.com/cd/E14571_01/web.1111/e13813/custom_mds.htm


Post a Comment