4 WLST Command Reference for ADF Applications

This chapter describes the WLST commands you can use to deploy, manage, and configure Oracle ADF applications to Oracle WebLogic Server.

For wsadmin commands reference for the IBM WebSphere Application Server, see Appendix B, "wsadmin Command Reference for ADF Applications."

This chapter includes the following sections:

4.1 Overview of Custom WSLT Commands for Oracle ADF

Use the ADF-based URL Connections WLST commands to navigate the hierarchy of configuration or runtime beans and control the prompt display. Use the getADFMArchiveConfig commands to manage the ADFMArchiveConfig object.

To use the custom WLST commands for Oracle ADF, you must invoke the WLST script from the Oracle Common home. For more information about other WLST commands, such as custom Metadata Services (MDS) commands, see the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

4.2 ADF-Specific WLST Commands

Use the commands in Table 4-1 for ADF applications.

Table 4-1 Browse Commands for WLST Configuration

Use this command... To... Use with WLST...

adf_createFileUrlConnection

Create a new ADF file connection.

Online or Offline

adf_createHttpUrlConnection

Create a new ADF URL connection.

Online or Offline

adf_setURLConnectionAttributes

Set or edit the attributes of a newly created or existing ADF connection.

Online or Offline

adf_listUrlConnection

List a new URL connection.

Online or Offline

getADFMArchiveConfig

Returns a handle to the ADFMArchiveConfig object for the specified archive.

Online or Offline

exportJarVersions

Export CSV format of JARs versions from current ORACLE_HOME at a specified location..

Offline

exportApplicationJarVersions

Export CSV format of JARs versions of a specified application at a specified location.

Online

exportApplicationSelectedJarVersions

Export CSV format of JARs versions from current ORACLE_HOME at a specified location in coordination with the Versions.xml file.

Online


4.2.1 adf_createFileUrlConnection

Use with WLST: Online or Offline.

4.2.1.1 Description

Use this command to creates a new connection based on the oracle.adf.model.connection.url.FileURLConnection connection class.

4.2.1.2 Syntax

adf_createFileURLConnection(appName, name, URL)
Argument Definition
appName

Application name for which the connection will be created.

name

The name of the new connection.

URL

The URL associated with this connection.


4.2.1.3 Example

adf_createFileURLConnection('myapp','tempDir','/scratch/tmp')

4.2.2 adf_createHttpUrlConnection

Use with WLST: Online or Offline.

4.2.2.1 Description

Use this command to create a new connection based on the oracle.adf.model.connection.url.HttpURLConnection connection type class.

4.2.2.2 Syntax

adf_createHttpURLConnection (appName, name, [URL], [authenticationType], [realm], [user], [password])
Argument Definition
appName

Application name for which the connection will be created.

name

The name of the new connection.

url

(Optional) The URL associated with this connection.

authenticationType

(Optional) The default is basic.

realm

(Optional) If this connection deals with authentication, then this should be set. The default is basic.

user

(Optional)

password

(Optional)


4.2.2.3 Example

adf_createHttpURLConnection('myapp','cnn','http://www.cnn.com') 

4.2.3 adf_setURLConnectionAttributes

Use with WLST: Online or Offline.

4.2.3.1 Description

Use this command to set or edit the attributes of a newly created or existing ADF connection.

4.2.3.2 Syntax

adf_setURLConnectionAttributes(appname, connectionname, attributes)
Argument Definition
appname

Application name.

connectionname

The name of the connection.

attributes

The array containing attributes to set in key/value pairs.


4.2.3.3 Example

adf_setURLConnectionAttributes ('myapp','cnn','ChallengeAuthenticationType:digest',
'AuthenticationRealm:XMLRealm'

4.2.4 adf_listUrlConnection

Use with WLST: Online or Offline.

4.2.4.1 Description

Use this command to list the connections of the application.

4.2.4.2 Syntax

adf_listURLConnection(appname)
Argument Definition
appname

Application name.


4.2.4.3 Example

adf_listURLConnection ('myapp')

4.2.5 getADFMArchiveConfig

Use with WLST: Online or Offline.

4.2.5.1 Description

Returns a handle to the ADFMArchiveConfig object for the specified archive. The returned ADFMArchiveConfig object's methods can be used to change application configuration in an archive.

The ADFMArchiveConfig object provides the following methods:

  • setDatabaseJboSQLBuilder([value]) - Sets the Database jbo.SQLBuilder attribute.

  • getDatabaseJboSQLBuilder() - Returns the current value of the jbo.SQLBuilder attribute.

  • setDatabaseJboSQLBuilderClass([value]) - Sets the Database jbo.SQLBuilderClass attribute. Value is the full name of the custom builder class.

  • getDatabaseJboSQLBuilderClass() - Returns the current value of the jbo.SQLBuilderClass attribute.

  • setDefaultRowLimit([value]) - Sets the defaults rowLimit attribute. Value is a long specifying the row limit (Default -1).

  • getDefaultRowLimit() - Returns the current value of the rowLimit attribute.

  • save([toLocation]) - If you specify the toLocation, then the changes will be stored in the target archive file and the original file will remain unchanged. Otherwise, the changes will be saved in the original file itself.

4.2.5.2 Syntax

archiveConfigObject = ADFMAdmin.getADFMArchiveConfig(fromLocation)
Argument Definition
fromLocation 

The name of the ear file, including its complete path.


The syntax for setDatabaseJboSQLBuilder([value]) is:

archiveConfigObject.setDatabaseJboSQLBuilder([value])
Argument Definition
value 

The value of the jbo.SQLBuilder attribute. Valid values are: 'Oracle' (Default), 'OLite', 'DB2', 'SQL92', 'SQLServer', or 'Custom. If 'Custom' is specified, then the jbo.SQLBuilderClass attribute should also be set.


The syntax for getDatabaseJboSQLBuilder() is:

archiveConfigObject.getDatabaseJboSQLBuilder()

The syntax for setDatabaseJboSQLBuilderClass([value]) is:

archiveConfigObject.setDatabaseJboSQLBuilderClass([value])
Argument Definition
value 

The value of the jbo.SQLBuilderClass attribute.


The syntax for getDatabaseJboSQLBuilderClass) is:

archiveConfigObject.getDatabaseJboSQLBuilderClass()

The syntax for setDefaultRowLimit([value]) is:

archiveConfigObject.setDefaultRowLimit([value])
Argument Definition
value 

The value of the rowLimit attribute.


The syntax for getDefaultRowLimit() is:

archiveConfigObject.getDefaultRowLimit([value])

The syntax for save([toLocation]) is:

archiveConfigObject.save([toLocation])
Argument Definition
toLocation 

The file name along with the absolute path to store the changes.


4.2.5.3 Example

In the following example. the jbo.SQLBuilder attribute is set to 'DB2'.

wls:/offline> archive =
               ADFMAdmin.getADFMArchiveConfig(fromLocation='/tmp/testArchive.ear')
wls:/offline> archive.setDatabaseJboSQLBuilder(value='DB2') 
wls:/offline> archive.save() 

In the following example, the jbo.SQLBuilder attribute is removed so that application default is used.

wls:/offline> archive =
              ADFMAdmin.getADFMArchiveConfig(fromLocation='/tmp/testArchive.ear')
wls:/offline> archive.setDatabaseJboSQLBuilder()
wls:/offline> archive.save(toLocation='/tmp/targetArchive.ear')

In the following example, the jbo.SQLBuilder attribute is set to 'Custom', and the jbo.SQLBuilderClass attribute is set to the class 'com.example.CustomBuilder'.

wls:/offline> archive =
              ADFMAdmin.getADFMArchiveConfig(fromLocation='/tmp/testArchive.ear')
wls:/offline> archive.setDatabaseJboSQLBuilder('Custom') 
wls:/offline> archive.setDatabaseJboSQLBuilderClass('com.example.CustomBuilder') 
wls:/offline> archive.save(toLocation='/tmp/targetArchive.ear')

In the following example, the rowLimit attribute is set to 100.

wls:/offline> archive = getADFMArchiveConfig(fromLocation='/tmp/testArchive.ear')
wls:/offline> archive.setDefaultRowLimit(100)
wls:/offline> archive.save(toLocation='/tmp/targetArchive.ear')

4.2.6 exportJarVersions

Use with WLST: Offline.

4.2.6.1 Description

Use to export CSV format of JARs versions from current ORACLE_HOME at a specified location. Exported JARs versions information can be opened in Oracle OpenOffice or MicroSoft Excel.

4.2.6.2 Syntax

exportJarVersions(path)
Argument Definition
path

Location to extract JARs versions.


4.2.6.3 Example

This example shows how JARs versions are exported to /tmp/export-MyApp-Versions.csv. R/W privileges for the CSV file need to be verified.

wls:/offline>exportJarVersions('/tmp/export-MyApp-Versions.csv')

4.2.7 exportApplicationJarVersions

Use with WLST: Online.

4.2.7.1 Description

Used to export CSV format of runtime JARs versions of a specified application at a specified location.

4.2.7.2 Syntax

exportApplicationJarVersions(applicationName, path)
Argument Definition
applicationName

Application name to export JARs versions

path

Location to export JARs versions.


4.2.7.3 Example

This example shows how MyApp runtime JARs versions are exported to /tmp/export-MyApp-Versions.csv. R/W privileges for the CSV file need to be verified.

wls:/DefaultDomain/serverConfig>exportApplicationJarVersions('MyApp',
'/tmp/export-MyApp-Versions.csv')

4.2.8 exportApplicationSelectedJarVersions

Use with WLST: Online.

4.2.8.1 Description

Used to export CSV format of JARs versions of selected JARs at a specified location.

4.2.8.2 Syntax

exportApplicationSelectedJarVersions(applicationName, path, jarsLocation)
Argument Definition
applicationName

Application name to export JARs versions.

path

Location to extract JARs versions.

jarsLocation

Optional list of selected JARs. If not specified, default JARs runtime version list from %WLSDOMAIN%/config/fmwconfig/Versions.xml will be exported.

If the selectedJars property in Versions.xml is empty, version information of adfm.jar, adf-richclient-impl-11.jar, adf-controller.jar, adf-pageflow-impl.jar, adf-share-support.jar and mdsrt.jar will be exported.


4.2.8.3 Example

This example shows how JARs versions are exported to /tmp/export-MyApp-Versions.csv using the selectedJars property of the Versions.xml file. In this case, since the jarsLocation parameter is not specified, the libraries listed in the selectedJars property of the Versions.xml file will be exported. R/W privileges for the CSV file need to be verified.

wls:/offline>exportApplicationSelectedJarVersions('MyApp',
'/tmp/export-MyApp-Versions.csv') 

Versions.xml
<Diagnostics xmlns="xmlns.oracle.com/adf/diagnostics">
  <Versions xmlns="xmlns.oracle.com/adf/diagnostics/versions"
    exportVersionsOnApplicationStartup="true" 
    selectedJars="$ORACLE_HOME$/modules/oracle.adf.model_11.1.1/adfm.jar;
      $ORACLE_HOME$/modules/oracle.adf.view_11.1.1/adf-richclient-impl-11.jar;
      $ORACLE_HOME$/modules/oracle.adf.controller_11.1.1/adf-controller.jar;
      $ORACLE_HOME$/modules/oracle.adf.pageflow_11.1.1/adf-pageflow-impl.jar;
      $ORACLE_HOME$/modules/oracle.adf.share_11.1.1/adf-share-support.jar;
      $ORACLE_HOME$/modules/oracle.mds_11.1.1/mdsrt.jar" />
</Diagnostics>

This example shows how JARs versions are exported to /tmp/export-MyApp-Versions.csv using the jarsLocation parameter. In this case, the libraries passed explicitly in the jarsLocation parameter will be exported. R/W privileges for the CSV file need to be verified.

wls:/offline>exportApplicationSelectedJarVersions('MyApp',
'/tmp/export-MyApp-Versions.csv',
'$ORACLE_HOME$/modules/oracle.adf.model_11.1.1/adfm.jar;$ORACLE_HOME$/modules/oracle.adf.view_11.1.1/adf-richclient-impl-11.jar')