When you click the link, that value is passed to the Parameter portlet on its page

7-28 Oracle Fusion Middleware Developers Guide for Oracle Portal For example: ■ Provider service specific names should be of the form: {company}{component name}{provider name}{variable name} ■ Shared names should be of the form: {company}{component name}{provider name}global where: ■ {company} is the name of the company owning the application. ■ {component name} is the name of the application or component with which the provider is associated. ■ {provider name} is the service name of the provider. ■ {variable name} is the name of the variable itself. As you can see, these naming conventions are similar to those used for Java packages. This approach minimizes the chance of name collisions between applications or application components. PDK-Java provides utilities that allow you to retrieve variables in this form without hard coding the service name of the provider into your servlets or JSPs. The service name need only be defined in the providers WAR file. Refer to Section 7.2.4.3, Retrieving JNDI Variables for more information on retrieving JNDI variables.

7.2.4.1.3 Examples The following examples illustrate provider variable names:

oracleportalmyProvidermyDeploymentProperty oracleportalmyprovidermyPropertiesmyProperty The following example illustrates non-provider variable names: oracleportalmyOtherProperty

7.2.4.2 Setting JNDI Variable Values

In your provider deployment, you may want to set a new value for some or all of your JNDI variables. You can perform this task by setting the values manually in a Oracle WebLogic Server deployment plan as follows:

1. Go to the provider deployment in the Oracle WebLogic Administration Console,

and create a new Deployment Plan if one hasnt been set against it.

2. Edit the Deployment Plan XML file. For each deployment property you want to

set, add the following variable definition directly under the deployment-plan tag: variable-definition variable namejndi_var_defname valuefalsevalue variable variable-definition Note: If you use the EnvLookup method, you must use oracleportalproviderserviceproperty. You cannot substitute your own company name or component in this case. Enhancing Java Portlets 7-29 3. To tie this variable definition to and actual JNDI variable that you want to set, do the following for each property under the WEB-INFweb.xml module descriptor oracleportalsamplerootDirectory is used as an example: module-descriptor external=false root-elementweb-approot-element uriWEB-INFweb.xmluri variable-assignment namejndi_var_defname xpathweb-appenv-entry[env-entry-name=quot;oracleportalsamplerootDirect oryquot;]env-entry-valuexpath variable-assignment module-descriptor 4. Save the file. 5. Select Update on the provider deployment to apply the Deployment Plan for the new settings to take effect.

7.2.4.3 Retrieving JNDI Variables

JNDI is a standard J2EE technology. As such, you can access JNDI variables through J2EE APIs. For example: String myVarName = oracleportalmyProvidermyVar String myVar = null; try { InitialContext ic = new InitialContext; myVar = Stringic.lookupjava:env + myVarName; } catchNamingException ne { exception handling logic } In addition to the basic J2EE APIs, PDK-Java includes a simple utility class for retrieving the values of variables defined and used by the PDK itself. These variables all conform to the naming convention described in Section 7.2.4.1.2, Variable Naming Conventions and are of the form: oracleportalprovider_service_namevariable_name oracleportalvariable_name To use these APIs, you need only provide the provider_service_name and the variable_name . The utilities construct the full JNDI variable name, based on the information you provide, and look up the variable using code similar to that shown earlier and return the value of the variable. The EnvLookup class oracle.portal.utils.EnvLookup provides two lookup methods. One retrieves provider variables and the other retrieves non-provider variables. Both methods return a java.lang.Object, which can be cast to the Java type you are expecting. The following code example illustrates the retrieval of a provider variable: EnvLookup el = new EnvLookup; String s = Stringel.lookupmyProviderName, myVariableName; myProviderName represents the service name for your provider, which makes up part of the variable name. myVariableName represents the portion of the variable