Skip Headers
Oracle® Fusion Middleware WebLogic Scripting Tool Command Reference
11g Release 1 (10.3.5)
E13813-10
  Go To Documentation Library
Library
Go To Product List
Product
Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

8 Metadata Services (MDS) Custom WLST Commands

Use the Oracle Metadata Services (MDS) commands in the categories listed in Table 8-1 to manage MDS.

For additional details about creating and managing an MDS repository, see the chapter "Managing the Oracle Metadata Repository" in the Oracle Fusion Middleware Administrator's Guide. For information about the roles needed to perform each operation, see "Understanding MDS Operations" in the Oracle Fusion Middleware Administrator's Guide.


Note:

To use these MDS custom WLST commands, you must invoke the WLST script from the Oracle Common home. See "Using Custom WLST Commands" in the Oracle Fusion Middleware Administrator's Guide.

Table 8-1 MDS Command Categories

Command category Description

Repository Management Commands


Manage the MDS repository.

Application Metadata Management Commands


Manage the application metadata in the MDS repository.

Sandbox Metadata Management Commands


Manage the metadata in a sandbox in the MDS repository.

Application Label Management Commands


Manage the labels for the application.

Application Management Deployment Commands


Manage the application deployment.


Repository Management Commands

Use the MDS commands listed in Table 8-2 to manage the MDS repository. In the Use with WLST column, online means the command can only be used when connected to a running Administration Server. Offline means the command can only be used when not connected to a running server. Online or offline means the command can be used in both situations.

Table 8-2 Repository Management Commands

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

createMetadataPartition


Create a metadata repository partition.

Online

deleteMetadataPartition


Delete a metadata repository partition.

Online

deregisterMetadataDBRepository


Deregister a database-based MDS repository.

Online

registerMetadataDBRepository


Register a database-based MDS repository.

Online


createMetadataPartition

Command Category: Repository Management

Use with WLST: Online

Description

A metadata repository is used as a common repository for managing metadata of different applications. Many applications use the MDS repository to manage their metadata. Each deployed application uses a logical partition in metadata repository. This logical partition also helps in maintaining the metadata lifecycle. Before deploying a application, you create a partition for it in MDS repository. This command creates a partition with the given name in the specified repository.

Syntax

createMetadataPartition(repository, partition)
Argument Definition
repository
The name of the repository where the partition will be created.
partition
The name of the partition to create in the repository.

Example

The following example creates the metadata partition partition1 in the repository mds-myrepos:

wls:/weblogic/serverConfig> createMetadataPartition(repository='mds-myrepos',
                              partition='partition1')
Executing operation: createMetadataPartition
Metadata partition created: partition1
"partition1"

deleteMetadataPartition

Command Category: Repository Management

Use with WLST: Online

Description

Deletes a metadata partition in the specified repository. When you delete a repository partition, all of the metadata in that partition is lost.

Syntax

deleteMetadataPartition(repository, partition)
Argument Definition
repository
The name of the repository that contains the partition.
partition
The name of the partition to delete in the repository.

Example

The following example deletes the metadata partition partition1 from the repository mds-myrepos:

wls:/weblogic/serverConfig> deleteMetadataPartition(repository='mds-myrepos',
                                partition='partition1')
Executing operation: deleteMetadataPartition
Metadata partition deleted: partition1

deregisterMetadataDBRepository

Command Category: Repository Management

Use with WLST: Online

Description

Removes the database metadata repository registration as a System JDBC data source in the domain. After this command completes successfully, applications can no longer use this repository.

Syntax

deregisterMetadataDBRepository(name)
Argument Definition
name
The name of the repository to deregister.

Example

The following example deregisters the metadata repository mds-myrepos:

wls:/weblogic/serverConfig> deregisterMetadataDBRepository('mds-myrepos')
Executing operation: deregisterMetadataDBRepository.
Metadata DB repository "mds-myrepos" was deregistered successfully.

registerMetadataDBRepository

Command Category: Repository Management

Use with WLST: Online

Description

A database metadata repository should be registered with WebLogic Server instances before the application can use it. This command registers a System JDBC data source with the domain for use as database-based metadata repository.

Syntax

registerMetadataDBRepository(name, dbVendor, host, port, dbName, user, password  [, targetServers])
Argument Definition
name
The name of the repository to register. If the name you supply does not begin with mds-, the commands adds the prefix mds-.
dbVendor
The database vendor. The acceptable values are ORACLE, MSSQL, IBMDB2.
host
The host name or the IP address of the database.
port
The port number used by the database.
dbName
The service name of the database. For example, orcl.hostname.com
user
The database user name.
password
The password for the database user.
targetServers
Optional. The WebLogic Server instances to which this repository will be registered. If this argument is not specified, then the repository will be registered only to the Administration Server. To specify multiple servers, separate the names with a comma.

Register the repository with all Managed Servers to which the application will be deployed.


Example

The following example registers the metadata repository myrepos to two servers, and specifies the database parameters:

wls:/weblogic/serverConfig> registerMetadataDBRepository('myrepos','ORACLE',
              'test.oracle.com','1521','mds', 'user1','x','server1, server2')
Executing operation: registerMetadataDBRepository.
Metadata DB repository "mds-myrepos" was registered successfully.
'mds-myrepos'

Application Metadata Management Commands

Use the commands in Table 8-3 to manage application metadata.

Table 8-3 Application Metadata Commands

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

deleteMetadata


Deletes the metadata in the application repository.

Online

exportMetadata


Exports metadata for an application.

Online

importMetadata


Imports metadata for an application.

Online

purgeMetadata


Purge metadata.

Online


deleteMetadata

Command Category: Application Metadata

Use with WLST: Online

Description

Deletes the selected documents from the application repository. When this command is run against repositories that support versioning (that is, database-based repositories), delete is logical and marks the tip version (the latest version) of the selected documents as "deleted" in the MDS repository partition.

You may want to delete metadata when the metadata is moved from one repository to another. In such a case, after you have exported the metadata, you can delete the metadata in the original repository.

Syntax

deleteMetadata(application, server, docs [, restrictCustTo] [, excludeAllCust]
 [, excludeBaseDocs] [, excludeExtendedMetadata] [, cancelOnException] [, applicationVersion])
Argument Definition
application
The name of the application for which the metadata is to be deleted.
server
The target server on which this application is deployed.
docs
A list of comma-separated, fully qualified document names or document name patterns, or both. The patterns can have the following wildcard characters: * and **.

The asterisk (*) represents all documents under the current namespace. The double asterisk (**) represents all documents under the current namespace and also recursively includes all documents in subnamespaces.

For example, "/oracle/*" will include all documents under "/oracle/" but not include documents under "/oracle/mds/".

As another example, "/oracle/**" will include all documents under "/oracle/" and also under "/oracle/mds/" and any other documents further in the namespace chain.

restrictCustTo
Optional. Valid values are percent (%) or a list of comma-separated customization layer names used to restrict the delete operation to delete only customization documents that match the specified customization layers.

If you do not specify this argument, only customization classes declared in the cust-config element of adf-config.xml are deleted. If there is no cust-config element declared in adf-config.xml, all customization classes are deleted. Each customization layer name can contain, within a pair of brackets, optional customization layer values and value patterns separated by commas.

If you specify percent (%) as the value of this argument, all customizations are deleted, whether or not they are declared in the cust-config element of adf-config.xml.

Use this option to delete all customizations or a subset of declared customizations. You can also use this option to delete customizations from customization classes that are not declared in the cust-config element of adf-config.xml.

excludeAllCust
Optional. A Boolean value (true or false) that specifies whether or not to delete all customization documents.

This argument defaults to false. It overrides the restrictCustTo option.

excludeBaseDocs
Optional. A Boolean value (true or false) that specifies whether or not to delete base documents. This argument defaults to false.
excludeExtendedMetadata
Optional. A Boolean value (true or false) that specifies whether or not to delete the Extended Metadata documents. This argument defaults to false.
cancelOnException
Optional. A Boolean value (true or false) that specifies whether or not to abort the delete operation when an exception is encountered. On abort, the delete is rolled back if that is supported by the target store. This argument defaults to true.
applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.

Examples

The following example deletes metadata files under the package mypackage from mdsApp deployed in the server server1:

wls:/weblogic/serverConfig> deleteMetadata(application='mdsapp',
           server='server1', docs='/mypackage/*')
Executing operation: deleteMetadata.
"deleteMetadata" operation completed. Summary of "deleteMetadata" operation is:
List of documents successfully deleted:
/mypackage/jobs.xml
/mypackage/mo.xml
/mypackage/mdssys/cust/site/site1/jobs.xml.xml
/mypackage/mdssys/cust/site/site1/mo.xml.xml
4 documents successfully deleted.

The following example deletes metadata files under the package mypackage from mdsApp deployed in the server server1 and excludes extended metadata and all customizations:

wls:/weblogic/serverConfig> deleteMetadata(application='mdsapp',
        server='server1', docs='/mypackage/*', cancelOnException='false',
        excludeExtendedMetadata='true',
        excludeAllCust='true')
Executing operation: deleteMetadata.
"deleteMetadata" operation completed. Summary of "deleteMetadata" operation is:
List of documents successfully deleted:
/mypackage/jobs.xml
/mypackage/mo.xml
2 documents successfully deleted.

exportMetadata

Command Category: Application Metadata

Use with WLST: Online

Description

Exports application metadata. Use this command and the importMetadata command to transfer application metadata from one server location (for example, testing) to another server location (for example, production).

This command exports application metadata including customizations. However, by default, only those customizations from customization classes that are defined in the cust-config element of adf.config.xml are exported. To export customizations from customization classes not declared, use the restrictCustTo option.

Syntax

exportMetadata(application, server, toLocation  [, docs]
  [, restrictCustTo] [, excludeCustFor] [, excludeAllCust] [, excludeBaseDocs]
  [, excludeExtendedMetadata] [, excludeSeededDocs]
  [, fromLabel][, toLabel] [, applicationVersion] [, remote])
Argument Definition
application
The name of the application from which the metadata is to be exported.
server
The target server on which this application is deployed.
toLocation
The target directory or archive file (.jar, .JAR, .zip or .ZIP) to which documents selected from the source partition will be transferred. If you export to a directory, the directory must be a local or network directory or file where the application is physically deployed. If you export to an archive, the archive can be located on a local or network directory or file where the application is physically deployed, or on the system on which you are executing the command.

If the location does not exist in the file system, a directory will be created except that when the names ends with .jar, .JAR, .zip or .ZIP, an archive file will be created. If the archive file already exists, the exportMetadata operation will overwrite the file.

This argument can be used as temporary file system for transferring metadata from one server to another. For more information, see "Moving Metadata from a Test System to a Production System" in the Oracle Fusion Middleware Administrator's Guide.

docs
Optional. A list of comma-separated, fully qualified document names or document name patterns, or both. The patterns can have the following wildcard characters: * and **.

This argument defaults to "/**", which exports all the metadata in the repository.

The asterisk (*) represents all documents under the current namespace. The double asterisk (**) represents all documents under the current namespace and also recursively includes all documents in subnamespaces.

For example, "/oracle/*" will include all documents under "/oracle/" but not include documents under "/oracle/mds/".

"/oracle/**" will include all documents under "/oracle/" and also under "/oracle/mds/" and any other documents further in the namespace chain.

restrictCustTo
Optional. Valid values are percent (%) or a list of comma-separated customization layer names used to restrict the export operation to export only customization documents that match the specified customization layers. Each customization layer name can contain, within a pair of brackets, optional customization layer values and value patterns separated by commas.

If you do not specify this argument, only customization classes declared in the cust-config element of adf-config.xml are exported. If there is no cust-config element declared in adf-config.xml, all customization classes are exported.

If you specify percent (%) as the value of this argument, all customizations are exported, whether or not they are declared in the cust-config element of adf-config.xml.

Use this option to export all customizations or a subset of declared customizations. You can also use this option to export customizations from customization classes that are not declared in the cust-config element of adf-config.xml.

This argument is ignored if the excludeAllCust argument is also specified.

excludeCustFor
Optional. A list of comma-separated customization layer names used to restrict the export operation to exclude customization documents that match the specified customization layers from being exported.

This argument is ignored if the excludeAllCust argument is also specified.

excludeAllCust
Optional. A Boolean value (true or false) that specifies whether or not to export all customization documents. This argument defaults to false. This argument overrides the restrictCustTo and excludeCustFor arguments.
excludeBaseDocs
Optional. A Boolean value (true or false) that specifies whether or not to export base documents. This argument defaults to false.
excludeExtendedMetadata
Optional. A Boolean value (true or false) that specifies whether or not to export the Extended Metadata documents. This argument defaults to false.
excludeSeededDocs
Optional. A Boolean value (true or false) that specifies whether all documents or only non-seeded documents are exported. Seeded documents are those documents that are packaged in a MAR.

To exclude seeded documents, specify true.

The default is false.

fromLabel
Optional. Transfers the documents from the source partition that is associated with this label.
toLabel
Optional. Works with the fromLabel argument to transfer the delta between fromLabel to toLabel from the source partition.
applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.
remote
Optional. A Boolean value (true or false) that specifies whether the archive file will be written to a location where the application is deployed (false) or to the system on which you are executing the command (true).

The default is false.


Examples

The following example exports all metadata files from the application mdsapp deployed in the server server1.

wls:/weblogic/serverConfig> exportMetadata(application='mdsapp', 
               server='server1',toLocation='/tmp/myrepos',docs='/**')
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)
Executing operation: exportMetadata.
"exportMetadata" operation completed. Summary of "exportMetadata" operation is:
List of documents successfully transferred:
/mypackage/write.xml
/mypackage/write1.xml
/sample1.jspx

The following example exports only the customization documents under the layer user without any base documents from label label1 to label label2:

wls:/weblogic/serverConfig> exportMetadata(application='mdsapp',
                       server='server1',toLocation='/tmp/myrepos',
                       restrictCustTo='user',
                       excludeBaseDocs='true',
                       fromLabel='label1',
                       toLabel='label2',
                       applicationVersion='11.1.1')
List of documents successfully transferred:
/mypackage/mdssys/cust/user/user1/write1.xml.xml
/mypackage/mdssys/cust/user/user2/write2.xml.xml
2 documents successfully transferred.

importMetadata

Command Category: Application Metadata

Use with WLST: Online

Description

Imports application metadata. Use the exportMetadata command and this command to transfer application metadata from one server location (for example, testing) to another server location (for example, production).

Syntax

importMetadata(application, server, fromLocation  [, docs]
 [, restrictCustTo] [, excludeAllCust] [, excludeBaseDocs]
 [, excludeExtendedMetadata] [, excludeUnmodifiedDocs] 
  [, cancelOnException] [, applicationVersion] [, remote])
Argument Definition
application
The name of the application for which the metadata is to be imported.
server
The target server on which this application is deployed.
fromLocation
The source directory or archive file from which documents will be selected for transfer. If you exported to a directory, the directory must be a local or network directory or file where the application is physically deployed. If you exported to an archive, the archive can be located on a local or network directory or file where the application is physically deployed, or on the system on which you are executing the command.

This argument can be used as a temporary file system location for transferring metadata from one server to another. For more information, see "Moving Metadata from a Test System to a Production System" in the Oracle Fusion Middleware Administrator's Guide

docs
Optional. A list of comma-separated, fully qualified document names or document name patterns, or both. The patterns can have the following wildcard characters: * and **.

This argument defaults to "/**", which imports all of the documents in the repository.

The asterisk (*) represents all documents under the current namespace. The double asterisk (**) represents all documents under the current namespace and also recursively includes all documents in subnamespaces.

For example, "/oracle/*" will include all documents under "/oracle/" but not include documents under "/oracle/mds/".

"/oracle/**" will include all documents under "/oracle/" and also under "/oracle/mds/" and any other documents further in the namespace chain.

restrictCustTo
Optional. Valid values are percent (%) or a list of comma-separated customization layer names used to restrict the import operation to import only customization documents that match the specified customization layers, including customization classes that are not declared in the cust-config element of adf-config.xml. Each customization layer name can contain, within a pair of brackets, optional customization layer values and value patterns separated by commas.

If you do not specify this argument, only customization classes declared in the cust-config element of adf-config.xml are imported. If there is no cust-config element declared in adf-config.xml, all customization classes are imported.

If you specify percent (%) as the value of this argument, all customizations are imported, whether or not they are declared in the cust-config element of adf-config.xml.

Use this option to import all customizations or a subset of declared customizations. You can also use this option to export customizations from customization classes that are not declared in the cust-config element of adf-config.xml.

This argument is ignored if the excludeAllCust argument is also specified.

excludeAllCust
Optional. A Boolean value (true or false) that specifies whether or not to import all customization documents. This argument defaults to false. This argument overrides the restrictCustTo argument.
excludeBaseDocs
Optional. A Boolean value (true or false) that specifies whether or not to import base documents. This argument defaults to false.
excludeExtendedMetadata
Optional. A Boolean value (true or false) that specifies whether or not to import the Extended Metadata documents. This argument defaults to false.
excludeUnmodifiedDocs
Optional. A Boolean value (true or false) that specifies whether only changed documents are imported.

If you specify true, only changed documents are imported.

The default is false.

cancelOnException
Optional. A Boolean value (true or false) that specifies whether or not to abort the import operation when an exception is encountered.

The default is true.

applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.
remote
Optional. A Boolean value (true or false) that specifies whether the archive file is in a location where the application is deployed (false) or on the system on which you are executing the command (true).

The default is false.


Example

The following example imports all metadata available in /tmp/myrepos to the application mdsapp deployed in the server server1:

wls:/weblogic/serverConfig> importMetadata(application='mdsapp', server='server1',
                             fromLocation='/tmp/myrepos',docs="/**")
Executing operation: importMetadata.
"importMetadata" operation completed. Summary of "importMetadata" operation is:
List of documents successfully transferred:
/app1/jobs.xml
/app1/mo.xml
2 documents successfully transferred.

purgeMetadata

Command Category: Application Metadata

Use with WLST: Online

Description

Purges the older (non-tip) versions of unlabeled documents from the application's repository. All unlabeled documents will be purged if they are expired, based on Time-To-Live (the olderThan argument). This command is applicable only for repositories that support versioning, that is, database-based repositories.

Syntax

purgeMetadata(application, server, olderThan [, applicationVersion])
Argument Definition
application
The name of the application, used to identify the partition in the repository on which the purge operation will be run.
server
The target server on which this application is deployed.
olderThan
Document versions that are older than this value (in seconds) will be purged.
applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.

Example

The following example purges the document version history for the application mdsapp deployed in the server server1, if the version is older than 10 seconds:

wls:/weblogic/serverConfig> purgeMetadata('mdsapp', 'server1', 10)
Executing operation: purgeMetadata.
Metadata purged: Total number of versions: 10.
Number of versions purged: 0.

Sandbox Metadata Management Commands

Use the commands in Table 8-4 to manage metadata in a sandbox. A sandbox is a temporary location for testing changes before moving them to a production system. Sandboxes are not visible to most users until they are applied.

Table 8-4 Sandbox Metadata Management Commands

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

exportSandboxMetadata


Exports the metadata from a sandbox.

Online

importSandboxMetadata


Imports metadata into a sandbox.

Online


exportSandboxMetadata

Command Category: Sandbox Metadata Management

Use with WLST: Online

Description

Exports the changes to the metadata from a sandbox on a test system.

You can only use this command with a database-based MDS repository.

Syntax

exportSandboxMetadata(application, server, toArchive, sandboxName 
               [, restrictCustTo] [, applicationVersion] [, remote])
Argument Definition
application
The name of the application from which the metadata is to be exported.
server
The target server on which this application is deployed.
toArchive
The target archive file (.jar, .JAR, .zip or .ZIP) to which the sandbox contents will be transferred. The archive can be located on a local or network directory where the application is physically deployed. If you specify the -remote argument, the archive can be located on the system on which you are executing the command.
sandboxName
The name of the sandbox to export.
restrictCustTo
Optional. Valid values are percent (%) or a list of comma-separated customization layer names used to restrict the export operation to export only customization documents that match the specified customization layers.

If you do not specify this argument or if you specify percent (%) as the value of this argument, all customizations are exported, whether or not they are declared in the cust-config element of adf-config.xml. Each customization layer name can contain, within a pair of brackets, optional customization layer values and value patterns separated by commas.

Use this option to export all customizations or a subset of declared customizations. You can also use this option to export customizations from customization classes that are not declared in the cust-config element of adf-config.xml.

This argument is ignored if the excludeAllCust argument is also specified.

applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.
remote
Optional. A Boolean value (true or false) that specifies whether the archive file will be written to a location where the application is deployed (false) or to the system on which you are executing the command (true).

The default is false.


Example

The following example exports a sandbox from the MDS repository for the application myapp:

wls:/weblogic/serverConfig>exportSandboxMetadata('myapp', 'server1',
                    '/tmp/sandbox1.jar', 'sandbox1')

importSandboxMetadata

Command Category: Sandbox Metadata Management

Use with WLST: Online

Description

Imports the contents of a sandbox archive to another sandbox in the MDS repository partition of the specified application. It can also update the contents of a given archive to a sandbox in the MDS repository partition of a given application. All customizations are imported, whether or not they are declared in the cust-config element of adf-config.xml.

You can only use this command with a database-based MDS repository.

Syntax

importSandboxMetadata(application, server, fromArchive  [, forceSBCreation]
               [, useExistingSandbox] [, sandboxName] [, applicationVersion]
               [, remote])
Argument Definition
application
The name of the application for which the metadata is to be imported.
server
The target server on which this application is deployed.
fromArchive
The source archive file from which documents will be selected for transfer. The archive can be located on a local or network directory where the application is physically deployed. If you specify the -remote argument, the archive can be located on the system on which you are executing the command.
forceSBCreation
Optional. A Boolean value (true or false) that specifies whether the operation will overwrite an existing sandbox with the same name. When the argument is set to true, if the fromArchive argument specifies a sandbox with the same name as one that already exists in the application's partition, the original sandbox is deleted and a new sandbox is created. When the argument is set to false, if a sandbox with the same name exists, an exception is thrown.

The default is false.

useExistingSandbox Optional. When set to true, the contents of the archive are imported to the sandbox specified with the sandboxName argument. This argument is ignored if there is no value specified for sandboxName.

The default is false.

sandboxName Optional. The name of the sandbox to update. This argument is ignored if useExistingSandbox is false.
applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.
remote
Optional. A Boolean value (true or false) that specifies whether the archive file is in a location where the application is deployed (false) or on the system on which you are executing the command (true).

The default is false.


Examples

The following example imports the contents of the sandbox sandbox1.jar:

wls:/weblogic/serverConfig> importSandboxMetadata(application='myapp', 'server1'', 
                             '/tmp/sandbox1.jar')

The following example updates the sandbox sandbox1.jar:

wls:/weblogic/serverConfig>importSandboxMetadata('myapp', 'server1', '/tmp/sandbox1.jar', useExistingSandbox='true', sandboxName='sandbox1')

Application Label Management Commands

Use the commands in Table 8-5 to manage labels for applications.

Table 8-5 Application Label Management Commands

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

createMetadataLabel


Creates a metadata label.

Online

deleteMetadataLabel


Deletes a metadata label from the repository partition.

Online

listMetadataLabels


Lists metadata labels in the repository partition.

Online

promoteMetadataLabel


Promotes the metadata associated with a label to tip.

Online

purgeMetadataLabels


Deletes the labels matching the specified criteria.

Online


createMetadataLabel

Command Category: Application Label Management

Use with WLST: Online

Description

Creates a new label for the documents in the application's repository partition. This command is applicable only for repositories that support versioning.

Syntax

createMetadataLabel(application, server, name [, applicationVersion])
Argument Definition
application
The name of the application for which a label will be created in the partition configured for this application.
server
The target server on which this application is deployed. If the application is deployed to multiple Managed Servers in a cluster, you can use the name of any of the server names. You cannot specify multiple server names.
name
The name of the label to create in the repository partition.
applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.

Example

The following example creates the label label1 for the application mdsapp deployed in the server server1:

wls:/weblogic/serverConfig> createMetadataLabel('mdsapp','server1','label1')
Executing operation: createMetadataLabel.
Created metadata label "label1".

deleteMetadataLabel

Command Category: Application Label Management

Use with WLST: Online

Description

Deletes a label for the documents in the application's repository partition. This command is applicable only for repositories that support versioning.

Syntax

deleteMetadataLabel(application, server, name [, applicationVersion])
Argument Definition
application
The name of the application from whose associated partition the label is to be deleted.
server
The target server on which this application is deployed. If the application is deployed to multiple Managed Servers in a cluster, you can use the name of any of the server names. You cannot specify multiple server names.
name
The name of the label to delete in the repository partition.
applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.

Example

The following example deletes the metadata label label1 from the application mdsapp deployed in the server server1:

wls:/weblogic/serverConfig> deleteMetadataLabel('mdsapp','server1','label1')
Executing operation: deleteMetadataLabel.
Deleted metadata label "label1".

listMetadataLabels

Command Category:

Use with WLST: Online

Description

Lists all of the metadata labels in the application's repository partition. This command is applicable only for repositories that support versioning.

Syntax

listMetadataLabels(application, server [, applicationVersion])
Argument Definition
application
The name of the application for which all of the labels in the repository partition should be listed.
server
The target server on which this application is deployed. If the application is deployed to multiple Managed Servers in a cluster, you can use the name of any of the server names. You cannot specify multiple server names.
applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.

Example

The following example lists the metadata labels available for the application mdsapp deployed in the server server1:

wls:/weblogic/serverConfig> listMetadataLabels('mdsapp', 'server1')
Executing operation: listMetadataLabels.
Database Repository partition contains the following labels:
label2
label3

promoteMetadataLabel

Command Category: Application Label Management

Use with WLST: Online

Description

Promotes documents associated with a label to the tip version in the repository. This command is useful to achieve rollback capability. This command is applicable only for repositories that support versioning.

Syntax

promoteMetadataLabel(application, server, name [, applicationVersion])
Argument Definition
application
The name of the application in whose associated repository the metadata is to be promoted to tip.
server
The target server on which this application is deployed. If the application is deployed to multiple Managed Servers in a cluster, you can use the name of any of the server names. You cannot specify multiple server names.
name
The name of the label to promote in the repository partition.
applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.

Example

The following example promotes the metadata label label1 to tip in the application mdsapp deployed in the server server1:

wls:/weblogic/serverConfig> promoteMetadataLabel('mdsapp', 'server1','label1')
Executing operation: promoteMetadataLabel.
Promoted metadata label "label1" to tip.

purgeMetadataLabels

Command Category: Application Label Management

Use with WLST: Online

Description

Purges or lists the metadata labels that match the given pattern or age, but does not delete the metadata documents that were part of the label. You can delete the documents by executing the purgeMetadata command.

Syntax

purgeMetadataLabels(repository, partition [, namePattern] [, olderThanInMin] 
 [, infoOnly])
Argument Definition
repository
The name of the MDS repository that contains the partition whose metadata labels will be purged or listed.
partition
The name of the partition whose metadata labels will be purged or listed.
namePattern
Optional. A pattern that matches the names of labels. The pattern can contain the following special characters:
  • The percent (%) character, which matches any number of characters.

  • The underscore (_) character, which matches exactly one arbitrary character.

  • The backslash character ('\'), which can be used to escape the percent, the underscore, and the backslash (itself) characters, so they match only %, _, or \.

olderThanInMin
Optional. The age of the labels, in minutes. The default is 525600 (one year).
infoOnly
Optional. Valid values are true or false. If you set it to true, it does not purge the labels, but lists the labels that match the specified pattern.

The default is false.


Examples

The following example lists the labels that match the specified namePattern, but does not delete them:

wls:/weblogic/serverConfig> purgeMetadataLabels(repository='mds-myRepos',
           partition='partition1', namePattern='mylabel*', infoOnly='true' )

The following example purges the labels that match the specified namePattern and that are older than a year:

wls:/weblogic/serverConfig> purgeMetadataLabels(repository='mds-myRepos',
                    partition='partition1', namePattern='mylabel*')

The following example deletes labels that match the specified namePattern and that are older than 30 minutes:

wls:/weblogic/serverConfig> purgeMetadataLabels(repository='mds-myRepos',
                   partition='partition1', 
                  namePattern='mylabel*', olderThanInMin='30')

Application Management Deployment Commands

Use the commands in Table 8-6 to manage deployment.

Table 8-6 Application Management Deployment Commands

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

getMDSArchiveConfig


Returns an MDSArchiveConfig object.

Offline

importMAR


Imports an MAR.

Online


getMDSArchiveConfig

Command Category: Application Management Deployment

Use with WLST: Offline

Description

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

The MDSArchiveConfig object provides the following methods:

  • setAppMetadataRepository—This method sets the connection details for the application metadata repository.

    If the archive's existing adf-config.xml file does not contain any configuration for the application's metadata repository, then you must provide all necessary arguments to define the target repository. To define a database-based repository, provide the repository, partition, type, and jndi arguments. For a file-based repository, provide the path argument instead of jndi.

    If the adf-config.xml file already contains some configuration for the application's metadata repository, you can provide only a subset of arguments that you want to change. You do not need to provide all arguments in such a case. However, if the store type is changed, then the corresponding jndi or path argument is required.

  • setAppSharedMetadataRepository—This method sets the connection details for the shared repository in the application archive that is mapped to specified namespace.

    If the archive's existing adf-config.xml file does not contain any configuration for a shared metadata repository mapped to the specified namespace, you must provide all required arguments (in this case, repository, partition, type, and jndi or path). For a database-based repository, provide the jndi argument. For a file-based repository, path is a required argument.

    If the adf-config.xml file already contains some configuration for a shared metadata repository mapped to the specified namespace and you want to change some specific arguments, you can provide only a subset of those arguments; all others are not needed.

  • save—If you specify the toLocation argument, 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.

Syntax

archiveConfigObject = getMDSArchiveConfig(fromLocation)
Argument Definition
fromLocation
The name of the ear file, including its complete path.

The syntax for setAppMetadataRepository is:

archiveConfigObject.setAppMetadataRepository([repository] [, partition] 
          [, type] [, jndi] [, path])
Argument Definition
repository
Optional. The name of the application's repository.
partition
Optional. The name of the partition for the application's metadata.
type
Optional. The type of connection, file or database, to the repository. Valid values are 'File' or 'DB' (case insensitive).
jndi
Optional. The JNDI location for the database connection. This argument is required if the type is set to DB. This argument is not considered if the type is set to File.
path
Optional. The directory for the metadata files. This argument is required if the type is set to File. This argument is not considered if the type is set to DB.

The syntax for setAppSharedMetadataRepository is:

archiveConfigObject.setAppSharedMetadataRepository(namespace [, repository] 
          [, partition] [, type] [, jndi] [, path])
Argument Definition
namespace
The namespace used for looking up the shared repository to set connection details.
repository
Optional. The name of the application's shared repository.
partition
Optional. The name of the partition for the application's shared metadata.
type
Optional. The type of connection, file or database, to the repository. Valid values are 'File' or 'DB' (case insensitive).
jndi
Optional. The JNDI location for the database connection. This argument is required if the type is set to DB. This argument will not be considered if the type is set to File.
path
Optional. The location of the file metadata store. This argument is required if the type is set to File. This argument will not be considered if the type is set to DB.

The syntax for save is:

archiveConfigObject.save([toLocation])
Argument Definition
toLocation
Optional. The file name, including the absolute path to store the changes. If this option is not provided, the changes are written to the archive represented by this configuration object.

Examples

In the following example, if the adf-config.xml file in the archive does not have the application and shared metadata repositories defined, then you should provide the complete connection information.

wls:/offline> archive = getMDSArchiveConfig(fromLocation='/tmp/testArchive.ear')

wls:/offline> archive.setAppMetadataRepository(repository='AppRepos1',
        partition='partition1', type='DB', jndi='mds-jndi1') 

wls:/offline> archive.setAppSharedMetadataRepository(namespace='/a',
        repository='SharedRepos1', partition='partition2', type='File',
        path='/temp/dir')
wls:/offline> archive.save() 

In the following example, if the adf-config.xml file in the archive already has the application and shared metadata repositories defined, all arguments are optional. You can set only the arguments you want to change.

wls:/offline> archive = getMDSArchiveConfig(fromLocation='/tmp/testArchive.ear')
wls:/offline> archive.setAppMetadataRepository(partition='MDS-partition2')
wls:/offline> archive.setAppSharedMetadataRepository(namespace='/a',
         repository='SharedRepos2') 
wls:/offline> archive.save(toLocation='/tmp/targetArchive.ear')

importMAR

Command Category: Application Management Deployment

Use with WLST: Online

Description

Imports the metadata from the MAR that is packaged with the application's EAR file. If the MAR had already been imported into the partition, the command deletes the previous version and imports the new version.

Syntax

importMAR(application, server [, force] [, applicationVersion] )
Argument Definition
application
The name of the application for which the metadata is to be imported.
server
The target server on which this application is deployed.
force
Optional. A Boolean value (true or false) that specifies whether only changed documents and MARs are imported.

For a database-based repository, if you set this argument to false, only new or changed documents from changed MARs are imported. The command creates a label for each MAR for which documents are imported. The label has the following format:

postDeploy_application_name_MAR_name_MAR_checksum

For a file-based repository, if you set this argument to false, only changed MARs are imported. The command does not compare individual documents The command creates a file in the repository for each imported MAR.

The default is true.

applicationVersion
Optional. The application version, if multiple versions of the same application are deployed.

Example

The following example imports metadata from the MAR to the application mdsapp:

wls:/weblogic/serverConfig> importMAR('mdsapp','server1')
Executing operation: importMAR.
"importMAR" operation completed. Summary of "importMAR" operation is:
/app1/jobs.xml
/app1/mo.xml
2 documents successfully transferred.