77 Using Developer Tools Command Line Interface (CLI)
You use the Developer Tools CLI for deployment and other resource movement activities. CLI gives you freedom to work with any workspace, not just the Developer Tools workspace. The command line interface also include import and export features. For example, with CLI you can create reusable modules (workspaces). These workspaces include resources that you can import into any site.
For information about running and using CLI, see these topics:
77.1 Running and Using the Command Line Interface (CLI)
Running CLI involves a few easy steps.
To run the command line interface:
77.2 Example Commands
Here is a list of sample export and import commands that you can run using the command line interface.
-
This command exports the specified
Content_C
assets and allProduct_C
assets that belong to FirstSiteII and were modified since the specified date. Because no workspace is specified, the Developer Tools workspace is used by default:java -Xbootclasspath/a:lib/servlet-api.jar -jar developer-tools-command-line-x.y.z.jar http://localhost:8080/cs/ContentServer username=bob password=password resources=Content_C:123432123423,11234234212,111234341234;Product_C:* fromSites=FirstSiteII modifiedSince="2016-08-08 19:14:00" cmd=export
-
This command imports the specified
Content_C
asset and allProduct_C
assets that are found in the workspace to the FirstSiteII site and were modified since the specified date. Because no workspace is specified, the Developer Tools workspace is used by default:java -Xbootclasspath/a:lib/servlet-api.jar -jar developer-tools-command-line-x.y.z.jar http://localhost:8080/cs/ContentServer username=bob password=password resources=Content_C:aad618e9-f04e-4ee4-b902-076224bb6f7b;Product_C:* toSites=FirstSiteII modifiedSince="2016-09-17 12:09:00" cmd=import
-
This command exports all resources from the site SecondSiteII into a workspace named
TheOutput
:java -Xbootclasspath/a:lib/servlet-api.jar -jar developer-tools-command-line-x.y.z.jar http://localhost:8080/cs/ContentServer username=bob password=password resources=@ALL_ASSETS:*;@ALL_NONASSETS:* fromSites=SecondSiteII datastore=TheOutput cmd=export
-
This command imports all assets and tree tabs from the workspace named
TheInput
into the siteMySite
:java -Xbootclasspath/a:lib/servlet-api.jar -jar developer-tools-command-line-x.y.z.jar http://localhost:8080/cs/ContentServer username=bob password=password resources=@ALL_ASSETS:*;@TREETAB:* toSites=MySite datastore=TheInput cmd=import
Note:
modifiedSince
works only with export|listcs|import
.
77.3 About Importing Modules
Modules are sets of related resources that you export from your WebCenter Sites instance into a given workspace. Modules are reusable, so you can import their content into any CM sites (even if the site is not listed in the resources' canonical list of sites).
The datastore
parameter enables you to specify the workspace you want to either export WebCenter Sites resources to or import WebCenter Sites resources from. If you export WebCenter Sites resources to a workspace that does not exist, the command line interface automatically creates that workspace and exports the resources into it.
To import a module into a CM site, you must execute an import command. In the datastore
parameter, specify the workspace that contains the resources and in the toSites
parameter, specify the site(s) to which you want to import those resources. This imports the content of the workspace into the specified CM site(s).
77.4 Status Codes for Operations Invoked from the Developer Tools Command Line Interface (CLI)
The CLI for the Developer Tools return these status codes for each operation invoked.
Status Code | Description |
---|---|
SUCCESS -> 0 | Represents a successful invocation of a developer tools command (for example, export / import). This status is returned only when the request has been processed without any errors either on the client or the server side and there is at least one resource which could be processed as a result of the invocation. |
NO CONTENT -> 1 | Represents a successful invocation of a developer tools command (for example, export / import). This status is returned only when the request has been processed without any errors either on the client or the server side, but there are no resources which could be processed as a result of the invocation. |
IMPROPER SHUTDOWN -> 11 | A rare error code due to an unexpected breakdown of the process invoked. |
CONSOLE UNAVAILABLE -> 12 | Client-side error code. It’s returned when the CLI interacts using a system other than the system console. |
RUNTIME SANITY CHECK FAILED -> 13 | Client-side error code. It’s returned when the runtime provided for running the application is not sufficient, for example, there are missing dependencies. |
BAD REQUEST -> 40 | Client side error code. It’s returned when the usage is violated. |
UNAUTHORIZED -> 41 | Client side error code. It’s returned when the credentials or roles are invalid or insufficient to perform the processing. |
SERVICE ERROR -> 50 | Server side error code. It’s returned if an exception occurs while invoking the request. |
RESPONSE PARSE ERROR -> 50 | Server side error code. It’s returned when the response sent from the server does not match the expectation of the client. This error code is currently the same as SERVICE ERROR , but maybe expanded in future.
|