Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.workplace.wcm.api
Class ProjectService

    java.lang.Object
      Service
          com.ibm.workplace.wcm.api.ProjectService

All Implemented Interfaces:
  WcmProjectService

Deprecated.

    @Deprecated
    public abstract class ProjectService

extends Service
implements WcmProjectService

ProjectService enables access to the WCM API through Portal services.

Here is an example of how to retrieve the `ProjectService`:``

     try
     {
        // Construct and inital Context
        InitialContext ctx = new InitialContext();

        // Retrieve WebContentService using JNDI name
        ProjectService service = (ProjectService) ctx.lookup("portal:service/wcm/ProjectService");
     }
     catch (NamingException ne)
     {
        System.out.print("Naming Exception: " + ne);
     }

Since:
  7.0

Field Summary

Fields inherited from interface com.ibm.workplace.wcm.api.WcmProjectService
`JNDI_NAME`

Constructor Summary
`ProjectService()` Deprecated. Constructor

Method Summary
`abstract Document` | `addItemToProject(Workspace workspace, Project project, WorkflowedDocument workflowedDocument)` Deprecated. Add a `Document` into the given `Project`.
`abstract void` | `cancelDeletion(Workspace workspace, Project project, Document document)` Deprecated. Clear deletion marking from a `Document` on a `Project```
`abstract Project` | `createProject(Workspace workspace)` Deprecated. Create a new `Project` object.
`abstract Project` | `createProject(Workspace workspace, DocumentId projectTemplateDocumentId)` Deprecated. Create a `Project` using the specified `ProjectTemplate`.
`abstract ProjectTemplate` | `createProjectTemplate(Workspace workspace)` Deprecated. Creates a new `ProjectTemplate`.
`abstract void` | `deleteProject(Workspace workspace, Project project)` Deprecated. Delete `Project` object from WCM repository.
`abstract ResultIterator<Project>` | `findProjectsByName(Workspace workspace, java.lang.String name)` Deprecated. Obtain existing `Project`(s) from WCM repository by their name.
`abstract ResultIterator<Project>` | `findProjectsByState(Workspace workspace, ProjectStateSelectors.State projectState)` Deprecated. Obtain a `Project` from WCM repository with its project state.
`abstract ResultIterator<Project>` | `findProjectsByTitle(Workspace workspace, java.lang.String title)` Deprecated. Obtain existing `Project`(s) from WCM repository by their title.
`abstract Project` | `getProjectById(Workspace workspace, DocumentId projectDocumentId)` Deprecated. Obtain a `Project` from WCM repository by its `DocumentId`
`abstract void` | `markItemForDeletion(Workspace workspace, Project project, Document document)` Deprecated. Set a `Document` into deleted state.
`abstract void` | `removeItemFromProject(Workspace workspace, Project project, Document document)` Deprecated. Remove a `Document` from `Project`
`abstract void` | `saveProject(Workspace workspace, Project project)` Deprecated. Add or update a `Project` in the WCM repository.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.ibm.workplace.wcm.api.WcmProjectService
`createProjectTemplate, markItemForDeletion`

Constructor Detail

### ProjectService

    public ProjectService()

  Deprecated.
  Constructor

  Since:
    7.0

Method Detail

### createProjectTemplate

    public abstract ProjectTemplate createProjectTemplate(Workspace workspace)
                                                   throws DocumentCreationException,
                                                          AuthorizationException

  Deprecated.
  Creates a new `ProjectTemplate`.

  A typical usage of this method is as follows:

       Workspace workspace = WCM_API.getRepository().getWorkspace(username, password);
       InitialContext ctx = new InitialContext();
       Workspace workspace = (ProjectService) ctx.lookup("portal:service/wcm/ProjectService");
       ProjectTemplate projectTemplate = projectService.createProjectTemplate(workspace);
       projectTemplate.setName(name);
       ProjectPrototype prototype = projectTemplate.getPrototype();
       prototype.setPublishOptions(PublishOptions.MANUAL);
       prototype.setApprovalMode(ApprovalMode.REQUIRE_ALL_APPROVALS);
       prototype.setCommentMode(CommentMode.ENABLED);
       prototype.setWorkflowActionsForState(State.REVIEW, actionIds);
       prototype.setWorkflowActionsForState(State.REJECTED, actionIds);
       workspace.save(projectTemplate);

  Specified by:
    `createProjectTemplate` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
  Returns:
    the new `ProjectTemplate` object.
  Throws:
    `DocumentCreationException` - if the object cannot be created.
    `AuthorizationException` - if the user does not have minimum Editor access.
  Since:
    8.0

### createProject

    public abstract Project createProject(Workspace workspace)
                                   throws AuthorizationException,
                                          DocumentCreationException

  Deprecated.
  Create a new `Project` object. The default project template attributes will be used.

  Specified by:
    `createProject` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
  Returns:
    Created `Project`
  Throws:
    `AuthorizationException` - if the current user does not have permission
    `DocumentCreationException` - if the item could not be created
  Since:
    7.0

### createProject

    public abstract Project createProject(Workspace workspace,
                                          DocumentId projectTemplateDocumentId)
                                   throws DocumentCreationException,
                                          AuthorizationException

  Deprecated.
  Create a `Project` using the specified `ProjectTemplate`. The created `Project` will inherit all attributes defined on the `ProjectPrototype` of the given `ProjectTemplate`.

  Specified by:
    `createProject` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `projectTemplateDocumentId` - the document id of a `ProjectTemplate`.
  Returns:
    a `Project` instance created from the given `ProjectTemplate`.
  Throws:
    `java.lang.IllegalArgumentException` - if the given id is `null` or is not a `ProjectTemplate`
    `DocumentCreationException` - if the project can not be created or the specified `ProjectTemplate`does not exist.
    `AuthorizationException` - if the current user does not have sufficient access.
  Since:
    8.0

### saveProject

    public abstract void saveProject(Workspace workspace,
                                     Project project)
                              throws AuthorizationException,
                                     DuplicateChildException,
                                     DocumentSaveException,
                                     ProjectException

  Deprecated.
  Add or update a `Project` in the WCM repository.

  Specified by:
    `saveProject` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `project` - `Project` object to save
  Throws:
    `AuthorizationException` - if the current user does not have permission
    `DuplicateChildException` - if another item with the same name already exists
    `DocumentSaveException` - if an error occurs while saving the item
    `ProjectException` - if an internal error occurs
  Since:
    7.0

### deleteProject

    public abstract void deleteProject(Workspace workspace,
                                       Project project)
                                throws AuthorizationException,
                                       DocumentNotFoundException,
                                       DocumentDeleteException,
                                       DocumentDeleteReferentialIntegrityException,
                                       ProjectException

  Deprecated.
  Delete `Project` object from WCM repository.

  Specified by:
    `deleteProject` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `project` - `Project` to delete
  Throws:
    `AuthorizationException` - if the current user does not have permission
    `DocumentNotFoundException` - if the item could not be found
    `DocumentDeleteException` - if the item could not be deleted
    `DocumentDeleteReferentialIntegrityException` - if the item cannot be deleted because another item refers to it
    `ProjectException` - if an internal error occurs
  Since:
    7.0

### addItemToProject

    public abstract Document addItemToProject(Workspace workspace,
                                              Project project,
                                              WorkflowedDocument workflowedDocument)
                                       throws AuthorizationException,
                                              IllegalDocumentTypeException,
                                              DocumentIsLockedException,
                                              MaximumProjectItemsReachedException,
                                              ProjectException

  Deprecated.
  Add a `Document` into the given `Project`.

  If a new and unsaved Item is passed to this method then the add to Project will only committed after a Workspace.save() is called on the Item.

  Specified by:
    `addItemToProject` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `project` - `Project` to which the `Document` is added.
    `workflowedDocument` - `WorkflowedDocument` to add to `Project`
  Returns:
    `Document` actually added into the `Project`
  Throws:
    `AuthorizationException` - if the current user does not have permission
    `IllegalDocumentTypeException` - if the document of this type cannot be added to a project
    `DocumentIsLockedException` - the item is locked by another user and cannot be added to a project by this user
    `MaximumProjectItemsReachedException` - if no more items can be added to the project
    `ProjectException` - if an internal error has occurred
    `FirstStageContainsPublishActionException` - if the workflowed document has a workflow with the first stage having a published action
    `java.lang.IllegalArgumentException` - if the specified `WorkflowedDocument` or `Project` is null
  Since:
    7.0

### removeItemFromProject

    public abstract void removeItemFromProject(Workspace workspace,
                                               Project project,
                                               Document document)
                                        throws AuthorizationException,
                                               DocumentIsLockedException,
                                               ProjectException

  Deprecated.
  Remove a `Document` from `Project`

  Specified by:
    `removeItemFromProject` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `project` - `Project` from which the `Document` is removed.
    `document` - `Document` to be removed from `Project`.
  Throws:
    `AuthorizationException` - if the current user does not have permission
    `DocumentIsLockedException` - the item is locked by another user and cannot be removed from a project by this user
    `ProjectException` - if an internal error has occurred
    `java.lang.IllegalArgumentException` - if the specified `Document` or `Project` is null
  Since:
    7.0

### markItemForDeletion

    public abstract void markItemForDeletion(Workspace workspace,
                                             Project project,
                                             Document document)
                                      throws AuthorizationException,
                                             DocumentNotFoundException,
                                             DocumentRetrievalException,
                                             DocumentDeleteException,
                                             DocumentDeleteReferentialIntegrityException,
                                             ProjectException

  Deprecated.
  Set a `Document` into deleted state.
  The item may fail to be marked for deletion if it fails the to meet the following requirements:
  - Project Type: The item cannot be a project
  - Draft Item: the item should be a draft
  - In Project: the item should belong to a project
  - Pending item: the item cannot be pending published
  - Multiple Draft: the published item should have only one draft
  - References to the Mark for Deletion item in the project: all these references should be marked for deletion as well
  - References to the Published Item of the draft (if it has one): make sure these references do not exist
  - Hierarchical Items: if the item is hierarchical then it should not have children
  Also note that even if the item is marked for deletion it may still fail to delete successfully with project publish if new references are introduced to the publish item.

  Specified by:
    `markItemForDeletion` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `project` - `Project` in which a item resides in.
    `document` - `Document` to be marked as deleted.
  Throws:
    `AuthorizationException` - if the current user does not have permission
    `DocumentNotFoundException` - if the item could not be found
    `DocumentRetrievalException` - if an error occurs while locating the item
    `DocumentDeleteException` - if the item could not be deleted
    `DocumentDeleteReferentialIntegrityException` - if the item cannot be deleted because another item refers to it
    `ProjectException` - if an internal error occurs
  Since:
    7.0

### cancelDeletion

    public abstract void cancelDeletion(Workspace workspace,
                                        Project project,
                                        Document document)
                                 throws AuthorizationException,
                                        ProjectException

  Deprecated.
  Clear deletion marking from a `Document` on a `Project`

  ``
  Specified by:
    `cancelDeletion` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `project` - `Project` in which a item resides in.
    `document` - `Document` to be cancelled from deletion marking.
  Throws:
    `AuthorizationException` - if the current user does not have permission
    `ProjectException` - if an internal error has occurred
  Since:
    7.0

### findProjectsByName

    public abstract ResultIterator<Project> findProjectsByName(Workspace workspace,
                                                               java.lang.String name)
                                                        throws QueryServiceException

  Deprecated.
  Obtain existing `Project`(s) from WCM repository by their name.

  Specified by:
    `findProjectsByName` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `name` - `Project` name to be retrieved.
  Returns:
    Obtained `Project` object(s) with the given name
  Throws:
    `QueryServiceException` - if an error occurs doing the query
  Since:
    7.0

### findProjectsByTitle

    public abstract ResultIterator<Project> findProjectsByTitle(Workspace workspace,
                                                                java.lang.String title)
                                                         throws QueryServiceException

  Deprecated.
  Obtain existing `Project`(s) from WCM repository by their title.

  Specified by:
    `findProjectsByTitle` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `title` - `Project` title to be retrieved.
  Returns:
    Obtained `Project` object(s) with the given title
  Throws:
    `QueryServiceException` - if an error occurs doing the query
  Since:
    7.0

### getProjectById

    public abstract Project getProjectById(Workspace workspace,
                                           DocumentId projectDocumentId)
                                    throws AuthorizationException,
                                           DocumentRetrievalException

  Deprecated.
  Obtain a `Project` from WCM repository by its `DocumentId`

  Specified by:
    `getProjectById` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `projectDocumentId` - Id of `Project` to be retrieved.
  Returns:
    Obtained `Project` object
  Throws:
    `AuthorizationException` - if the current user does not have permission
    `DocumentRetrievalException` - if an error occurs while locating the item
  Since:
    7.0

### findProjectsByState

    public abstract ResultIterator<Project> findProjectsByState(Workspace workspace,
                                                                ProjectStateSelectors.State projectState)
                                                         throws QueryServiceException

  Deprecated.
  Obtain a `Project` from WCM repository with its project state.

  Specified by:
    `findProjectsByState` in interface `WcmProjectService`
  Parameters:
    `workspace` - workspace
    `projectState` - project state defined by `ProjectStateSelectors.State`
  Returns:
    Retrieved projects
  Throws:
    `QueryServiceException` - if an error occurs doing the query
  Since:
    7.0

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD