Add Content to a JSF Page

Create a Content Repository Connection : Use the Create Content Repository Connection dialog to create a connection to an Oracle Portal, Oracle Content Server, or a File System repository.

Create a Content Repository Data Control: Use the Create Content Repository Data Control dialog to create a data control based on a content repository connection.

Create a New JSF Page : Use the Create JSF Page dialog to create a new JSF page in which you will add Documents service task flows.

Add an ADF Read-Only Table to Display Repository Content : Drag and drop the data control's Return node from the getItems method onto the page and configure it to display as an ADF read-only table.

Add the Document Manager Task Flow : Drag and drop the Document Manager task flow from the Resource Palette onto the page.

 

Create a WebCenter Application

tell me more icon Creating a WebCenter Application

To begin creating a new WebCenter application, open the Create Application dialog by clicking New Application in the Application Navigator.   [ tell me more...]





  1. Open the Create Application dialog [ go to dialog or window icon.
  2. On Step 1, in the Application Name field, enter MyWebCenterApp, to follow along with the example.
  3. In the Directory field, specify a directory.
  4. Leave the A pplication Package Prefix field blank. Optionally, you can enter a prefix to use for packages created within this application.
  5. From the Application Template list, select WebCenter Application and click Next .

    tell me more icon WebCenter Application Template

    The WebCenter Application template contains the necessary technology scope for including Oracle WebCenter features in your application, such as Oracle Composer, the Resource Palette, task flows, content integration, and WebCenter Services. The WebCenter Application template also divides the application into two projects:  [ tell me more...]



  6. On Steps 2 through 4, click Next on these pages to accept the default values.
  7. On Step 5, click Finish .

    tell me more icon In the IDE

    When you create your application and projects using the WebCenter Application template, the Application Navigator should look like this:   [ tell me more...]



 

Create a Content Repository Connection

tell me more icon Creating a Content Repository Connection

To begin creating a content repository connection, right-click a project suited to the creation of data controls —such as the Model project—and select New. In the New Gallery, expand General, and select Connections and then Content Repository Connection, and click OK to open the Create Content Repository Connection dialog.  [ tell me more...]





  1. In the Application Navigator, under the MyWebCenterApp application, select the Model project and open the Create Content Repository Connection dialog [ File > New > General > Connections > Content Repository Connection] .
  2. For Create Connection In, select Application Resources.
  3. In the Connection Name field, specify MyFSConnection as the name for the content repository connection.
  4. From the Repository Type dropdown list, select File System.

    tell me more icon Repository Type

    In this example, you will use the File System repository type, which does not require an external content repository, such as Oracle Content Server or Oracle Portal. If you have access to one of the other repository types, then select that from the dropdown list and provide the details for it in the subsequent steps.  [ tell me more...]



  5. Under Configuration Parameters, for Base Path, specify the path to a directory that contains some sample content. For example, C:MyContent.
  6. For the Authentication Method, accept the default value ( Identity Propagation).

    tell me more icon Authentication Method

    The File System repository, used in this example for simplicity, does not require an authentication method. You can leave the default option, Identity Propagation selected. This option provides the application user name to the repository as the identity of the repository user, without providing a password. In this example, since we have not entered a password, the user does not need to log into the repository at runtime.  [ tell me more...]



  7. Select Set as primary connection for Documents service to use this connection in a later step for creating the Document Library task flow.
  8. Click Test Connection to test your connection to the content repository. If the test is successful, click OK.

    tell me more icon In the IDE

    The content repository connection is now included as a resource for your application. The repository connection is added under the Content Repository node. You can view the contents of the connection by expanding the connection tree.  [ tell me more...]



 

Create a Content Repository Data Control

tell me more icon Creating a Content Repository Data Control

A data control is a container for all the data objects, collections, methods, and operations used to create UI components within your WebCenter application. Java Content Repository (JCR) data controls enable the publication of content from any JSR 170 Level 1 compliant repository, such as Oracle Content Server and Oracle Portal. Each type of data control contains common methods and parameters to publish content, such as links, tables, files, and folders, and to add search and advanced search capabilities for your content.   [ tell me more...]





  1. In the Application Navigator, under the MyWebCenterApp application, select the Model project and open the Create Content Repository Data Control dialog [ File > New > Business Tier > Content Repository > Content Repository Data Control] .
  2. In the Data Control Name field, enter MyFSDC as the name for the content repository data control.
  3. In the Connection Name field, from the dropdown list, select MyFSConnection that you created in the previous step.
  4. Under Custom Attributes, if you want, add more attributes to expose in the data control definition.

    tell me more icon Custom Attributes

    A content repository data control contains a set of default attributes; for example, name, path, URI, primaryType, and so on that are always exposed and cannot be modified. Depending on the content repository connection, you can create and define various custom attributes. For example, the File System data control supports a custom attribute: lastModified. To add a new custom attribute, click  and specify the Name, Type, and JCR Path.  [ tell me more...]



  5. Click OK to complete the data control creation.

    tell me more icon In the IDE

    After you create the MyFSDC data control, the content repository data control becomes available for your application in the Data Controls panel in JDeveloper. From here, you can drag methods and operations onto your JSF page to display the repository content as tables, trees, links, and so on, at runtime.   [ tell me more...]



 

Create a New JSF Page

tell me more icon Creating a New JSF Page

The pages you create for your WebCenter application are JavaServer Faces (JSF) documents. These documents have the .jspx file extension. You can create JSF pages using the Create JSF Page dialog. To begin creating a JSF page, right-click the ViewController project and select New. In the New Gallery, expand Web Tier, and select JSF and then JSF Page to open the Create JSF Page dialog.  [ tell me more...]





  1. In the Application Navigator, select the ViewController project and launch the Create JSF Page dialog [ File > New > JSF > JSF Page] .
  2. In the File Name field, enter myPage as the name for your JSF page.
  3. Select the Create as XML Document (*.jspx) checkbox.
  4. Expand Page Implementation.
  5. Select Automatically Expose UI Components in a New Managed Bean.

    tell me more icon Managed Bean

    When you create a JSF page, you can specify whether to expose UI components on the page in a managed bean, which enables programmatic manipulation of the UI components.  [ tell me more...]



  6. Click OK.

    tell me more icon In the IDE

    When you create your JSF page, after you expand all the folders, the Application Navigator should look like this:  [ tell me more...]



 

Add an ADF Read-Only Table to Display Repository Content

tell me more icon Adding an ADF Read-Only Table to Display Repository Content

You can display repository content on your application's pages as tables, links, trees, forms, and so on. To add an ADF read-only table to your JSF page, drag-and-drop the Return node of the getItems method of your data control as ADF Read-Only Table.  [ tell me more...]





  1. In your application, open the myPage.jspx page.
  2. In the Data Controls panel, expand the MyFSDC data control.
  3. Expand the getItems node.
  4. Drag-and-drop the Return node onto the page.
  5. From the Create context menu, select Tables, then select ADF Read-only Table.
  6. In the Edit Table Columns dialog, click OK.

    tell me more icon Editing Table Columns

    In the Edit Table Columns dialog, you can change the columns that display, as well as their display names, in an ADF table. You can also enable features such as sorting or filtering by selecting the appropriate checkboxes in Enable ADF Behavior.   [ tell me more...]



  7. In the Edit Action Binding dialog, under Parameters, enter / for the value of path, and click OK.
  8. Click File > Save All Save All to save your work.
  9. Right-click the page in the Application Navigator and select Run to display the JSF page in a browser.

    tell me more icon In the IDE

    When you add an ADF read-only table to your JSF page, the Design view should look like this:  [ tell me more...]



 

Add the Document Manager Task Flow

tell me more icon Adding the Documents Service Task Flows

The Documents service enables you to view and manage content located in Oracle Content Server, Oracle Portal, and your file system from your application. The Documents service provides the following types of task flows:  [ tell me more...]





  1. In your application, open the myPage.jspx page.
  2. In the Resource Palette, open the WebCenter Services Catalog.
  3. Expand the Task Flows folder.
  4. Drag the Documents - Document Manager task flow and drop it onto the page.

    tell me more icon Document Manager Task Flow

    Under the Resource Palette, from Task Flows, drag and drop the Documents - Document Manager task flow onto the JSF page.   [ tell me more...]



  5. From the Create context menu, select Region.
  6. In the Edit Task Flow Binding dialog, set the connectionName parameter to the name of your connection, MyFSConnection, ensuring you include the notation: ${'MyFSConnection'}, leave startFolderPath blank, and click OK.
  7. In the Application Navigator, right-click the myPage.jspx page and select Run to run your page to your browser.

    tell me more icon In the IDE

    When you add the Document Manager task flow to your JSF page, the Design view should look something like this:  [ tell me more...]



 



Copyright © 1997, 2009, Oracle. All rights reserved.

false ,,,,,,,,,,,,,,,