Skip Headers
Oracle® Fusion Middleware Developer's Guide for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)

Part Number E10148-20
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

63 Creating Portlets with OmniPortlet

OmniPortlet is a data publishing portlet that you add to your application at design time, and customize at runtime. It provides a runtime, wizard-based experience to allow page designers to publish data from a variety of data sources, including SQL, XML, web services, spreadsheets, and web pages to several different layouts, such as customizable charts and tables.

This chapter covers the information you may find useful if you are planning to use OmniPortlet in your Oracle JDeveloper environment. For information on how to use the OmniPortlet wizard, refer to Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

This chapter includes the following sections:

For information about registering OmniPortlet, see Section 62.3, "Registering an Oracle PDK-Java Portlet Producer with a WebCenter Portal: Framework Application."

Note:

You can find more information about developing different types of portlets and information about producers and other portlet technologies in Chapter 57, "Introduction to Portlets."

63.1 Introduction to OmniPortlet

OmniPortlet is a subcomponent of Oracle WebCenter Framework that enables developers to easily publish data from various data sources using a variety of layouts without writing any code. You can base an OmniPortlet on almost any kind of data source, such as a web service, a SQL database, spreadsheet (character-separated values), XML, and even application data from an existing web page. Figure 63-1 shows an example of a portlet created using OmniPortlet.

Figure 63-1 Example of an OmniPortlet

Description of Figure 63-1 follows
Description of "Figure 63-1 Example of an OmniPortlet"

OmniPortlet enables the WebCenter Portal: Framework application developer and component developer to do the following:

To display personalized data, you can refine the retrieved data by filtering the results returned from a data source, and parameterize the credential information used to access secure data. Out of the box, OmniPortlet provides the most common layout for portlets: tabular, chart, HTML, news, bulleted list, and form.

63.2 Adding OmniPortlet to Your Application

As described in Chapter 62, "Consuming Portlets," you can add an OmniPortlet to a page created through Oracle JDeveloper. OmniPortlet is included in the Integrated WebLogic Server (Integrated WLS) that is installed with Oracle JDeveloper. After you start the Integrated WLS, you can register the OmniPortlet producer by using the Register Oracle PDK-Java Producer wizard. When this producer is registered, the portlets become available on the Oracle JDeveloper Resource Palette or in the Application Resources panel. For example, if you register the OmniPortlet producer as "OmniProducer," OmniPortlet displays in your IDE Connections list in the Resource Palette, as shown in Figure 63-2.

Figure 63-2 OmniPortlet in the Resource Palette

Description of Figure 63-2 follows
Description of "Figure 63-2 OmniPortlet in the Resource Palette"

Note:

For more information about:

After you register the portlet producer, you can simply drag OmniPortlet onto your *.jspx page.

Note:

When you add an instance of OmniPortlet onto your page in Oracle JDeveloper, open the Property Inspector for the portlet and ensure that the AllModesSharedScreen and RenderPortletInIFrame properties are set as follows:

  • AllModesSharedScreen is set to False to display the Customize and Personalize in full page size.

  • RenderPortletInIFrame is set to True to display the OmniPortlet in its own inline frame (IFRAME) in the View mode.

For information on configuring OmniPortlet in Oracle JDeveloper, refer to Section 63.4, "OmniPortlet Configuration Tips."

63.3 Customizing OmniPortlet

After you add an OmniPortlet to your application at design time, you can customize the content, layout, and other options, by running your application to a browser. This section provides a high-level introduction to the runtime customization experience. For more detailed information on using and customizing this portlet, refer to Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

Note:

For more information about configuring OmniPortlet, see Appendix 63, "OmniPortlet Configuration Tips."

The OmniPortlet wizard initially contains five steps. When you first define your OmniPortlet, you set the data source type, data source options, filter options, view options, and layout. When you have completed these steps of the wizard, you can reenter the wizard by clicking the Customize link for the portlet. When you reenter the wizard, you can change the definitions on the Source, Filter, View, and Layout tabs.

Note:

On the IBM Linux on Power platform, if the action buttons (Next, Previous, Finish, and Cancel) are minimized to dots when defining the OmniPortlet, increase the stack size shell limit to unlimited and restart the WLS_portlet instance. Run the following command to set the stack size shell limit to unlimited: prompt> ulimit -s unlimited.

You can use several different data sources with OmniPortlet:

For more information on using these data sources with OmniPortlet, refer to the Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

63.4 OmniPortlet Configuration Tips

This section contains configuration information for OmniPortlet. To learn more about the OmniPortlet wizard, see Chapter 63, "Creating Portlets with OmniPortlet." This section contains configuration information for the following areas:

63.4.1 Configuring the OmniPortlet Producer to Access Data Outside a Firewall

If the OmniPortlet producer is inside your firewall, then you must configure the proxy information so that OmniPortlet can access URLs of data (such as CSV, XML, or web services) located outside the firewall. To do so, you can either set the proxy information in the command line when you start your WebLogic server. Or, you can set up the proxy information in OmniPortlet's provider.xml file, located here: OmniPortlet_WAR_DIR/WEB-INF/providers/omniPortlet/provider.xml.

Note:

For the Web Service data source, you must set the proxy information in both the provider.xml file and using the command line parameters.

  • To set the proxy information in the command line when starting the WebLogic server, set the parameters as described in Table 63-1, if you are using an HTTP Proxy Host, or Table 63-2, if you are using an HTTPS Proxy Host.

    Table 63-1 HTTP Proxy Information Command Line Parameters

    Parameter Description

    http.proxyHost

    The host name of a proxy server if one is required to make a URL connection from the OmniPortlet producer to its data sources.

    http.proxyPort

    The port number for the HTTP Proxy Host.

    http.nonProxyHosts

    The name of any domain or hosts to which you can directly connect, bypassing a proxy server, such as your local machine:

    localhost|localhost.localdomain

    Hosts can be fully qualified host names or can be IP addresses.

    http.proxyUser

    The user to log in to the proxy server if the proxy server requires authentication.

    http.proxyPassword

    The password to log in to the proxy server if the proxy server requires authentication.

    http.proxyAuthType

    The authentication type of the proxy server. Acceptable values: Basic | Digest.

    http.proxyAuthRealm

    The name of the realm of the proxy server. If you do not know the name of the realm, contact the proxy server administrator.


    Table 63-2 HTTPS Proxy Information Command Line Parameters

    Parameter Description

    https.proxyHost

    The host name of a proxy server if one is required to make a URL connection from the OmniPortlet producer to its data sources.

    https.proxyPort

    The port number for the HTTPS Proxy Host.

    https.nonProxyHosts

    The name of any domain or hosts to which you can directly connect, bypassing a proxy server, such as your local machine:

    localhost|localhost.localdomain

    Hosts can be fully qualified host names or can be IP addresses.

    https.proxyUser

    The user to log in to the proxy server if the proxy server requires authentication.

    https.proxyPassword

    The password to log in to the proxy server if the proxy server requires authentication.

    https.proxyAuthType

    The authentication type of the proxy server. Acceptable values: Basic | Digest.

    https.proxyAuthRealm

    The name of the realm of the proxy server. If you do not know the name of the realm, contact the proxy server administrator.


    The following are examples of three parameters and their values:

    -Dhttps.proxyHost=myProxyServer.mycompany.com
    -Dhttps.proxyPort=80
    -Dhttps.nonProxyHosts=localhost|localhost.localdomain|127.0.0.1|
    
  • To configure the proxy information in the provider.xml file, see Table 63-3 for a list of parameters and their descriptions.

    Table 63-3 Provider.xml Tags

    Parameter Description

    httpProxyHost

    Enter the host name of a proxy server if one is required to make a URL connection from the OmniPortlet producer to its data sources.

    httpProxyPort

    Enter the port number for the HTTP Proxy Host.

    dontProxyFor

    Enter the name of any domain or hosts to which you can directly connect, bypassing a proxy server. Domain names are the part of a URL that contain the names of a business, or organization, or government agency, for example:

    *.company.com, *.us.company.com

    Hosts can be fully qualified host names or can be IP addresses.

    proxyUseAuth

    Acceptable values: true | false

    Enter true if your proxy server requires authentication. The authentication parameters are specified by the following tags: proxyType, proxyRealm, proxyUseGlobal, proxyUserName, and proxyPassword.

    proxyType

    Acceptable values: Basic | Digest

    Choose the type of proxy server this provider.

    For more information about basic or digest authentication, see http://www.faqs.org/rfcs/rfc2617.html.

    proxyRealm

    Enter the name of the realm of the proxy server that is accessed by the user according to the login information described later in the table. If you do not know the name of the realm, then contact the administrator of the proxy server.

    proxyUseGlobal

    Acceptable values: true | false

    If true, then the <proxyUser> and <proxyPassword> values are used for all users. Users do not see the Proxy Authentication section on the Source tab and Personalize page. If false, then page designer must log in using the Proxy Authentication section on the Source tab when they define the portlet. The end user must log in using the Proxy Authentication section on the Personalize screen. If <proxyUsername> and <proxyPassword> are given, then they are only used for public users.

    proxyUserName

    Enter the user name to log in to the proxy server.

    ProxyPassword

    Enter the password for the specified user name. You must prefix ! before your plain password text. It is then encrypted in the provider.xml file for protection when the producer starts.


    The following is a basic example of using a proxy to access data outside a firewall:

    <proxyInfo class="oracle.portal.provider.v2.ProxyInformation">
    <httpProxyHost>www-proxy.example.com</httpProxyHost>
    <httpProxyPort>80</httpProxyPort>
    <proxyUseAuth>false</proxyUseAuth>
    </proxyInfo>
     
    

    The following example requires a login and basic authentication for all users for the proxy server:

    <proxyInfo class="mycompany.portal.provider.v2.ProxyInformation">
    <httpProxyHost>myport.example.com</httpProxyHost>
    <httpProxyPort>8080</httpProxyPort>
    <proxyUseAuth>true</proxyUseAuth>
    <proxyType>Basic</proxyType>
    <proxyRealm>myport</proxyRealm>
    <proxyUseGlobal>false</proxyUseGlobal>
    </proxyInfo>
    

63.4.2 Configuring the OmniPortlet Producer to Access Other Relational Databases

The OmniPortlet SQL data source is preconfigured to access Oracle databases using the Oracle JDBC drivers, and ODBC data sources using Sun Microsystem's JDBC-ODBC driver. Oracle allows developers to access other relational databases using DataDirect JDBC drivers.

See Also:

For a list of supported databases, Certification Matrix for Oracle Application Server and DataDirect JDBC available on the Oracle Technology Network (http://www.oracle.com/technetwork/index.html).

This section contains the following steps:

63.4.2.1 Installing DataDirect JDBC Drivers

The following DataDirect JDBC drivers are included with the WebLogic Server installation:

  • YMutil.jar

  • YMsybase.jar

  • YMsqlserver.jar

  • YMspy.jar

  • YMinformix.jar

  • YMdb2.jar

  • YMbase.jar

If you do not plan to use these DataDirect drivers, you can instead download DataDirect JDBC drivers to access the desired database. These drivers are packaged in a single ZIP, which you can download from the following location:

http://www.oracle.com/technetwork/topics/datadirect-index-091847.html

To install DataDirect JDBC drivers:

  1. Unzip the contents of the ZIP file into a temporary directory, for example /temp/datadirect.

  2. Copy the DataDirect JDBC drivers from the temporary directory to your WebLogic Server directory: WLS_DOMAIN_DIRECTORY/lib.

63.4.2.2 Registering DataDirect Drivers in OmniPortlet

OmniPortlet is implemented as a Web producer and all the configuration properties are stored in the provider.xml file. To use DataDirect JDBC drivers with OmniPortlet, you must register these drivers in the provider.xml file.

To register the new DataDirect JDBC drivers:

  1. Back up the file, OmniPortlet_WAR_DIRECTORY/WEB-INF/providers/omniPortlet/provider.xml, and then open the file.

  2. Add the drivers to use for the SQL data source configuration entry:

    1. Search for the XML tag, driverInfo.

    2. Add a new entry after the last driverInfo tag.

    The following are examples of the driverInfo for WebLogic DataDirect drivers:

    • Microsoft SQL Server (default connection):

      <driverInfo class="oracle.webdb.reformlet.data.jdbc.JDBCDriverInfo">
        <name>Microsoft SQL Server</name>
        <sourceDataBase>other</sourceDataBase>
        <subProtocol>weblogic:sqlserver</subProtocol>
        <connectString>mainProtocol:subProtocol://databaseName</connectString>
        <driverClassName>weblogic.jdbc.sqlserver.SQLServerDriver
        </driverClassName>
        <dataSourceClassName>weblogic.jdbcx.sqlserver.SQLServerDataSource
        </dataSourceClassName>
        <connHandlerClass>oracle.webdb.reformlet.data.jdbc.JDBCConnectionHandler
        </connHandlerClass>
        <connPoolSize>5</connPoolSize>
        <loginTimeOut>30</loginTimeOut>
      </driverInfo>
      
    • Microsoft SQL Server (named connection, for example, mycompany.com:port;databaseName=mydb):

      <driverInfo class="oracle.webdb.reformlet.data.jdbc.JDBCDriverInfo"> 
        <name>Microsoft SQL Server</name> 
        <sourceDataBase>other</sourceDataBase> 
        <subProtocol>weblogic:sqlserver</subProtocol> 
        <connectString>mainProtocol:subProtocol://databaseName</connectString> 
        <driverClassName>weblogic.jdbc.sqlserver.SQLServerDriver
        </driverClassName> 
        <connHandlerClass>
        oracle.webdb.reformlet.data.jdbc.JDBCODBCConnectionHandler 
        </connHandlerClass> 
        <connPoolSize>5</connPoolSize> 
        <loginTimeOut>60</loginTimeOut> 
      </driverInfo>
      
    • Sybase:

      <driverInfo class="oracle.webdb.reformlet.data.jdbc.JDBCDriverInfo">
        <name>Sybase</name>
        <sourceDataBase>other</sourceDataBase>
        <subProtocol>weblogic:sybase</subProtocol>
        <connectString>mainProtocol:subProtocol://databaseName</connectString>
        <driverClassName>weblogic.jdbc.sybase.SybaseDriver
        </driverClassName>
        <connHandlerClass>
        oracle.webdb.reformlet.data.jdbc.JDBCODBCConnectionHandler
        </connHandlerClass>
        <connPoolSize>5</connPoolSize>
        <loginTimeOut>30</loginTimeOut>
      </driverInfo>
      
    • DB2:

      <driverInfo class="oracle.webdb.reformlet.data.jdbc.JDBCDriverInfo">
        <name>DB2</name>
        <sourceDataBase>other</sourceDataBase>
        <subProtocol>weblogic:db2</subProtocol>
        <connectString>mainProtocol:subProtocol://databaseName</connectString>
        <driverClassName>weblogic.jdbc.db2.DB2Driver
        </driverClassName>
        <connHandlerClass>
        oracle.webdb.reformlet.data.jdbc.JDBCODBCConnectionHandler
        </connHandlerClass>
        <connPoolSize>5</connPoolSize>
        <loginTimeOut>30</loginTimeOut>
      </driverInfo>
      
    • Informix:

      <driverInfo class="oracle.webdb.reformlet.data.jdbc.JDBCDriverInfo">
        <name>Informix</name>
        <sourceDataBase>other</sourceDataBase>
        <subProtocol>weblogic:informix</subProtocol>
        <connectString>mainProtocol:subProtocol://databaseName</connectString>
        <driverClassName>weblogic.jdbc.informix.InformixDriver
        </driverClassName>
        <connHandlerClass>
        oracle.webdb.reformlet.data.jdbc.JDBCODBCConnectionHandler
        </connHandlerClass>
        <connPoolSize>5</connPoolSize>
        <loginTimeOut>30</loginTimeOut>
      </driverInfo>
      

    Table 63-4 describes the parameters in the driverInfo property.

    Table 63-4 Parameters in the driverInfo Property

    Parameter Description

    name

    Name of the database you want to use. This name is used on the Source tab of the OmniPortlet wizard.

    sourceDataBase

    Internal value. Set the value to other.

    subProtocol

    JDBC subprotocol name used by OmniPortlet to create the connection string, for example sqlserver, sybase, or db2.To get the list of subprotocol names, see the DataDirect JDBC driver documentation using the links provided at the end of this section.

    connectString

    Description of the connect string format. For DataDirect drivers, the format is: mainProtocol:subProtocol://databaseName

    driverClassName

    Name of the driver class. To get the different values, see the DataDirect JDBC driver documentation using the links provided at the end of this section.

    dataSourceClassName

    Name of the data source class that implements connection pooling. This parameter is only available in OmniPortlet version 9.0.4.1 or later. See Table 63-5 for the right data source class name for your driver.

    connHandlerClass

    Class used by OmniPortlet to manage the driver and connection pooling. The value is either of the following:

    • For OmniPortlet version 9.0.4.1 or later:

      oracle.webdb.reformlet.data.jdbc.JDBCConnectionHandler

    • For OmniPortlet versions before 9.0.4.1:

      oracle.webdb.reformlet.data.jdbc.JDBCODBCConnectionHandler

    connPoolSize

    Minimum number of connections that are opened by the connection pool.

    loginTimeOut

    Maximum time, in seconds, that this data source waits while attempting to connect to a database.


    Table 63-5 lists the values for the driverClassName and dataSourceClassName properties for specific DataDirect JDBC drivers.

    Table 63-5 Parameters and Values for driverClassName and dataSourceClassName

    DataDirect Drivers Supported Properties

    Microsoft SQL Server

    Parameter: driverClassName

    Value: weblogic.jdbc.sqlserver.SQLServerDriver

    Sybase

    Parameter: driverClassName

    Value: weblogic.jdbc.sybase.SybaseDriver

    DB2

    Parameter: driverClassName

    Value: weblogic.jdbc.db2.DB2Driver

    Informix

    Parameter: driverClassName

    Value: weblogic.jdbc.informix.InformixDriver


  3. Save the provider.xml file.

  4. Stop and start the Oracle WebLogic Managed Server instance where your portlet producer was deployed.

    To do so, navigate to FMW_HOME/user_projects/domains/wc_Domain/bin then issue the following command:

    ./startManagedWebLogic.sh WC_Portlet
    

    Note:

    If you are using OmniPortlet in a multiple nodes configuration, for example, in a clustering or load-balancing environment, then you must manually copy the provider.xml file on each node.

See Also:

For more information about how to use DataDirect JDBC drivers, see Chapter 63, "Creating Portlets with OmniPortlet."

63.4.3 Configuring Portal Tools and Web Producers (Optional)

To ensure that the OmniPortlet producer, locally built, and custom built Web producers work properly in the middle-tier environment, some additional configuration may be needed. If OmniPortlet or any other web producers have customizations in the file system, then PDK-Java provides a Preference Store Migration/Upgrade Utility that you can use to migrate the existing customizations to the database and upgrade customizations from earlier releases. See Section 60.3.8.2, "Migrating a PDK-Java Producer Persistence Store" for more information about the PDK Preference Store Migration Utility.

Configuring Portal Tools Producers in the Multiple Middle-Tier Environment

By default, the OmniPortlet producer uses the Database Preference Store. It can work in a multiple middle-tier environment without additional configuration.

You can find more information about configuring the database Preference Store in Section 60.3.8.2, "Migrating a PDK-Java Producer Persistence Store."

  1. If you have created an OmniPortlet instance with customizations in the file system, then you must migrate these customizations to the database using the Preference Store Migration Utility.

    To run the migration utility:

    1. Navigate to the WebCenter Portal Oracle home directory using the following command:

      cd WC_ORACLE_HOME
      
    2. Run the following command to migrate OmniPortlet data from a file-based Preference Store (FilePreferenceStore) to the database Preference Store (DBPreferenceStore):

      java -classpath lib/dms.jar:jdbc/lib/ojdbc14dms.jar:portal/jlib/pdkjava.jar:portal/jlib/
      ptlshare.jar oracle.portal.provider.v2.preference.MigrationTool -mode 
      filetodb -pref1UseHashing true -pref1RootDirectory portal/portletdata/tools/omniPortlet 
      -pref2User User_Name -pref2Password User_Password -pref2URL 
      jdbc:oracle:thin:@infra.host.com:1521:orcl
      

    See Section 60.3.8.2, "Migrating a PDK-Java Producer Persistence Store" for more information about the PDK Preference Store Migration Utility.

  2. Typically, you perform the HTTP Proxy configuration for OmniPortlet and Web Clipping before you configure the Load Balancing Router (LBR). To do it after the LBR is configured, perform the following steps:

    1. The Portal Tools configuration information is stored in the provider.xml file on the middle-tier server. You must update the configuration directly on one middle tier (for example, M1) and then propagate it across all middle tiers front-ended by the LBR. You must first shut down all middle tiers except M1.

    2. You can change the HTTP Proxy settings in the provider.xml file. For more information, see Section 63.4.1, "Configuring the OmniPortlet Producer to Access Data Outside a Firewall."

    3. Propagate the changes made to the provider.xml file to middle tier M2:

      • Copy OmniPortlet_WAR_DIR/WEB-INF/providers/omniPortlet/provider.xml from M1 to M2.

      • Copy WebClipping_WAR_DIR/WEB-INF/providers/webClipping/provider.xml from M1 to M2.

  3. Restart middle tier M2.

  4. Update portlet producer registration in your Framework application. Change the first part of the producer registration URL from http://m1.abc.com:7777/ to http://lbr.abc.com/.

  5. Verify that the OmniPortlet and Web Clipping producers work properly through the LBR, by going to the test pages at the following URLs:

    • OmniPortlet Producer: http://lbr.abc.com/portalTools/omniPortlet/producers/omniPortlet

      If you see the "No Portlets Available" message under the Portlet Information section in the OmniPortlet Producer test page, then you may not have configured OmniPortlet correctly in Step 1. If OmniPortlet is configured correctly, then the OmniPortlet and Simple Parameter Form portlets are available on the test page.

    • Web Clipping Producer: http://lbr.abc.com/portalTools/webClipping/producers/webClipping

    Note:

    To use the Web Clipping portlet or the Web Page Data Source for OmniPortlet, you must also enable session binding in Oracle Web Cache.

63.5 Troubleshooting OmniPortlet Problems

This section provides information to help you troubleshoot problems you may encounter while using OmniPortlet.

Note:

As the OmniPortlet producer exists and executes in a tier different from the Framework application and does not have access to the session information, you must expose XML files as PUBLIC in order for OmniPortlet to access them.

Cannot Define OmniPortlet Using the Define Link

You are not able to define the OmniPortlet at runtime.

Problem

OmniPortlet only supports a RenderPortletInIFrame value of true, meaning that OmniPortlet must be rendered within an IFRAME. Therefore, the OmniPortlet property, RenderPortletInIFrame, must be set to true. In the Property Inspector, the RenderPortletInIFrame property is available under Display Options.

Currently, the RenderPortletInIFrame property has a value of false. Consequently, when you click the Define link at runtime, the Type tab may not display and you cannot proceed with defining the OmniPortlet.

Solution

You can choose Customize from the Action list to define OmniPortlet, or select the OmniPortlet in the Structure window in Oracle JDeveloper, and in the Property Inspector, set RenderPortletInIFrame to true.