|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WcmProjectService
WcmProjectService enables access to the WCM API through Portal services.
Here is an example of how to retrieve the WcmProjectService:
try
{
// Construct and inital Context
InitialContext ctx = new InitialContext();
// Retrieve WcmProjectService using JNDI name
WcmProjectService service = (WcmProjectService) ctx.lookup("portal:service/wcm/WcmProjectService");
}
catch (NamingException ne)
{
System.out.print("Naming Exception: " + ne);
}
| Field Summary | |
|---|---|
static java.lang.String |
JNDI_NAME
JNDI name of this service |
| Method Summary | |
|---|---|
Document |
addItemToProject(Workspace workspace,
Project project,
WorkflowedDocument workflowedDocument)
Add a Document into the given Project. |
void |
cancelDeletion(Workspace workspace,
Project project,
Document document)
Clear deletion marking from a Document on a Project |
Project |
createProject(Workspace workspace)
Create a new Project object. |
Project |
createProject(Workspace workspace,
DocumentId projectTemplateDocumentId)
Create a Project using the specified ProjectTemplate. |
ProjectTemplate |
createProjectTemplate(Workspace workspace)
Creates a new ProjectTemplate. |
ProjectTemplate |
createProjectTemplate(Workspace workspace,
Project project)
Creates a new ProjectTemplate taking the basic settings and properties of the
supplied Project. |
void |
deleteProject(Workspace workspace,
Project project)
Delete Project object from WCM repository. |
ResultIterator<Project> |
findProjectsByName(Workspace workspace,
java.lang.String name)
Obtain existing Project(s) from WCM repository by their name. |
ResultIterator<Project> |
findProjectsByState(Workspace workspace,
ProjectStateSelectors.State projectState)
Obtain a Project from WCM repository with its project state. |
ResultIterator<Project> |
findProjectsByTitle(Workspace workspace,
java.lang.String title)
Obtain existing Project(s) from WCM repository by their title. |
Project |
getProjectById(Workspace workspace,
DocumentId projectDocumentId)
Obtain a Project from WCM repository by its DocumentId |
void |
markItemForDeletion(Workspace workspace,
Project project,
Document document)
Set a Document into deleted state. |
LocalizedMessageContainer |
markItemForDeletion(Workspace workspace,
Project project,
Document document,
boolean checkExternalReferences)
Set a Document into deleted state. |
void |
removeItemFromProject(Workspace workspace,
Project project,
Document document)
Remove a Document from Project |
void |
saveProject(Workspace workspace,
Project project)
Add or update a Project in the WCM repository. |
| Field Detail |
|---|
static final java.lang.String JNDI_NAME
| Method Detail |
|---|
ProjectTemplate createProjectTemplate(Workspace workspace)
throws DocumentCreationException,
AuthorizationException
ProjectTemplate.
A typical usage of this method is as follows:
Workspace workspace = WCM_API.getRepository().getWorkspace(username, password);
InitialContext ctx = new InitialContext();
Workspace workspace = (WcmProjectService) ctx.lookup("portal:service/wcm/WcmProjectService");
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);
workspace - workspace
ProjectTemplate object.
DocumentCreationException - if the object cannot be created.
AuthorizationException - if the user does not have minimum Editor access.
ProjectTemplate createProjectTemplate(Workspace workspace,
Project project)
throws DocumentCreationException,
AuthorizationException
ProjectTemplate taking the basic settings and properties of the
supplied Project. The publish settings, approval and action properties of the
Project will be copied over to the new ProjectTemplate.
workspace - workspaceproject - The project to base the new template off.
ProjectTemplate object.
DocumentCreationException - if the object cannot be created.
AuthorizationException - if the user does not have minimum Editor access.
Project createProject(Workspace workspace)
throws AuthorizationException,
DocumentCreationException
Project object. The default project template attributes will be used.
workspace - workspace
Project
AuthorizationException - if the current user does not have permission
DocumentCreationException - if the item could not be created
Project createProject(Workspace workspace,
DocumentId projectTemplateDocumentId)
throws DocumentCreationException,
AuthorizationException
Project using the specified ProjectTemplate.
The created Project will inherit all attributes
defined on the ProjectPrototype of the given ProjectTemplate.
workspace - workspaceprojectTemplateDocumentId - the document id of a ProjectTemplate.
Project instance created from the given ProjectTemplate.
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 ProjectTemplatedoes not exist.
AuthorizationException - if the current user does not have sufficient access.
void saveProject(Workspace workspace,
Project project)
throws AuthorizationException,
DuplicateChildException,
DocumentSaveException,
ProjectException
Project in the WCM repository.
workspace - workspaceproject - Project object to save
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
void deleteProject(Workspace workspace,
Project project)
throws AuthorizationException,
DocumentNotFoundException,
DocumentDeleteException,
DocumentDeleteReferentialIntegrityException,
ProjectException
Project object from WCM repository.
workspace - workspaceproject - Project to delete
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
Document addItemToProject(Workspace workspace,
Project project,
WorkflowedDocument workflowedDocument)
throws AuthorizationException,
IllegalDocumentTypeException,
DocumentIsLockedException,
MaximumProjectItemsReachedException,
ProjectException
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.
workspace - workspaceproject - Project to which the Document is added.workflowedDocument - WorkflowedDocument to add to Project
Document actually added into the Project
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
void removeItemFromProject(Workspace workspace,
Project project,
Document document)
throws AuthorizationException,
DocumentIsLockedException,
ProjectException
Document from Project
workspace - workspaceproject - Project from which the Document is removed.document - Document to be removed from Project.
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
void markItemForDeletion(Workspace workspace,
Project project,
Document document)
throws AuthorizationException,
DocumentNotFoundException,
DocumentRetrievalException,
DocumentDeleteException,
DocumentDeleteReferentialIntegrityException,
ProjectException
Document into deleted state.
workspace - workspaceproject - Project in which a item resides in.document - Document to be marked as deleted.
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
LocalizedMessageContainer markItemForDeletion(Workspace workspace,
Project project,
Document document,
boolean checkExternalReferences)
throws AuthorizationException,
DocumentNotFoundException,
DocumentRetrievalException,
DocumentDeleteException,
DocumentDeleteReferentialIntegrityException,
ProjectException
Document into deleted state.
workspace - workspaceproject - Project in which a item resides in.document - Document to be marked as deleted.checkExternalReferences - indicates whether to check for invalid references external to the project
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
void cancelDeletion(Workspace workspace,
Project project,
Document document)
throws AuthorizationException,
ProjectException
Document on a Project
- Parameters:
workspace - workspaceproject - 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
ResultIterator<Project> findProjectsByName(Workspace workspace,
java.lang.String name)
throws QueryServiceException
Project(s) from WCM repository by their name.
workspace - workspacename - Project name to be retrieved.
Project object(s) with the given name
QueryServiceException - if an error occurs doing the query
ResultIterator<Project> findProjectsByTitle(Workspace workspace,
java.lang.String title)
throws QueryServiceException
Project(s) from WCM repository by their title.
workspace - workspacetitle - Project title to be retrieved.
Project object(s) with the given title
QueryServiceException - if an error occurs doing the query
Project getProjectById(Workspace workspace,
DocumentId projectDocumentId)
throws AuthorizationException,
DocumentRetrievalException
Project from WCM repository by its DocumentId
workspace - workspaceprojectDocumentId - Id of Project to be retrieved.
Project object
AuthorizationException - if the current user does not have permission
DocumentRetrievalException - if an error occurs while locating the item
ResultIterator<Project> findProjectsByState(Workspace workspace,
ProjectStateSelectors.State projectState)
throws QueryServiceException
Project from WCM repository with its project state.
workspace - workspaceprojectState - project state defined by ProjectStateSelectors.State
QueryServiceException - if an error occurs doing the query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||