Professional Documents
Culture Documents
Asset Technology Group
Webcenter
Investigations
Karim Ainine
1/31/2010
Contents
CONTENTS ......................................................................................................................................................... 2
DEVELOPING CUSTOM APPLICATIONS ................................................................................................................ 3
ADDING TASKFLOWS TO APPLICATIONS .............................................................................................................................. 3
Using the gallery: .................................................................................................................................................. 3
From the faces‐config.xml ..................................................................................................................................... 6
TASKFLOWS VS. STANDALONE JSF PAGES ............................................................................................................................ 7
DEPLOYING CUSTOM APPLICATIONS .................................................................................................................. 8
DEPLOYING A CUSTOM APPLICATION TO AN APPLICATION SERVER USING JDEVELOPER ................................................................ 8
Creating a deployment profile for the application ................................................................................................ 8
Create a connection to the Application server through JDeveloper .................................................................... 11
Deploying the EAR file to the Managed server ................................................................................................... 14
ADDING AN APPLICATION TO SPACES’ RESOURCE CATALOGUE AS A PORTLET ........................................................................... 16
DATABASE CONNECTIONS ................................................................................................................................. 20
ADDING A DATASOURCE TO A MANAGED SERVER ............................................................................................................... 20
Creating Datasource on the Managed Server ..................................................................................................... 20
Configuring the Application Module ................................................................................................................... 23
INCLUDING AN APPLICATION’S METADATA IN THE SERVER’S MDS ......................................................................................... 24
OMNIPORTLETS ................................................................................................................................................ 26
WIRING TWO OMNIPORTLETS USING QUERYSTRING ........................................................................................................... 26
CREATING AN OMNIPORTLET WITH HTML LAYOUT ............................................................................................................ 28
2
Developing Custom Applications
There are several types of applications offered by JDeveloper. Before creating a new application, the
developer must know what are the classes needed in his design and have a complete plan of how the
task will be implemented in order to choose the most suitable application. During my investigation, I
came across the Fusion Web Application (ADF) and the Webcenter applications. The difference between
them is basically the different classes included in the default setting. Both applications can contain
Taskflows and/or JSF pages. The following section will discuss how to add a Taskflow to the currently
used application.
Adding Taskflows to Applications
There are two ways to add a Taskflow to an application, either by creating a new Taskflow in the View
Controller project from the gallery, or by creating an ADF Taskflow from the faces‐config.xml file that
already exists in the View Controller project.
Using the gallery:
1. Right click on the View Controller project and click New…
2. Go to JSF in the Web Tier Section and choose ADF Taskflow
3. Enter a descriptive name in the File Name field and select Create with Page Fragments in order to
create “.jsff” fragments for the views inside the Taskflow
3
4. Open the Taskflow file and start dragging views from the component palette. Each view will
represent a page in your implementation.
5. Complete the diagram with views, flow cases, etc.
4
6. Double click on the view to create the fragment representing it. (Notice the extension of the file) –
JSF page fragments can be treated exactly like JSF pages. Difference between them will be discussed
in the following section.
7. To view the fragments in a JSF page, just drag and drop the Taskflow in a new JSF page, then select
region.
5
From the facesconfig.xml
1. Right click on the faces‐config.xml file and go to Generate ADF Taskflow…
2. Repeat the steps exactly like the previous section.
6
Taskflows vs. Standalone JSF pages
Based on the applications created in my investigation time, I could only notice a major recognizable
difference between creating an application using several JSF pages navigating between each other, and
creating fragments in a Taskflow that will then be dragged into a single JSF page.
The difference was noticed when the application was deployed as a Portlet on Webcenter spaces.
Having the Portlet navigate between pages caused the area where the Portlet was displayed to refresh
every time a user navigated within the Portlet. That action was detected by spaces and led to all the
portlets to change their current position trying to fill the gap left by the portlet trying to refresh. On the
other hand, using the Taskflow and fragments didn’t show any sign of the Portlet needing to refresh
while navigating through its content; the navigation was very smooth and didn’t affect any portlets
around it.
7
Deploying Custom Applications
Based on my personal investigation, there are two ways of deploying a custom application on a
Webcenter Server and using it in Spaces. The first approach is deploying it as an application on any of
the Managed servers on the Weblogic server where Spaces is deployed and refer to it inside Spaces as a
webpage (just like the Wikis). The other approach is deploying it as a portlet and showing it on the
resource catalogue so users are able to add it to their personal pages just like they add the Documents
Taskflow.
Deploying a Custom Application to an Application Server using JDeveloper
To deploy an application on an application server, the following steps must be done carefully:
1. Create a deployment profile for the application (a JAR for the model, a WAR for the view controller
and an EAR for the application).
2. Create a connection to the Application server through JDeveloper
3. Deploy the EAR file that contains both the JAR and WAR files to the Managed Server on the
Application server.
Creating a deployment profile for the application
To create the JAR file for the model project:
1. Right click on the project and go to Project Properties…
2. Go to Deployment and click on New…
3. Select JAR from the Archive Type, and give it a descriptive name, then click on OK
8
4. Leave the default settings in the JAR Deployment Profile Properties and click on OK. Click on OK
again to exit the Project Properties window.
To create the WAR file for the view controller project:
1. Repeat steps 1 and 2 from the previous section.
2. Select WAR from the WAR from the Archive Type and rename it to a more descriptive name then
click OK.
3. Go to Profile Dependencies and select the archive for the model project that was just created and
leave the default values for the rest of the settings. Click OK.
9
4. Click on OK again to exit the Project Properties window.
To create the EAR file for the application and include both the JAR and WAR in it:
1. Go to Application Application Properties…
2. Go to Deployment and click on New…
3. Select EAR in the Archive Type and give it a descriptive name then click on OK.
4. In the EAR deployment profile properties, go to Application Assembly and select both the model and
view controller archives that were just created.
10
5. Make sure that the “Auto Generate and Synchronize weblogic‐jdbc.xml Descriptors during
Deployment” and all the “Security Deployment Options” are selected.
6. Click OK to exit the Application Properties window.
Now that all your deployment profiles are created, the application is ready to be deployed on the server.
But before that, a connection to the Application server must be created in JDeveloper.
Create a connection to the Application server through JDeveloper
To connect to an Application server:
1. Go to ViewApplication Server Navigator
2. Right click on Application Servers then click on New Application Server…
3. Select Standalone Server then click next.
11
4. Type in a descriptive Connection Name and select Connection Type, in this case it’s WebLogic 10.3.
Click Next.
5. Enter the Connection’s Username and Password and click next.
6. Type in the server’s IP or Name in the Hostname, the port number in Port, the SSL port if applicable,
and the Weblogic Domain then click next.
12
7. Finally, test the connection and if everything is successful, click Finish.
Now that JDeveloper is connected to the Application server and the deployments profiles are ready to
be deployed, it’s time to deploy the application on the application server.
13
Deploying the EAR file to the Managed server
To deploy the application on a Managed server using JDeveloper:
1. Go to ApplicationDeploy<the EAR’s name>…
2. Select Deploy to Application Server in the Deployment Action window then click next.
3. Select the Application Server that was just connected to and make sure that “Deploy to all server
instances in the domain” is not selected, then select “Deploy as a standalone application” and click
next.
14
4. Select the server instance (Managed Server) that you would like to deploy the application on and
click next then finish. (It doesn’t have to be the Spaces server)
Now that the application is deployed successfully on the application server, you need to go to the
enterprise manager (EM) of the server (http://<hostname>:<port>/em) and make sure that the
application appears there.
15
Now the application can be added to spaces simply by using the web page component in the resource
catalogue and putting the applications URL in it, just like adding a wiki page.
Adding an Application to Spaces’ Resource Catalogue as a Portlet
To add your application as resource catalogue content, the application must contain a portlet entry. The
portlet entry will create a web service (WSRP) for the application that will be used to register it in
spaces. To create the portlet entry:
1. Complete the implementation of the application, then right click on the JSF page containing the ADF
Taskflow, the JSF welcome page of your application, or the ADF Taskflow itself, then click on Create
Portlet Entry…
16
2. Fill in the create portlet entry window’s fields with descriptive names and click OK.
3. Notice the creation of oracle‐portlet.xml and portlet.xml in the WEB‐INF folder.
4. Deploy the application to any server instance just like the previous section. In the Select deployment
type window that pops up, select yes and click OK.
17
5. After completing the deployment of the application, go to the enterprise manager and copy the
application’s URL.
6. Go to the Webcenter application’s menuSettingsService Configuration
7. Go to portlet producers and click on Add
18
8. Type in a descriptive Connection Name, select WSRP producer, then paste in the WSDL URL field the
applications URL and add /portlets/wsrp2?WSDL to it. Click on OK to register the portlet on spaces’
resource catalogue.
Now that your application is on the resource catalogue (inside the portlets folder), all users can add it to
their personal pages just like any other Taskflow.
19
Database Connections
Adding a Datasource to a Managed Server
To enable your application to access a Datasource, the Datasource must exist on the Managed server
and the application’s application module must be configured to read the data from the Datasource.
Creating Datasource on the Managed Server
To create a Datasource on a Managed Server:
1. Login to the Admin Server’s console on http://<server’s‐url>:<port>/console/
2. Go to ServicesJDBC
3. Click on Data Sources, then New.
4. Type in a descriptive Connection Name, a JINDI Name and specify the database type and driver then
click next twice.
20
5. Type in the Database Name, Hostname, Username and Password to connect to the desired database
and click on Next.
6. Make sure the driver class name and the rest of the information in the final page are correct then
click on Test Configuration.
21
7. If a message, “Connection test succeeded”, appears at the top of the screen, click Finish.
8. Now you can find the Datasource connection in the Data Source’s page, click on it to add Targets to
it.
22
9. Click on Targets in the horizontal menu on top, then select the desired server (where the application
will be deployed) and click on Save.
Now that the data source is added to the server, you just need to configure the application module to
access that data source.
Configuring the Application Module
To configure the Application Module to access a Datasource on the server:
1. Right click on the application module and go to configurations...
2. Select the local application module and click Edit...
23
3. Change the connection type from JDBC URL to JDBC Datasource, and then change the Datasource
Name to <Datasource Name on the Server> then click on OK.
4. Deploy your application, as described earlier in this document, on the Managed Server where the
Datasource is targeted.
Including an Application’s Metadata in the Server’s MDS
During deploying an application that contains a customizable page, panel, etc, using JDeveloper, a
deployment configuration window will pop‐up to configure the applications customization metadata
with the available repositories on the server. It is highly recommended that you ask your administrator
24
to create a separate metadata repository for your customizations, other than the existing two used by
spaces. In the configuration window, select the repository name and partition name, and then click
Deploy. No warnings are supposed to pop‐up, if so, click No and select a different repository or partition
name.
25
OmniPortlets
This chapter will discuss how two or more OmniPortlets can be wired together using hyperlinks and
querystrings. The last section will show, briefly, how to design an OmniPortlet using HTML and not
sticking to the default templates that come with OmniPortlets.
Wiring two OmniPortlets using Querystring
Just like most components in spaces, OmniPortlets’ parameters can read values from the Query strings
in the page’s URL. To achieve a good wiring between two or more OmniPortlets, the producer
OmniPortlet should add a certain query string to the page’s URL and the consumer OmniPortlet(s)
should be able to read that string every time they refresh. The following steps will show a simple
example of creating an OmniPortlet that fetches data from a database and displays other columns in a
different OmniPortlet:
1. Add an OmniPortlet from the resource catalogue to a page; this will be the producer OmniPortlet.
2. In the customization wizard of the OmniPortlet, select SQL in the Type page and click next.
3. Click on Edit Connection in the Source page and fill in all the connection information. Then click on
test. If the connection is successful, click OK.
26
4. Type in a valid SQL statement and click test, if the results are correct click next to continue. In this
case the statement is (Select * from QUESTIONS).
5. Click next twice to go to the View page, enter a descriptive title for the OmniPortlet and select the
Tabular layout style, and then click next.
6. Select one of the columns and change its Action to Hyperlink and add
“?variable=##COLUMNNAME##” to the URL. This will add a query string to the page’s URL with the
variable being the querystring and the value of the selected column every time the hyperlink is
clicked. (In this case it’s “?id=##SURVEY_ID##”).
7. Click on Finish.
27
8. Preview the OmniPortlet and click on a link to make sure that correct id is being sent to the page’s
URL.
9. Create a new OmniPortlet; this will be the consumer OmniPortlet.
10. Type in a statement and add parameters to it using ##PARAMETERNAME## to add the parameter
that will be reading from the querystring. (In this case it is “select * from Choices where Question_ID
= ##Param1##”).
11. Type in a valid value in default value of Param1 and click test. If valid results are shown, click next
and complete the creation of the OmniPortlet desired to view the results.
12. After completing the customization wizard of the OmniPortlet, click on the pencil icon (edit) for the
consumer OmniPortlet and type in #{param.val} in Parameter1 (val being the querystring – in
this case it’s id).
Now that you configured the consumer portlet to read the querystring value from the page’s URL and
set the producer portlet’s links to add the querystring value every time they are clicked, both portlets
will be wired, i.e. you will be able to see the choices and votes of each question by clicking on the
question.
Creating an OmniPortlet with HTML Layout
To edit an OmniPortlet’s layout and use a flexible HTML code:
1. Go to the OmniPortlet and click on customize.
2. In the customization wizard, go to View and select HTML in the layout style.
28
3. Go to Layout and type in the HTML code in the available sections (None‐Repeating Heading,
Repeating, and the None‐Repeating Footer section). Then click on OK.
The following figure shows the questions’ OmniPortlet designed in HTML with the questions being
anchors in the cell and their HREF property being “?id=##SURVEY_ID##”. That way, when you click on
the anchor a querystring with the id is sent to the page’s URL. This will function just like the previous
approach but with more flexibility in the layout. The querystring is shown on top of the page and the
results of the selected question below, in the consumer OmniPortlet.
29
30