4.4 Sandbox Metadata Management Commands

Use the commands in Table 4-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 4-4 Sandbox Metadata Management Commands

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

destroyMDSSandbox

Destroys an MDS sandbox.

Online

exportSandboxMetadata

Exports the metadata from a sandbox.

Online

importSandboxMetadata

Imports metadata into a sandbox.

Online

listMDSSandboxes

Lists sandboxes.

Online


4.4.1 destroyMDSSandbox

Command Category: Sandbox Metadata Management

Use with WLST: Online

Description

Destroys the sandbox and its contents.

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

Syntax

destroyMDSSandbox(application, server, sandboxName [, applicationVersion])

Argument Definition
application

The name of the application.

server

The target server on which this application is deployed.

sandboxName

The name of the sandbox to destroy.

applicationVersion

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


Example

The following example destroys the sandbox sandbox1 from the MDS repository for the application myapp:

wls:/weblogic/serverConfig>destroyMDSSandbox('myapp', 'server1',
                    'sandbox1')
Executing operation: destroyMDSSandbox.
 
Sandbox "sandbox1" successfully destroyed. 

4.4.2 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] [, tenantName])

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. Each customization layer name can contain, within a pair of brackets, optional customization layer values and value patterns separated by commas.

See "Common Name Pattern Format" for information about the patterns that you can use with this argument.

For example:

restrictCustTo="user[scott]"
restrictCustTo="site[site1],user[scott]"
restrictCustTo="site[site1, %_2],user[scott, m%]"

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.

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.

tenantName

A unique name identifying the tenant to use for this operation. This argument is required for a multitenant application and is not applicable for a non-multitenant application. For a non-multitenant application, any specified value will be ignored.


Example

The following example exports sandbox sandbox1 from the MDS repository partition for the application myapp to /tmp/sandbox1.jar:

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

4.4.3 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] [, tenantName])

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.

tenantName

A unique name identifying the tenant to use for this operation. This argument is required for a multitenant application and is not applicable for a non-multitenant application. For a non-multitenant application, any specified value will be ignored.


Examples

The following example imports the contents of sandbox1.jar and creates a sandbox in the MDS repository partition for the application myapp:

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

The following example updates the existing sandbox sandbox1 in the MDS repository partition for the application myapp with the contents of sandbox1.jar:

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

4.4.4 listMDSSandboxes

Command Category: Sandbox Metadata Management

Use with WLST: Online

Description

Lists sandboxes matching the specified criteria.

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

Syntax

listMDSSandboxes(application, server [, sbNamePattern] [, applicationVersion])

Argument Definition
application

The name of the application whose sandboxes will be listed.

server

The target server on which this application is deployed.

sbNamePattern

Optional. A pattern that matches the names of one or more sandboxes. When you do not specify this argument, all sandboxes associated with the application's metadata repository partition are listed.

See "Common Name Pattern Format" for information about the patterns that you can use with this argument.

applicationVersion

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


Example

The following example lists all sandboxes for the application myapp and that begin with the characters FlexField:

wls:/weblogic/serverConfig>listMDSSandboxes('myapp', 'server1',
                    'FlexField%')
Executing operation: listMDSSandboxes.
 
Following Sandboxes match the selection criteria:
FlexfieldAutoSandbox_1347601004722                    
FlexfieldAutoSandbox_1347653193237                    
FlexfieldAutoSandbox_1347691996491