Creating the Input XML File

8-6 Oracle Fusion Middleware Developers Guide for Oracle Portal callGetPortlet Indicates whether the portal can use the portlet record data stored in the Portlet Metadata Repository PMR instead of contacting the provider for the portlet record. If the portlet record specified by provider id, portlet id, and language returned by a provider does not change, then the provider should set the value for call_get_portlet to false. This tells the portal to use the PMR instead of making calls to the providers get_portlet and get_portlet_list functions. An example of when a provider would not want the portal to use portlet metadata from the PMR is when the value of the portlet records is different for logged on users. The default value is true. Boolean acceptContentType Specifies a comma-delimited list of content types that the portlet can produce. For example, if a portlet can produce content of both HTML and MOBILEXML type, then the tag value is: texthtml,textvnd.oracle.mobilexml string hasShowLinkMode Indicates whether the portlet implements the Link mode. If the value is false, the portlet uses its short or full title to display a link label that references the portlet content in a mobile device. Otherwise, a personalized link can be generated in the portlet code. The default value is false. Boolean mobileOnly Indicates whether the portlet is available only to mobile devices. The default value is false. Boolean preferenceStorePath Specifies the base preference store path where the provider has stored the portlet personalization information. This path is used when exporting portlets. string createdOn Defines the portlet creation date. The default value is sysdate. date createdBy Identifies the user who created the portlet record. string lastUpdatedOn Defines the most recent date on which the portlet record was changed. The default value is sysdate. date lastUpdatedBy Identifies the user who most recently changed the portlet record. string passAllUrlParams Indicates parameter passing behavior in the portlet. If the tag value is true, then Oracle Portal passes all parameters in the URL to the portlet. If the tag value is false, then the portlet receives only those parameters that are intended for the portlet. The default value is true. Boolean cacheLevel Indicates a portlets cache level. It can take one of the following values: wwpro_api_provider.CACHE_LEVEL_SYSTEM wwpro_api_provider.CACHE_LEVEL_USER string rewriteUrls Indicates whether or not URL rewriting will be performed on the output from a portlet render request. The default value is false. Boolean Table 8–3 Cont. XML Tags for PLSQL Generator Input XML Tag Definition Value Type Creating PLSQL Portlets 8-7 Following is a sample of the input XML for the PLSQL Generator. Mandatory information is shown in bold. -- This is a sample provider.xml file for the PLSQL Generator 1.2 -- provider portlet id1id nameTest_Portletname titleTest Portlet Titletitle shortTitleShort portlet titleshortTitle descriptionThis is a Test portletdescription timeout30timeout timeoutMsgTest Portlet Timed OuttimeoutMsg showEdittrueshowEdit showEditDefaulttrueshowEditDefault showDetailstrueshowDetails showPreviewtrueshowPreview hasHelptruehasHelp hasAbouttruehasAbout languageenlanguage contentTypewwpro_api_provider.CONTENT_TYPE_HTMLcontentType apiVersionwwpro_api_provider.API_VERSION_1apiVersion callIsRunnabletruecallIsRunnable callGetPortlettruecallGetPortlet acceptContentTypetexthtmlacceptContentType hasShowLinkModefalsehasShowLinkMode mobileOnlyfalsemobileOnly passAllUrlParamstruepassAllUrlParams cacheLevelwwpro_api_provider.CACHE_LEVEL_USERcacheLevel rewriteUrlstruerewriteUrls portlet provider

8.2.2 Running the PLSQL Generator

After you have created a valid XML input file, you can run the PLSQL Generator to generate the provider and portlet packages in the form of a SQL file as follows: 1. If you have not already done so, install the PLSQL Generator according to the instructions that came with the download. 2. From your browser, go to the URL for the PLSQL Generator. It should look something like the page shown in Figure 8–1 . 8-8 Oracle Fusion Middleware Developers Guide for Oracle Portal Figure 8–1 PLSQL Generator Page

3. Click Browse and select the source XML file for the Source XML File field. Refer

to Section 8.2.1, Creating the Input XML File for more information on creating the XML file.

4. In the Provider Name field, enter the name of the provider. The provider name

must not contain any spaces. The generator uses the value entered in this field for the provider package name.

5. Click Generate to generate the SQL file that contains the installable PLSQL code

for the provider and portlet packages. When the browser prompts you to save or open the file, choose Save. 6. In the Save dialog box, change the file extension to .sql and revise the file name as you wish. 7. Save the file.

8.2.3 Publishing the Generated PLSQL Portlet

After you have run the PLSQL Generator and obtained a SQL file, you still need to perform the following tasks to make the provider and portlets available to Oracle Portal: ■ Section 8.2.3.1, Installing the Packages in the Database ■ Section 8.2.3.2, Registering the Database Provider ■ Section 8.2.3.3, Adding Your Portlet to a Page

8.2.3.1 Installing the Packages in the Database

To install the generated provider and portlet packages into the database where you installed Oracle Portal, perform the following steps: 1. Start a SQLPlus session and log in to the PORTAL schema. 2. Create a new database schema, the provider schema, to store the generated provider and portlet packages by entering the following commands in SQLPlus: Creating PLSQL Portlets 8-9 create user provider_schema identified by provider_schema_password; grant resource, connect to provider_schema; 3. Grant the EXECUTE privilege for the Oracle Portal APIs to the provider schema by running the provsyns.sql script that is located in the ORACLE_ HOMEportaladminplsqlwwc directory as follows: provsyns.sql provider_schema 4. Log in to the provider schema and run the generated SQL file. It will create the provider and portlet packages in the database.

8.2.3.2 Registering the Database Provider

After creating the provider and portlet packages in the database, you must register the provider with Oracle Portal before adding the PLSQL portlet to a portal page, by performing the following steps: 1. Log in to Oracle Portal as an administrator.

2. From the Portal Builder, click the Administer tab then the Portlets tab.

3. In the Remote Providers portlet, click Register a Provider.

4. Fill in the Name, Display Name, Timeout, and Timeout Message as desired.

5. From the Implementation Style, list choose Database.

6. Click Next and complete the remainder of the wizard.

7. When you complete the wizard, click Finish.

8. From the Portlet Repository portlet, click Display Portlet Repository.

9. Browse the repository and find the provider that you just registered. Typically, new providers appear in the Portlet Staging Area of the repository. 10. Once you find the provider, confirm that it contains all of the portlets you created in the provider. If the provider or its portlets do not appear, then retrace the steps in this section and the preceding sections Section 8.2.3.1, Installing the Packages in the Database , Section 8.2.1, Creating the Input XML File , and Section 8.2.2, Running the PLSQL Generator