Customize and Personalize an Application

You can work in JDeveloper's IDE to customize and personalize an application that is built with Oracle ADF Faces and Oracle ADF Business Components. There are two types of customizations: seeded and user customizations. User customizations in an application allow end users to make changes to certain UI components at runtime to suit individual preferences (for example, which columns are visible in a table), and have those changes "remembered" during the user's session or every time the user opens the application. Seeded customizations in an application means the developer can take the application and make modifications to it to suit the needs of a particular group, such as an industry or site.

Install the Schema: Download the schema zip file from OTN and install it. The cue cards use tables that are part of the Fusion Order Demo (FOD) schema.

Create a New Application: Use the Create Application wizard to create an application that uses the Fusion Web Application (ADF) template.

Create a Database Connection: Use the Create Database Connection dialog to create a connection to the schema.

Create Oracle ADF Business Components Objects: Use the Create Oracle ADF Business Components wizard to create the business components that will provide access to data and implement the business logic.

Define a Customization Layer and the Layer Values: Add customization layer values to the files CustomizationLayerValues.xml and customization.properties.

Create and Deploy a Customization Class: Create the customization class that evaluates which customization layer should be applied to the application's base definition metadata. Then deploy the customization class to a JAR and register the class in the customizable application.

Enable Seeded Customizations and Create Customizable JSF Pages: Use the Project Properties dialog to enable seeded customizations in the project. Then create JSF pages that allow customizations to be made.

Use the Customization Developer Role to Customize the Pages and a View Object: Use the Preferences - Roles dialog to switch to the Customization Developer role. Then in the Customization Context window, select the layer value before you begin implementing customizations. Run the application after making the customizations.

Run the Application in the Customization Layer: Run the customized application, switching between active layer values to see the different customized contents.

Enable User Customizations for the Duration of a Session: Use the Preferences dialog to switch to the Default role for user customizations. Use the Project Properties dialog to enable user customizations for the duration of a session.

Enable User Customizations Across Sessions: Use the Project Properties dialog to enable user customizations across sessions. Edit the adf-config.xml file to include the elements to use a repository and customization class for change persistence. Then configure the components and attributes that you want to be persisted in the repository.

Configure ADF Security and Create a User: Configure Oracle ADF Security using a wizard. Then define an application role, create a user and assign it to the role, and grant permissions to the role.

Run and Personalize the Application: Log in to the application. Then personalize the application by making changes to persistent component attributes such the table column's width and the order of columns displayed in the table.

 

Install the Schema

 

 

tell me more icon Installing the Schema

The steps and examples in the cue cards are based on tables that are part of the Fusion Order Demo (FOD) schema. This schema is also used as the database for the sample application that ships with Oracle JDeveloper 11g, as well as other collateral in this release. It will be convenient to have this schema installed, and you only need to do it once. If you have already installed the FOD schema, you can skip this step and go directly to the next card.   [ tell me more...]





  1. go to dialog or window icon Download the schema zip file from OTN. If you created the schema previously, go to the cue cards icon next cue card.
  2. Unzip the file to a convenient location (for example, c:\temp).
  3. From the File menu, choose Open . Open the workspace c:\temp\Infrastructure\Infrastructure.jws.
  4. If you are prompted to migrate the project, click Yes to confirm, then click OK.
  5. In the Application Navigator, expand the MasterBuildScript project. Under Resources double-click build.properties to open it in the editor.
  6. Set the appropriate values in the build.properties file ( jdeveloper.home, and all the jdbc.* and db.* settings). Keep all other properties set to their default values. The demo user must be named FOD.
    The relevant settings are:
    jdeveloper.home             The /jdeveloper directory where you have JDeveloper installed, for example, c:/JDeveloper_11/jdeveloper/
    jdbc.urlBase                    Base URL for your database, for example, jdbc:oracle:thin:@localhost
    jdbc.port                         Port number for your database, for example, 1521
    jdbc.sid                           Database System Identifier, for example, XE or ORCL
    db.adminUser                  Database user with admin privileges, for example, system
    db.demoUser.tablespace  Tablespace name where the FOD user will be installed, for example, USERS
  7. In the MasterBuildScript project, select the build.xml file.
  8. In the Structure window, right-click the refreshSchema target and choose Run Target "refreshSchema" .
  9. When prompted, enter the password for the database user with admin privileges.

     

    tell me more icon In the IDE

    After running the Ant task, you should see a build successful message in the JDeveloper Log window.   [ tell me more...]


 

Create a New Application

 

 

tell me more icon Creating a New Application

The JDeveloper application is the highest level in the organizational structure. It stores information about the objects you are working with, while you are creating your application. It keeps track of your projects and the environment settings.   [ tell me more...]





  1. Open the Create Application wizard [ File > New > General > Applications] .
  2. To follow along with the example, enter CustomizeApp as the application name, and oracle as the application package prefix.
  3. Select Fusion Web Application (ADF) in the Applica tion Template list, then click Finish .

     

    tell me more icon Application Templates

    Application templates provide you with a quick way to create the project structure for standard applications with the appropriate combination of technologies already specified. The new application created from the template appears in the Application Navigator already partitioned into tiered projects, with the associated technology scopes set in each project.   [ tell me more...]




     

    tell me more icon In the IDE

    When you complete the steps for creating a new application and project, the Projects panel in the Application Navigator should look like this:  [ tell me more...]


 

Create a Database Connection

 

 

tell me more icon Creating a Database Connection

You can connect to any database for which you have connection details, or install the sample schema used in the cue card examples and then establish a connection to it. If you installed the sample schema, you will be able to follow the steps in the cue cards exactly as written. If you work with your own database, you can supply your own values as needed.   [ tell me more...]





  1. Open the Create Database Connection dialog [ File > New > General > Connections > Database Connection] .
  2. Select Application Resources if it is not already selected as the Create Connection In option.
  3. Enter a name for the connection, select the connection type, and enter the username and password. To follow along with this example, use FOD for the connection name and  fod for the username.
  4. Click Test Connection to confirm that you can connect.
  5. Click OK if the connection was successful.
  6. In the Application Navigator, expand the Connections and Database nodes in the Application Resources panel to see the database objects.

     

    tell me more icon In the IDE

    When you complete the steps for creating a database connection, the Application Navigator should look similar to this when you expand the Application Resources panel. The database connection is now included as a resource for your application under the Connections | Database nodes.   [ tell me more...]


 

Create Oracle ADF Business Components

 

 

tell me more icon Creating Oracle ADF Business Component Objects

Oracle ADF Business Components is a model layer technology in the Oracle Application Development Framework (Oracle ADF). A fully-featured, XML-based framework for creating business services, ADF Business Components governs the interaction between the rest of the application and the data stored in the data source, providing validation, specific services, and other business logic.  [ tell me more...]





  1. In the Application Navigator, select the Model project and launch the Create Business Components from Tables wizard [ File > New > Business Tier > ADF Business Components > Business Components from Tables] .
  2. In the Initialize Business Components Project dialog, ensure that FOD is the currently selected database connection. Then click OK.

     

    tell me more icon Business Components Connection

    The ADF Business Components project requires a database connection that you will use to create business components from database objects. The database connection you specify will also be used by the Oracle ADF Business Components runtime to manage session facade failover and state management.  [ tell me more...]


  3. On step 1, Entity Objects, click Query to populate the A vailable list. If your schema has many tables, you may experience a short delay.
  4. Select the tables, ORDERS, ORDER_ITEMS, and PRODUCTS_BASE from the A vailable list and shuttle icon shuttle them to the Selec ted list. Click Next .

     

    tell me more icon Oracle ADF Business Components

    The Create Business Components from Tables wizard allows you to easily create a package of business domain components (entity objects, associations, and domains) from existing database objects and optionally to create a default package of data model components (view objects, view links, and an application module) from these newly generated business domain components.  [ tell me more...]


  5. On step 2, Updatable View Objects, select the business components, Orders (FOD.ORDERS) and OrderItems (FOD.ORDER_ITEMS) from the A vailable list and shuttle icon shuttle them to the Selec ted list. Then click Next .
  6. Click Next to skip step 3, Read-Only View Objects, which aren't needed.
  7. On step 4, Application Module, change the application module name to FODAppModule. Then click Finish .
  8. Click the save all icon Save All to save your work.

     

    tell me more icon In the IDE

    After completing the Create Business Components from Tables wizard, the Model project and the Data Controls panel in the Application Navigator should look similar to this:  [ tell me more...]


 

Define a Customization Layer

 

 

tell me more icon Defining a Customization Layer

A customizable application means you can take the application and make modifications to it to suit the needs of a particular group, such as an industry or site. In Oracle Application Developer Framework (ADF) applications, you can create customization classes and layers to support the customization of metadata content, and then customize the metadata within the context of a specified layer.  [ tell me more...]





  1. From the main menu, choose File then choose Open to locate and open the file CustomizationLayerValues.xml, which is found in <JDEVELOPER_HOME>/jdeveloper/jdev.
  2. In the XML editor, edit the file to add a customization layer and its configurable values. Use the sample code provided.

     

    tell me more icon Customization Layers

    In Oracle Application Developer Framework (ADF) applications, the Oracle Metadata Services (MDS) framework allows you to create customizable applications. You create customization classes and layers to support the customization of metadata content, and then customize the metadata within the context of a specified layer. In this cue card you will create a customization layer. You will create a customization class in the next cue card.   [ tell me more...]




    code sample icon Use sample code
  3. In the Application Navigator, select the Model project and open the Create File dialog [ File > New > General > File] .
  4. Enter customization.properties as the file name.
  5. In the Directory field, append src after Model (for example, <JDEVELOPER_HOME>/jdeveloper/mywork/CustomizeApp/Model/src). Then click OK.
  6. In the text editor, define the customization layer values, using the sample code provided.
    code sample icon Use sample code
  7. Click the save all icon Save All to save your work.

     

    tell me more icon In the IDE

    When you complete the steps for defining a customization layer, the Model project in the Application Navigator should look like this:   [ tell me more...]


 

 

Create and Deploy a Customization Class

 

 

tell me more icon Creating and Deploying a Customization Class

A customization class is the interface that the Oracle Metadata Services (MDS) framework uses to define which customization layer should be applied to the application's base definition metadata.   [ tell me more...]





  1. In the Application Navigator, select the Model project and open the Create Java Class dialog [ File > New > General > Java Class] .
  2. Enter SiteCC as the class name, and oracle.model.mycompany as the package name. In the Extends field, enter oracle.mds.cust.CustomizationClass. Click OK.

     

    tell me more icon Customization Classes

    A customization class is the interface that the Oracle Metadata Services (MDS) framework uses to define which customization layer should be applied to the application's base definition metadata. Each customization class corresponds to a customization layer. The customization class evaluates the current context and returns a String result. This String result is used to locate the customization layer.  [ tell me more...]


  3. In the source editor, add code to build the customization layer.
    code sample icon Use sample code
  4. In the Application Navigator, select the Model project, then click build icon Rebuild to rebuild the project. You should see a Successful compilation message in the Messages Log window.
  5. In the Application Navigator, select the Model project and open the Create Deployment Profile dialog, JAR File Page [ File > New > General > Deployment Profiles > JAR File] .
  6. Enter siteccarchive1 as the deployment profile name, and click OK.

     

    tell me more icon Deployment Profiles

    Deployment profiles are used to define the settings for archives in order to deploy a project or an application to an external server. In the example, you are creating a profile for deploying a simple archive to the file system. JDeveloper will use the deployment profile name you enter in the Create Deployment Profile dialog as the name of the generated JAR when you deploy the project.   [ tell me more...]


  7. In the Edit JAR Deployment Profile Properties dialog, JAR Options page, accept the default JAR file name in the JAR File field, but change the location of the JAR to <JDEVELOPER_HOME>jdeveloper\jdev\lib\patches< jar_file_name> .
  8. Make sure Include Manifest File is selected.
  9. Under File Groups | Project Output on the left, select Filters. In the Files tab, deselect the top node Merged Contents of This File Group's Contributors. This should deselect all the checkboxes. Expand model under oracle, then select mycompany. Click OK.
  10. In the Project Properties dialog, confirm that sitearchive1 (JAR File) is listed in the profiles, then click OK. Click the save all icon Save All to save your work.
  11. In the Application Navigator, right-click the Model project, and choose Deplo y then choose siteccarchive1. In the Deploy wizard, confirm that Deploy to JAR File is selected. Click Finish . You should see some messages followed by a Deployment Finished message in the Deployment Log window.
  12. In the Application Navigator, expand the Application Resources panel. Under Descriptors | ADF META-INF, double-click adf-config.xml to open the file in the overview editor.
  13. On the MDS Configuration page, click green plus add icon Add. In the Edit Customization Class dialog, enter sitecc then select the class SiteCC (oracle.model.mycompany). Click OK.

     

    tell me more icon Registering Customization Classes

    Be sure to select the SiteCC (oracle.model.mycompany) class in the Edit Customization Class dialog.  [ tell me more...]


  14. Click the save all icon Save All to save your work.

     

    tell me more icon In the IDE

    When you complete the steps for creating and deploying a customization class, the Application Navigator should look similar to this:  [ tell me more...]


 

 

Create Customizable JSF Pages

 

 

tell me more icon Creating Customizable JSF Pages

Before you start creating JSF pages, you will enable seeded customizations in the project. To do this, you will open the Project Properties dialog by right-clicking the ViewController project in the Application Navigator, and choosing Proj ect Properties from the context menu. In the dialog, you will select ADF View, then select the checkbox to enable seeded customizations.  [ tell me more...]





  1. In the Application Navigator, select the ViewController project and open the Project Properties dialog, ADF View page [ Application > Project Properties] . Select Enable Seeded Customizations , and click OK.

     

    tell me more icon Seeded Customizations

    Seeded customization of an application is the process of taking a generalized application and making modifications to suit the needs of a particular group, such as a specific industry or site.   [ tell me more...]


  2. In the Application Navigator, select the ViewController project and open the Create Task Flow dialog [ File > New > Web Tier > JSF > ADF Task Flow] . Enter orders-task-flow-definition.xml as the file name. Make sure Create as Bounded Task Flow is selected. Deselect Create With Pa ge Fragments , if selected. Then click OK.

     

    tell me more icon Bounded Task Flow

    An ADF task flow is a reusable unit for defining control flow between activities in an application. Each task flow in the application contains a portion of the application's navigational graph, enabling users to complete a task. For example the following illustration shows a simple task flow with two activities, Create and Confirm. The arrows between the activities are known as control flow cases. Activities could be view pages, method calls, or operations calling other task flows.   [ tell me more...]


  3. In the Component Palette, ADF Task Flow page, Components panel, click facespage icon View, then click on the blank diagram in the visual editor to add an icon to represent the first application page. Rename the page icon to Browse. In the Component Palette, click facespage icon View again, and then click the diagram to add a second page icon. Rename the second page icon to More.
  4. In the Component Palette, ADF Task Flow page, Components panel, click right green arrow Control Flow Case. On the diagram, click the Browse page icon, then click the More page icon. Rename the control flow case element to goMore.
  5. In the Component Palette, click right green arrow Control Flow Case again. On the diagram, click the More page icon, then click the Browse page icon. Rename the control flow case element to goBrowse.
  6. On the diagram, double-click the Browse page icon. In the Create JSF Page dialog, accept the default file name and location. Under Initial Page Layout and Content, select Blan k Page . Make sure Page Implementation shows UI Components are not exposed in managed bean, then click OK.
  7. In the Component Palette, ADF Faces page, Layout panel, drag and drop splitpane icon Panel Splitter on the blank page in the visual editor. In the Property Inspector, Common section, change the Orientation property value to vertical.
  8. In the Component Palette, Layout panel, drag and drop flowlayout icon Panel Group Layout into the first facet of the panel splitter component you just added. In the Property Inspector, change the Layout property value to scroll.
  9. In the Application Navigator, expand the Data Controls panel, then expand FODAppModuleDataControl. Drag and drop OrdersView1 into the panel group layout component you just added. From the Create context menu, choose Form then choose ADF Read-only Form.

     

    tell me more icon Data Controls Panel and UI Controls

    The Data Controls panel is a JDeveloper data binding tool that is part of the Application Navigator. The Data Controls panel shows the structure of your business components data model in a hierarchical display of available business objects, methods, and data control operations.  [ tell me more...]


  10. In the Edit Form Fields dialog, select all the fields except OrderId, OrderDate, OrderShippedDate, OrderStatusCode, and OrderTotal. Then click delete icon to delete the selected fields. Select both I nclude Navigation Controls and Include Submit Button , then click OK.
  11. In the visual editor, select the Submit button. In the Property Inspector, Common section, change the Text value to More Details. In the Action field, select goMore from the dropdown list.
  12. In the editor window, select the document tab orders-task-flow-definition.xml to bring the diagram forward. Double-click the More page icon. In the Create JSF Page dialog, accept the default file name and location. Under Initial Page Layout and Content, confirm that Blan k Page is selected. Make sure Page Implementation shows UI Components are not exposed in managed bean, then click OK.
  13. From the Data Controls panel, drag and drop OrdersView1 on the blank page in the visual editor. Choose Form then choose ADF Read-only Form from the Create context menu. In the Edit Form Fields dialog, click OK.
  14. In the Component Palette, Common Components panel, drag and drop button Button into af:form in the Structure window. In the Property Inspector, Common section, change the Text value to Return. In the Action field, select goBrowse from the dropdown list.
  15. In the editor window, select the document tab orders-task-flow-definition.xml to bring the diagram forward. Right-click the Browse page icon and choose R un .

     

    tell me more icon Running the Application

    By default, JDeveloper automatically configures an integrated server named Integrated WebLogic Server that references a user-specific instance of Oracle WebLogic Server bundled with the IDE. Integrated WebLogic Server is a Java EE runtime service for packaged archive deployment. Based on zero-copy deployment, Integrated WebLogic Server lets you run and test an application and its projects as a Java EE application in a Java EE container. No special connection setup is required to use Integrated WebLogic Server. You can run the entire application, a project, or individual JSF pages.  [ tell me more...]


  16. In the running application, Browse page, try browsing the order records on the abbreviated form, then navigate to the More page to see the full details of the current order.
  17. In JDeveloper, click terminate icon Terminate and choose Integrated WebLogic Server from the dropdown menu. Then close all files in the editor window.

     

    tell me more icon In the IDE

    When you complete the steps for creating customizable JSF pages, the ViewController project in the Application Navigator should look similar to this):  [ tell me more...]


 

 

Customize the JSF Pages and a View Object

 

 

tell me more icon Customizing the JSF Pages and a View Object

A customized application contains a base application and one or more layers of customized metadata content. MDS stores the customized metadata objects in a metadata repository and retrieves them at runtime to reveal the customized application. When a customized application is launched, the customized content is applied over the base application.  [ tell me more...]





  1. Open the Preferences dialog, Roles page [ Tools > Preferences > Roles] . Select Customization Developer and click OK. When prompted in the Confirm Restart dialog to restart JDeveloper, click Yes . (If prompted to migrate settings, click No .)
  2. If necessary, select CustomizeApp from the dropdown list in the Application Navigator to open your customizable application.
  3. In the Customization Context window, select Headquarters (headquarters) from the Value dropdown list of the site layer.

     

    tell me more icon Customization Context Window and Tip Layer

    You can make metadata customizations in an application only when you are working in the Customization Developer role. In that role, customization features are enabled in the IDE (for example, the Customization Context window), while some other features are disabled (for example, you cannot create new customizable objects and you cannot edit non-customizable objects).  [ tell me more...]


  4. In the Application Navigator, ViewController project, double-click Browse.jspx to open the page in the visual editor.
  5. In the Data Controls panel, expand FODAppModuleDataControl, then expand OrdersView1. Drag and drop OrderItemsView2 into the second facet on the page. From the Create context menu, choose Table then choose ADF Read-only Table. In the Edit Table Columns dialog, select S orting . Select the columns ObjectVersionId, LastUpdateDate, LastUpdatedBy, CreationDate, and CreatedBy. Then click delete icon to delete the selected columns. Click OK.

     

    tell me more icon Customizing Metadata in the View Layer

    In the example, you have customized the Browse page by adding a databound Table component to display data from the OrderItemsView view object.  [ tell me more...]


  6. In the Customization Context window, select Remote Offices (remoteoffices) from the Value dropdown list. When prompted by a message in the Customization Context Change dialog to close open files, click OK. When prompted to save customizations in modified files, click OK to save all files.
  7. In the Application Navigator, Model project, expand Application Sources | oracle.model, then double-click OrderItemsView.
  8. In the overview editor, select Entity Objects on the left. In the Available list, select ProductsBase. Then right arrow shuttle it to the Selected list.
  9. Select Attributes on the left. From the green plus icon Add dropdown menu, choose Add Attribute From Entity. In the Attributes dialog, under ProductsBase in the A vailable list, select ProductName. Then shuttleright icon shuttle it to the Selected list. Click OK, then click the save all icon Save All.

     

    tell me more icon Customizing Metadata in the Model Layer

    In the example, you have customized the model view object OrderItemsView by adding the ProductName attribute from the ProductsBase entity object.   [ tell me more...]


  10. In the Data Controls panel, click refresh icon Refresh.
  11. In the Application Navigator, ViewController project, double-click Browse.jspx to open the page in the visual editor. (Notice that you do not see the order items table below the orders form, which was added in the site/headquarters customization context.)
  12. In the Component Palette, ADF Faces page, Layout panel, drag and drop layout icon Panel Collection into the second facet on the page.
  13. In the Data Controls panel, expand FODAppModuleDataControl, then expand OrdersView1. Drag and drop OrderItemsView2 into the panel collection component you just added. From the Create context menu, choose Table then choose ADF Read-only Table. In the Edit Table Columns dialog, select S orting . Select the columns ProductId1, ObjectVersionId, LastUpdateDate, LastUpdatedBy, CreationDate, and CreatedBy. Then click delete icon to delete the selected columns. Click OK.
  14. In the Application Navigator, ViewController project, double-click More.jspx to open the page in the visual editor. In the Structure window, expand f:view | af:document, if not already expanded.
  15. In the Component Palette, Layout panel, drag header icon Show Detail Header and drop it into af:form in the Structure window.
  16. In the Structure window, drag af:panelFormLayout and drop it into af:showDetailHeader. (If necessary, collapse af:panelFormLayout before you move it.)
  17. Then drag af:showDetailHeader to reposition it before af:commandButton - Return.
  18. Click the save all icon Save All to save your work.

     

    tell me more icon In the IDE

    When you complete the steps for customizing the Browse and More pages in the site/remoteoffices context, the pages in the visual editor should look similar to these:  [ tell me more...]


 

 

Run the Application in the Customization Layer

 

 

tell me more icon Running the Application in the Customization Layer

When an application with customized metadata is run, the applicable customizations that belong to the active layer values in customization.properties are loaded from the corresponding repository and layered over the base metadata of the application to produce the desired customized contents for viewing. You do not have to switch back the Default role before you run the application.   [ tell me more...]





  1. In the Application Navigator, ViewController project, under Web Content | Page Flows, right-click orders-task-flow-definition and choose R un . The Browse page should have the order items table below the orders form; the table should not have the ProductName column. Click More Details to navigate to the complete orders form. There should not be a show detail header above the orders form.

     

    tell me more icon Customization Properties File

    If you have been following along with the example, your customization.properties file should contain the following layer values:  [ tell me more...]


  2. Click terminate icon Terminate in JDeveloper and choose CustomizeApp from the dropdown menu to stop the application.
  3. In the file system, open the file customization.properties, which is located in the /Model/src folder of your application folder (for example, C:/JDeveloper/mywork/CustomizeApp/Model/src). In the text editor, add # in front of site=headquarters. Then remove # from site=remoteoffices. Save the file.
  4. In the Application Navigator, right-click orders-task-flow-definition and choose Run again. There should be a View menu and Detach toolbar item above the order items table on the Browse page, and the table should include the ProductName column. On the More page, you should be able to hide or show the orders form by click the icon next to the header.
  5. Click terminate icon Terminate in JDeveloper and then choose IntegratedWebLogicServer from the dropdown menu.
  6. Close all files in the editor window.

     

    tell me more icon In the IDE

    When you run the application with the site=headquarters layer value active, the Browse page in your browser should look similar to this:  [ tell me more...]


 

 

Enable User Customizations For the Duration of a Session

 

 

tell me more icon Enabling User Customizations For the Duration of a Session

User customizations in an application allow end users to make changes to certain UI components at runtime to suit individual preferences (for example, which columns are visible in a table), and have those changes "remembered" during the user's session or every time the user opens the application.  [ tell me more...]





  1. Open the Preferences dialog, Roles page [ Tools > Preferences > Roles] . Select Default Role and click OK. When prompted in the Confirm Restart dialog, click Yes to restart JDeveloper. (If prompted to migrate settings, click No .)
  2. In the Application Navigator, select the ViewController project and open the Project Properties dialog, ADF View page [ Application > Project Properties] .
  3. Select E nable User Customizations , then click For Duration of Session . (Don't deselect Enable Seeded Customizations .) Click OK.

     

    tell me more icon User Customizations

    User customizations or change persistence allow end users to make changes to certain UI components at runtime to suit individual preferences (for example, the user can decide which columns are visible in a table). There are two types of user customizations:  [ tell me more...]


  4. In the Application Navigator, ViewController project, under Web Content | Page Flows, right-click orders-task-flow-definition and choose R un .
  5. In your browser, increase the width of a table column on the Browse page. Click More Details to navigate to the More page. On the More page, click Return to go back to the Browse page. The width of the column you changed should remain at the new width.

     

    tell me more icon Session Change Persistence

    Many ADF Faces components allow users to change the display of the component at runtime. For example, a user can change the position of the splitter in the Panel Splitter component or change whether or not a Show Detail or Show Detail Header component displays the children contents. By default, these changes live only as long as the page request. If the user leaves the page and then returns, the component displays in the manner it is configured by default.   [ tell me more...]


  6. Try moving a table column on the Browse page. Try hiding and showing the form on the More page. Navigate back and forth between the pages each time you make a change. All changes you make should persist during the session.
  7. Click terminate icon Terminate in JDeveloper and choose the application bound instance CustomizeApp from the dropdown menu.
  8. Rerun the application. You should not see any of the changes you made previously.
  9. Click terminate icon Terminate in JDeveloper and choose IntegratedWebLogicServer from the dropdown menu.

     

    tell me more icon In the IDE

    In the Application Navigator, ViewController project, Web Content | WEB-INF folder, double-click web.xml to open the file in the overview editor. On the Application page, expand the Context Initialization Parameters subsection. You should see that the value of CHANGE_PERSISTENCE is set to session.   [ tell me more...]


 

 

Enable User Customizations Across Sessions

 

 

tell me more icon Enabling User Customizations Across Sessions

User customizations in an application allow end users to make changes to certain UI components at runtime to suit individual preferences (for example, which columns are visible in a table), and have those changes "remembered" during the user's session or every time the user opens the application.  [ tell me more...]





  1. If you are not already in the Default role, open the Preferences dialog, Roles page [ Tools > Preferences > Roles] . Select Default Role and click OK. When prompted in the Confirm Restart dialog, click Yes to restart JDeveloper. (If prompted to migrate settings, click No .)
  2. In the Application Navigator, select the ViewController project and open the Project Properties dialog, ADF View page [ Application > Project Properties] .
  3. Select E nable User Customizations , then click Across Sessions Using MDS . (Don't deselect Enable Seeded Customizations .) Click OK.

     

    tell me more icon Change Persistence Using MDS

    User customizations or change persistence allow end users to make changes to certain UI components at runtime to suit individual preferences (for example, which columns are visible in a table). There are two types of user customizations:  [ tell me more...]


  4. In the Application Navigator, expand the Application Resources panel. Expand Descriptors | ADF META-INF, then double-click adf-config.xml to open the file in the overview editor.
  5. On the MDS Configuration page, click green plus add icon Add. In the Edit Customization Class dialog, enter usercc and select the class UserCC (oracle.adf.share.config). Click OK.
  6. In the overview editor, click View. In the Tag Configuration section, confirm that Tag Library URI shows http://xmlns.oracle.com/adf/faces/rich in the dropdown list.

     

    tell me more icon MDS Change Persistence and ADF Faces Components

    The View page, Tag Configuration section of the adf-config.xml overview editor lets you declare the components and associated attribute values that you want to be persisted in the repository without writing any code.   [ tell me more...]


  7. In the Tags section, click green plus add icon Add and choose column from the context menu.
  8. Click green plus add icon Add again and choose showDetailHeader.
  9. Click green plus add icon Add again and choose panelSplitter.
  10. Click the save all icon Save All to save your work.

     

    tell me more icon In the IDE

    When you complete the steps to configure the components and attribute values that you want to be persisted in the MDS repository, the View page in the adf-config.xml overview editor should look similar to this:  [ tell me more...]


 

 

Configure ADF Security and Create a User

 

 

tell me more icon Configuring ADF Security and Creating Users

The Oracle ADF Security framework, which is is built on top of the Oracle Platform Security Services (OPSS) architecture, is the preferred technology to provide authentication and authorization services to a Fusion web application. ADF Security implements a Java Authentication and Authorization Service (JAAS) security model. The JAAS model is policy-based since JAAS is built on the existing Java security model and integrates with any JAAS implementation. When you enable ADF Security on a Fusion web application, the application requires an explicit call to the ADF Security framework to authorize access to resources based on user-defined policies.   [ tell me more...]





  1. Launch the Configure ADF Security wizard [ Application > Secure > Configure ADF Security] . On step 1 of the wizard, ADF Security, accept the default selection of ADF Authentication and Authorization. Click Next .
  2. On step 2, Authentication Type, accept ViewController.jpr as the Web Project . Make sure HTTP B asic Authentication is selected. Click Next .

     

    tell me more icon ADF Authentication and Authorization

    Oracle ADF Security delegates authentication to the web container. The most commonly used types of authentication methods are HTTP Basic Authentication and Form-Based Authentication. Basic authentication uses the browser login dialog for the user to enter a user name and password. Note that with basic authentication, the browser caches credentials from the user, thus preventing logout. Basic authentication is useful when you want to test the application without requiring a custom login page.   [ tell me more...]


  3. On step 3, Automatic Policy Grants, make sure No Automatic Grants is selected. Click Next .
  4. On step 4, Authenticated Welcome, do not select Redirect Upon Successful Authentication . Click Finish . In the Security Infrastructure Created dialog, click OK.
  5. Open the jazn-data.xml overview editor, Application Roles page [ Application > Secure > Application Roles] . The Security Policy dropdown should show CustomizeApp. Click green plus icon Add next to Roles. In the Name field, enter BasicUserRole and press Tab.

     

    tell me more icon Security Policy and Application Roles

    In the rest of the steps in this cue card, you will use the jazn-data.xml overview editor to secure the view operation on ADF resources with Java Authentication and Authorization Service (JAAS).   [ tell me more...]


  6. Click the Users tab on the left. The Realm dropdown should show jazn.com. In the Users section, click green plus icon Add. In the Name field, enter user1 and press Tab. Enter welcome1 in the Password field, then press Tab.

     

    tell me more icon Realm and Users

    A realm is a collection of authenticated users and roles. The default realm in Oracle ADF Security is jazn.com, which is defined in jazn-data.xml. A user is an authorized end user accessing a service; it could be an individual or a software component.   [ tell me more...]


  7. Click the Application Roles tab and select the role you created earlier, BasicUserRole. On the Members page, click green plus icon Add next to Member Users and Roles and choose Add User from the context menu.
  8. In the Select Users dialog, select user1 and click OK.
  9. In the editor window, click the ADF Policies tab at the bottom. On the Task Flows page, select the application bounded task flow orders-task-flow-definition. Then click green plus icon Add next to Granted to Roles.
  10. In the Select Roles dialog, select BasicUserRole and click OK.
  11. On the Task Flows page, Actions column, make sure View is selected. Then select Customize, Grant, and Personalize.
  12. Click the save all icon Save All to save your work.

     

    tell me more icon In the IDE

    When you complete the steps for configuring ADF Security and creating a user, the ADF Policies page of the jazn-data.xml overview editor should look similar to this:  [ tell me more...]


 

 

Run and Personalize the Application

 

 

tell me more icon Running and Personalizing the Application

If you have been following along with the example so far, you have enabled user customizations across sessions and seeded customizations in the application, both of which use the MDS repository. So when you run the application, you will see the seeded customizations you made, based on the active customization layer value previously set in customization.properties.  [ tell me more...]





  1. In the Application Navigator, ViewController project, under Web Content | Page Flows, right-click orders-task-flow-definition and choose R un .
  2. When the Authentication Required dialog displays, enter the username and password as user1 and welcome1, respectively. Then click OK.
  3. On the Browse page, increase the width of the ProductName column. Then move the ProductId column to place it before the ProductName column. Move the splitter bar down. Click More Details to navigate to the More page. Hide the form contents. Then click Return to go back to the Browse page.

     

    tell me more icon Change Persistence Metadata Files

    When you make a persistent component attribute change on the Browse or More page, JDeveloper creates an XML metadata change persistence file using the page's file name, and stores the XML file in a subfolder in the mdssys/cust/user folder. For example, the XML change persistence file created for the Browse page is Browse.jspx.xml.   [ tell me more...]


  4. Stop the application, then right-click orders-task-flow-definition and choose R un again. On the Browse page, you should see all of the changes you made previously. When you navigate to the More page, the form contents should be hidden.

     

    tell me more icon In the IDE

    If you open a metadata change persistence file, you should see the elements JDeveloper created when you personalized the page at runtime. For example, if you open Browse.jspx.xml, you should see code similar to the following:   [ tell me more...]


 

 



















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

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