+

Search Tips   |   Advanced Search

Portal Scripting Interface and project support

With the Portal Scripting Interface, we can create Jacl or Jython scripts to automate the management of projects. Using the Project bean with the Portal Scripting Interface, we can perform the following actions on projects:

To run commands with the Project bean, we can use the Portal bean to set a project as the context for subsequent commands.


List projects

To retrieve a list of projects, use the listall method. This method returns the names of the projects.


Create projects

To create a project, use the create method.

Note: If you create a project with the Portal Scripting Interface, the project is not listed with the recent projects in the project menu.


Delete projects

To delete a project, use the delete method.


Set active project

For commands that you want to run within a project, use the setproject method of the Portal bean to specify the project. When invoking the setproject method, you identify the active project with the name of the project. If you invoke the setproject method without specifying a project name, the active project is cleared. When we set the project during a session, the project is active immediately.To set the active project, we must establish a user session with the portal using the login command of the Portal bean.


Retrieve project details

Retrieve project details with the details method. This method returns the following information about the project:

Syntax:


Retrieve translated attributes

If any project attributes are translated, such as the title or description, we can retrieve those attributes with the nlsget method. Specify the attribute with one of the following parameters:

Syntax:

If we do not specify a value for the locale parameter, the currently selected locale is used.


Submit a project for review

To submit a project for review, use the submitforreview method. The project needs to be in active state, and all contained documents need to be in publish, pending, or deleted state. When you submit a project for review, the project moves into the review state.


Withdraw a project from review

To withdraw a project from review, use the withdrawfromreview method. The project needs to be in review state. When you withdraw a project from review, the project moves into the active state.


Approve projects

To approve the drafts in a project, use the approve method. Additional to the project, we can add a comment as a second parameter. If the project setup requires a comment, the comment is mandatory. If not, the comment is optional. The command approves only the project. The drafts in the project need to be approved separately, for example using the approvedocuments method. Before we can approve a project, all of its documents must be in publish, pending, or deleted state.


Decline projects

To decline the drafts in a project, use the decline method. Additional to the project, we can add a comment as a second parameter. If the project setup requires a comment, the comment is mandatory. If not, the comment is optional. The command only declines the project. The drafts in the project remain in their current state. For a project to be declined, the project needs to be in review state.


Approve all documents of a project

To approve all documents of a project, use the approvedocuments method. It approves all Web Content Manager items that are parts of a workflow.


Decline all documents of a project

To decline all documents of a project, use the declinedocuments method. This method declines all Web Content Manager items that are parts of a workflow.


Publish projects

To publish a project, use the publish method. Before we can publish a project, all items in the project must be approved and the project needs to be in publish pending state.


Examples

These examples demonstrate a typical command sequence to create a page within a specific project. Each example script performs the following operations:

Parent topic: Administer managed pages