Derek Hulley cf86bf466c Merged V3.1 to HEAD
13077: Abstracted ContentStore MBean operations
   13099: Merge V3.0 to V3.1
      13096  Merged V2.2 to V3.0
         13071: Fix ETWOTWO-1058: Hibernate exception while concurrently submitting from and updating same user sandbox.
         13079: Fix ETWOTWO-1117: Misleading exceptions reported during AVM flatten and update
   13102: [no comment]
   13112: Merged V3.0 to V3.1
      13111: Merged V2.2 to V3.0
         13110: Fix 2.1 -> 2.2 upgrade on Postgres
   13114: Build/test fix (Enterprise Remote API project does not yet have any Java files to generate Javadoc)
   13117: DM Index Check - unit test improvements
   13123: *RECORD ONLY* Removed svn:mergeinfo fluff
   13124: Used newer, more efficient NodeService.addProperties method instead of many NodeService.setProperty calls
   13125: Added M2Binding for 'child-association': propagateTimestamps'
   13126: WCM unit tests - reduce build/test time to check (async) submits
   13127: Minor test fix - to allow it to run locally (on Mac OS X)
   13130: Support for 'maxRetries' of zero or less
   13131: Merged V3.0 to V3.1
      13025 *RECORD-ONLY*: Removed unnecessary svn:mergeinfo
      13026: Merged V2.2 to V3.0
         12964: Fixed ETWOTWO-968: Space rules are not run when saving from MS Word
         12993 *RECORD-ONLY*: added openoffice bootstrap context to sample-extensions
         13009 *RECORD-ONLY*: Avoid default OOo config from causing problems on zip/gz installs
   13132: Updated svn:mergeinfo
   13134: ETHREEOH-1202 - initial fix and unit tests
   ___________________________________________________________________
   Modified: svn:mergeinfo
      Merged /alfresco/BRANCHES/V3.0:r13005,13025-13026,13030,13039,13042,13050,13053,13096,13098,13111
      Merged /alfresco/BRANCHES/V2.2:r12964,12993,13009,13071,13079,13110
      Merged /alfresco/BRANCHES/V3.1:r13077,13099,13102,13112,13114,13117,13123-13127,13130-13132,13134


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13564 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
2009-03-11 13:19:59 +00:00

459 lines
17 KiB
Java
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package org.alfresco.wcm.webproject;
import java.util.List;
import java.util.Map;
import org.alfresco.service.cmr.repository.NodeRef;
/**
* Web Project Service fundamental API.
* <p>
* This service API is designed to support the public facing Web Project APIs.
*
* @author janv
*/
public interface WebProjectService
{
//
// Web project operations
//
/**
* Create a new web project (with a default ROOT webapp)
* <p>
* Note: the DNS name will be used to generate the web project store id, which can be subsequently retrieved via WebProjectInfo.getStoreId()
*
* @param dnsName DNS name (required, must be unique)
* @param name name (require, must be unique)
* @param title title
* @param description description
* @return WebProjectInfo the created web project info
*/
public WebProjectInfo createWebProject(String dnsName, String name, String title, String description);
/**
* Create a new web project (with a default ROOT webapp)
* <p>
* Note: the DNS name will be used to generate the web project store id, which can be subsequently retrieved via WebProjectInfo.getStoreId()
*
* @param dnsName DNS name (required, must be unique)
* @param name name (required, must be unique)
* @param title title
* @param description description
* @param sourceNodeRef web project node ref to branch from (can be null)
* @return WebProjectInfo the created web project info
*/
public WebProjectInfo createWebProject(String dnsName, String name, String title, String description, NodeRef sourceNodeRef);
/**
* Create a new web project (with given default web app)
* <p>
* Note: the DNS name will be used to generate the web project store id, which can be subsequently retrieved via WebProjectInfo.getStoreId()
*
* @param dnsName DNS name (must be unique)
* @param name name (must be unique)
* @param title title
* @param description description
* @param defaultWebApp default webapp (if null, will default to ROOT webapp)
* @param useAsTemplate <tt>true</tt> if this web project can be used as a template to branch from
* @param sourceNodeRef web project node ref to branch from (can be null)
* @return WebProjectInfo the created web project info
*/
public WebProjectInfo createWebProject(String dnsName, String name, String title, String description, String defaultWebApp, boolean useAsTemplate, NodeRef sourceNodeRef);
/**
* Returns the Web Projects container
*
* @return NodeRef the node ref of the "Web Projects" container node
*/
public NodeRef getWebProjectsRoot();
/**
* Returns the Web Project for the given AVM path
*
* @param absoluteAVMPath the AVM path from which to determine the Web Project
* @return NodeRef the web project node ref for the path or null if it could not be determined
*/
public NodeRef getWebProjectNodeFromPath(String absoluteAVMPath);
/**
* Returns the Web Project for the given AVM store name (sandbox store id)
*
* @param storeName the AVM store name (sandbox store id) from which to determine the Web Project
* @return NodeRef the web project node ref for the path or null if it could not be determined
*/
public NodeRef getWebProjectNodeFromStore(String storeName);
/**
* List the available web projects for the current user
*
* @return List<WebProjectInfo> list of web project info
*/
public List<WebProjectInfo> listWebProjects();
/**
* List the web projects for the given user (based on the available web projects for the current user)
*
* @param userName user name
* @return List<WebProjectInfo> list of web project info
*/
public List<WebProjectInfo> listWebProjects(String userName);
/**
* Return true if web project node ref is a web project
*
* @param wpNodeRef web project store id
* @return boolean true, if web project
*/
public boolean isWebProject(String wpStoreId);
/**
* Return true if web project node ref is a web project
*
* @param wpNodeRef web project node ref
* @return boolean true, if web project
*/
public boolean isWebProject(NodeRef wpNodeRef);
/**
* Gets web project info based on the store id of a web project
* <p>
* Returns null if the web project can not be found
*
* @param wpStoreId web project store id
* @return WebProjectInfo web project info
*/
public WebProjectInfo getWebProject(String wpStoreId);
/**
* Gets web project info based on the DM nodeRef of a web project
* <p>
* Returns null if the web project can not be found
*
* @param wpNodeRef web project node ref
* @return WebProjectInfo web project info
*/
public WebProjectInfo getWebProject(NodeRef wpNodeRef);
/**
* Update the web project info
* <p>
* Note: the nodeRef and storeId (dnsName) of a web project cannot be updated once the web project has been created
*
* @param wpInfo web project info
*/
public void updateWebProject(WebProjectInfo wpInfo);
/**
* Delete the web project
* <p>
* If the web project does not exist, will log a warning and succeed
* <p>
* Current user must be a content manager for the web project
*
* @param name web project store id
*/
public void deleteWebProject(String wpStoreId);
/**
* Delete the web project
* <p>
* If the web project does not exist, will log a warning and succeed
* <p>
* Current user must be a content manager for the web project
* <p>
* Note: this will cascade delete all sandboxes associated with a web project
*
* @param name web project node ref
*/
public void deleteWebProject(NodeRef wpNodeRef);
//
// Web app operations
//
/**
* Create webapp for the given web project.
* <p>
* Current user must be a content manager for the web project
*
* @param wpStoreId web project store id
* @param name webapp name (must be unique within a web project)
* @param description webapp description
*/
public void createWebApp(String wpStoreId, String name, String description);
/**
* Create webapp for the given web project.
* <p>
* Current user must be a content manager for the web project
*
* @param wpNodeRef web project node ref
* @param name webapp name (must be unique within a web project)
* @param description webapp description
*/
public void createWebApp(NodeRef wpNodeRef, String name, String description);
/**
* List webapps for the web project
*
* @param wpStoreId web project store id
* @return List<String> list of webapp names
*/
public List<String> listWebApps(String wpStoreId);
/**
* List webapps for the web project
*
* @param wpNodeRef web project node ref
* @return List<String> list of webapp names
*/
public List<String> listWebApps(NodeRef wpNodeRef);
/**
* Delete webapp from the given web project
* <p>
* Current user must be a content manager for the web project
* <p>
* Note: this will cascade delete all assets within a webapp
*
* @param wpStoreId web project store id
* @param name webapp name
*/
public void deleteWebApp(String wpStoreId, String name);
/**
* Delete webapp from the given web project
* <p>
* Current user must be a content manager for the web project
* <p>
* Note: this will cascade delete all assets within a webapp
*
* @param wpNodeRef web project node ref
* @param name webapp name
*/
public void deleteWebApp(NodeRef wpNodeRef, String name);
//
// Web user operations
//
/**
* Returns <tt>true</tt> if the current user is a manager of this web project
* <p>
* Note: This includes admin users but does not include the System user
*
* @param wpStoreId web project store id
* @return boolean <tt>true</tt> if the user is a manager (role = WCMUtil.ROLE_CONTENT_MANAGER), <tt>false</tt> otherwise
*/
public boolean isContentManager(String wpStoreId);
/**
* Returns <tt>true</tt> if the current user is a manager of this web project
*
* @param wpNodeRef web project node ref
* @return boolean <tt>true</tt> if the user is a manager (role = WCMUtil.ROLE_CONTENT_MANAGER), <tt>false</tt> otherwise
*/
public boolean isContentManager(NodeRef wpNodeRef);
/**
* Returns <tt>true</tt> if the user is a manager of this web project
* <p>
* Note: This includes admin users but does not include the System user
*
* @param storeName web project store id
* @param username user name
* @return boolean <tt>true</tt> if the user is a manager, <tt>false</tt> otherwise
*/
public boolean isContentManager(String wpStoreId, String username);
/**
* Returns <tt>true</tt> if the user is a manager of this web project
* <p>
* Note: This includes admin users but does not include the System user
*
* @param wpNodeRef web project node ref
* @param userName user name
* @return boolean <tt>true</tt> if the user is a manager (role = WCMUtil.ROLE_CONTENT_MANAGER), <tt>false</tt> otherwise
*/
public boolean isContentManager(NodeRef wpNodeRef, String userName);
/**
* List the web users of the web project
* <p>
* Current user must be a content manager for the web project
*
* @param wpStoreId web project store id
* @return Map<String, String> map of <authority name, role name> pairs
*/
public Map<String, String> listWebUsers(String wpStoreId);
/**
* List the web users of the web project
* <p>
* Current user must be a content manager for the web project
*
* @param wpNodeRef web project node ref
* @return Map<String, String> map of <authority name, role name> pairs
*/
public Map<String, String> listWebUsers(NodeRef wpNodeRef);
/**
* Get the number of web users invited to this web project
*
* @param wpNodeRef web project node ref
* @return int number of invited web users
*/
public int getWebUserCount(NodeRef wpNodeRef);
/**
* Gets the role of the specified user
*
* @param wpStoreId web project store id
* @param userName user name
* @return String web project role for this user, null if no assigned role
*/
public String getWebUserRole(String wpStoreId, String userName);
/**
* Gets the role of the specified user
*
* @param wpNodeRef web project node ref
* @param userName user name
* @return String web project role for this user, null if no assigned role
*/
public String getWebUserRole(NodeRef wpNodeRef, String userName);
/**
* Indicates whether current user is a web user of the web project or not
*
* @param store id web project store id
* @return boolean <tt>true</tt> if the current user is a web user of the web project, <tt>false</tt> otherwise
*/
public boolean isWebUser(String wpStoreId);
/**
* Indicates whether current user is a web user of the web project or not
*
* @param wpNodeRef web project node ref
* @return boolean <tt>true</tt> if the current user is a web user of the web project, <tt>false</tt> otherwise
*/
public boolean isWebUser(NodeRef wpNodeRef);
/**
* Indicates whether given user is a web user of the web project or not
*
* @param store id web project store id
* @param userName user name
* @return boolean <tt>true</tt> if the user is a web user of the web project, <tt>false</tt> otherwise
*/
public boolean isWebUser(String wpStoreId, String userName);
/**
* Indicates whether given user is a web user of the web project or not
*
* @param wpNodeRef web project node ref
* @param userName user name
* @return boolean <tt>true</tt> if the user is a web user of the web project, <tt>false</tt> otherwise
*/
public boolean isWebUser(NodeRef wpNodeRef, String userName);
/**
* Invite users/groups to web project
* <p>
* Note: authority name can be user or group, although a group is flattened into a set of users
* <p>
* Note: author sandbox will NOT be auto created for each invited user
*
* @param wpStoreId web project store id
* @param userGroupRoles map of <authority name, role name> pairs
*/
public void inviteWebUsersGroups(String wpStoreId, Map<String, String> userGroupRoles);
/**
* Invite users/groups to web project
* <p>
* Note: authority name can be user or group, although a group is flattened into a set of users
*
* @param wpStoreId web project store id
* @param userGroupRoles map of <authority name, role name> pairs
* @param autoCreateAuthorSandbox if <tt>true</tt> then auto create an author sandbox for each invited user
*/
public void inviteWebUsersGroups(String wpStoreId, Map<String, String> userGroupRoles, boolean autoCreateAuthorSandbox);
/**
* Invite users/groups to web project
* <p>
* Note: authority name can be user or group, although a group is flattened into a set of users
*
* @param wpNodeRef web project node ref
* @param userGroupRoles map of <authority name, role name> pairs
* @param autoCreateAuthorSandbox if <tt>true</tt> then auto create the author sandbox for each invited user
*/
public void inviteWebUsersGroups(NodeRef wpNodeRef, Map<String, String> userGroupRoles, boolean autoCreateAuthorSandbox);
/**
* Invite user to web project
* <p>
* Note: author sandbox will NOT be auto created for each invited user
*
* @param wpStoreId web project store id
* @param userName user name (not a group)
* @param userRole web project role
*/
public void inviteWebUser(String wpStoreId, String userName, String userRole);
/**
* Invite user to web project
*
* @param wpStoreId web project store id
* @param userName user name (not a group)
* @param userRole web project role
* @param autoCreateAuthorSandbox if <tt>true</tt> then auto create the author sandbox for each invited user
*/
public void inviteWebUser(String wpStoreId, String userName, String userRole, boolean autoCreateAuthorSandbox);
/**
* Invite user to web project
*
* @param wpNodeRef web project node ref
* @param userName user name (not a group)
* @param userRole web project role
* @param autoCreateAuthorSandbox if <tt>true</tt> then auto create the author sandbox for each invited user
*/
public void inviteWebUser(NodeRef wpNodeRef, String userName, String userRole, boolean autoCreateAuthorSandbox);
/**
* Uninvite user from a web project
* <p>
* Note: author sandbox will NOT be auto deleted
*
* @param wpStoreId web project store id
* @param userName user name
*/
public void uninviteWebUser(String wpStoreId, String userName);
/**
* Uninvite user from a web project
* <p>
* Note: if author sandbox is auto deleted then this will cascade delete without warning (even if there are changed items)
*
* @param wpStoreId web project store id
* @param userName user name
* @param autoDeleteAuthorSandbox if <tt>true</tt> then auto delete the author sandbox
*/
public void uninviteWebUser(String wpStoreId, String userName, boolean autoDeleteAuthorSandbox);
/**
* Uninvite user from a web project
* <p>
* Note: if author sandbox is auto deleted then this will cascade delete without warning (even if there are changed items)
*
* @param wpNodeRef web project node ref
* @param userName user name
* @param autoDeleteAuthorSandbox if <tt>true</tt> then auto delete the author sandbox
*/
public void uninviteWebUser(NodeRef wpNodeRef, String userName, boolean autoDeleteAuthorSandbox);
}