Monday, December 10, 2012

How to get the source codes of Build-In WebCenter Spaces Task Flows


The post is originally posted here.

Since WebCenter PS5, Oracle brings lots of standard task flows inside WebCenter Spaces. Some of them are already registered within the resource catalog and ready to use, most of them are also ready but you need to add them to the resource catalog first for business users to utilize. But from a developer standpoint, you may be interested in reviewing the source codes of the standard task flow shipped with Oracle WebCenter Spaces. Today I will show you how to locate the EAR or WAR file and take the advantages of build-in task flows.

After the Oracle WebCenter Spaces is installed, go to the following directory and you will find the relevant EAR and WAR files are already installed. In my case, it’s WebCenter PS5 but it’s applicable to other 11g releases.

$FMW_HOME/<WebCenter Instance Name>/webcenter/modules/oracle.webcenter.spaces_11.1.1


The one we are interested is the one at the bottom ‘oracle.webcenter.spaces.webapp.war’ file. You can ftp the file from the server to your local directory and extract it. You will find there are two subfolders in the file – “META-INF” and “WEB-INF”. If you are familiar with WebCenter/ADF development/deployment, those two folders should not be strange. The “META-INF” folder contains configuration files for applications, extensions, class loaders and services. The “WEB-INF” contains the static content that could be referenced and defined in some configuration files in META-INF folder for libraries pre-loading. So there is a folder ‘lib’ residing in WEB-INF and contains the JAR files that is pre-loaded when the server starts and they are the libraries that contains the build-in task flows. Here is the snapshot of the lib directory:




Again, it contains several JAR files that aggregate different set of resources in terms of their modules of functionalities and scope of use. We will look at the one at the bottom “spaces-web” JAR file. In this jar file, you will find all kinds of build-in task flows that are used internally in standard WebCenter Spaces resources. For example, in WebCenter Spaces, the default page template is a template called “Top Navigation”. In the template files, there are several regions being used are those task flows, which can be found here. Take the navigation region as an example, you could find the navigation task flow in this package ‘oracle.webcenter.webcenterapp.view.taskflows.navigation’. Here is the screenshot of the directory you can find about navigation task flows:




In the same ‘spaces-web’ jar file, you could find:
  • All the templates jspx file and their page definition files
  • Standard task flows that you can access from resource catalog
  • Java Beans that manage/support the transactions for the task flows and page fragments

If you want to learn a certain functionality that how Oracle WebCenter build or just find out the source codes that behind the scene, you can find all the relevant info by this means.