com.xpn.xwiki.plugin.workspacesmanager
Class WorkspacesManagerExtension

java.lang.Object
  extended by com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl
      extended by com.xpn.xwiki.plugin.workspacesmanager.WorkspacesManagerExtension
All Implemented Interfaces:
com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension

public class WorkspacesManagerExtension
extends com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl

SpaceManager extension for Workspaces manager plugin

Version:
$Id: $

Field Summary
protected static org.apache.commons.logging.Log LOG
           
protected static java.util.Map roles
           
protected static java.lang.String WORKSPACE_EVENT_SPACE_CREATION_KEY
           
protected static java.lang.String WORKSPACE_PREFERENCES_SHEET
           
protected static java.lang.String WORKSPACE_ROLE_READER_CODE
           
protected static java.lang.String WORKSPACE_ROLE_READER_GROUP
           
protected static java.lang.String WORKSPACE_ROLE_READER_LEVELS
           
protected static java.lang.String WORKSPACE_ROLE_WRITER_CODE
           
protected static java.lang.String WORKSPACE_ROLE_WRITER_GROUP
           
protected static java.lang.String WORKSPACE_ROLE_WRITER_LEVELS
           
protected static java.lang.String WORKSPACE_SPACE_CLASS_NAME
           
protected static java.lang.String WORKSPACE_SPACE_TYPE
           
static java.lang.String XWIKI_SPACE_SEPARATOR
           
static java.lang.String XWIKI_WORKSPACE_APPSEPARATOR
           
 
Fields inherited from class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl
sm
 
Constructor Summary
WorkspacesManagerExtension()
           
 
Method Summary
protected  void addApplicationToSpace(java.lang.String appName, java.lang.String spaceName, com.xpn.xwiki.XWikiContext context)
          Install an application in the space, by copying or linking documents.
 java.lang.String getAdminGroupName(java.lang.String spaceName)
           
 java.lang.String getMemberGroupName(java.lang.String spaceName)
           
 java.lang.String getRoleGroupName(java.lang.String spaceName, java.lang.String roleName)
          
 java.lang.String getSpaceTypeName()
          
protected  com.xpn.xwiki.objects.classes.BaseClass getWorkspaceSpaceClass(com.xpn.xwiki.XWikiContext context)
          Returns the Workspace BaseClass, updating its definition if needed.
 java.lang.String getWorkspaceSpaceClassName()
           
 void init(com.xpn.xwiki.plugin.spacemanager.api.SpaceManager manager, com.xpn.xwiki.XWikiContext context)
          
 void makeSpacePrivate(java.lang.String spaceName, com.xpn.xwiki.XWikiContext context)
          Save the rights of a workspace to make it private : deny view right to XWiki.XWikiAllGroup and XWiki.XWikiGuest
 void makeSpacePublic(java.lang.String spaceName, com.xpn.xwiki.XWikiContext context)
          Save the rights of a workspace to make it private : deny view right to XWiki.XWikiGuest but allow view right to XWiki.XWikiAllGroup so that authenticated users can access the Workspace.
 void postCreateSpace(java.lang.String spaceName, com.xpn.xwiki.XWikiContext context)
          Operations executed after the actual Space creation.
 void postDeleteSpace(java.lang.String spaceName, boolean deleteData, com.xpn.xwiki.XWikiContext context)
          After space deletion by the spacemanager plugin (see SpaceManager.deleteSpace(String, boolean, XWikiContext), delete inherited spaces documents (Applications spaces documents) of the workspace.
protected  void prepareWorkspaceContent(java.lang.String spaceName, com.xpn.xwiki.XWikiContext context)
          Prepare a newly created Workspace by adding some document for it.
 void virtualInit(com.xpn.xwiki.plugin.spacemanager.api.SpaceManager manager, com.xpn.xwiki.XWikiContext context)
          
 
Methods inherited from class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl
getSpaceClassName, getSpaceUserProfilePageName, getSpaceWikiName, getSpaceWikiName, hasCustomMapping, preCreateSpace, preDeleteSpace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XWIKI_SPACE_SEPARATOR

public static final java.lang.String XWIKI_SPACE_SEPARATOR
See Also:
Constant Field Values

XWIKI_WORKSPACE_APPSEPARATOR

public static final java.lang.String XWIKI_WORKSPACE_APPSEPARATOR
See Also:
Constant Field Values

WORKSPACE_SPACE_TYPE

protected static final java.lang.String WORKSPACE_SPACE_TYPE
See Also:
Constant Field Values

WORKSPACE_SPACE_CLASS_NAME

protected static final java.lang.String WORKSPACE_SPACE_CLASS_NAME
See Also:
Constant Field Values

WORKSPACE_ROLE_READER_CODE

protected static final java.lang.String WORKSPACE_ROLE_READER_CODE
See Also:
Constant Field Values

WORKSPACE_ROLE_READER_LEVELS

protected static final java.lang.String WORKSPACE_ROLE_READER_LEVELS
See Also:
Constant Field Values

WORKSPACE_ROLE_READER_GROUP

protected static final java.lang.String WORKSPACE_ROLE_READER_GROUP
See Also:
Constant Field Values

WORKSPACE_ROLE_WRITER_CODE

protected static final java.lang.String WORKSPACE_ROLE_WRITER_CODE
See Also:
Constant Field Values

WORKSPACE_ROLE_WRITER_LEVELS

protected static final java.lang.String WORKSPACE_ROLE_WRITER_LEVELS
See Also:
Constant Field Values

WORKSPACE_ROLE_WRITER_GROUP

protected static final java.lang.String WORKSPACE_ROLE_WRITER_GROUP
See Also:
Constant Field Values

WORKSPACE_PREFERENCES_SHEET

protected static final java.lang.String WORKSPACE_PREFERENCES_SHEET
See Also:
Constant Field Values

WORKSPACE_EVENT_SPACE_CREATION_KEY

protected static final java.lang.String WORKSPACE_EVENT_SPACE_CREATION_KEY
See Also:
Constant Field Values

LOG

protected static final org.apache.commons.logging.Log LOG

roles

protected static java.util.Map roles
Constructor Detail

WorkspacesManagerExtension

public WorkspacesManagerExtension()
Method Detail

init

public void init(com.xpn.xwiki.plugin.spacemanager.api.SpaceManager manager,
                 com.xpn.xwiki.XWikiContext context)
          throws com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException

Specified by:
init in interface com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension
Overrides:
init in class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl
Throws:
com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException

virtualInit

public void virtualInit(com.xpn.xwiki.plugin.spacemanager.api.SpaceManager manager,
                        com.xpn.xwiki.XWikiContext context)
                 throws com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException

Specified by:
virtualInit in interface com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension
Overrides:
virtualInit in class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl
Throws:
com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException

getSpaceTypeName

public java.lang.String getSpaceTypeName()

Specified by:
getSpaceTypeName in interface com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension
Overrides:
getSpaceTypeName in class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl

getWorkspaceSpaceClassName

public java.lang.String getWorkspaceSpaceClassName()
Returns:
the name of the document that holds a Workspace XClass definition.

getMemberGroupName

public java.lang.String getMemberGroupName(java.lang.String spaceName)
Specified by:
getMemberGroupName in interface com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension
Overrides:
getMemberGroupName in class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl
Returns:
the full name of the document that holds the XWiki.XWikiGroups XObjects with all the workspace members

getAdminGroupName

public java.lang.String getAdminGroupName(java.lang.String spaceName)
Specified by:
getAdminGroupName in interface com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension
Overrides:
getAdminGroupName in class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl
Returns:
the full name of the document that holds the XWiki.XWikiGroups XObjects with all the workspace admins

getWorkspaceSpaceClass

protected com.xpn.xwiki.objects.classes.BaseClass getWorkspaceSpaceClass(com.xpn.xwiki.XWikiContext context)
                                                                  throws com.xpn.xwiki.XWikiException
Returns the Workspace BaseClass, updating its definition if needed.

Throws:
com.xpn.xwiki.XWikiException

getRoleGroupName

public java.lang.String getRoleGroupName(java.lang.String spaceName,
                                         java.lang.String roleName)

Specified by:
getRoleGroupName in interface com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension
Overrides:
getRoleGroupName in class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl

postCreateSpace

public void postCreateSpace(java.lang.String spaceName,
                            com.xpn.xwiki.XWikiContext context)
                     throws com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException
Operations executed after the actual Space creation. For a workspace, consist in intializing the space rights, according to its visivility, private or public, and publish the first story of its activity stream .

Specified by:
postCreateSpace in interface com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension
Overrides:
postCreateSpace in class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl
Throws:
com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException

postDeleteSpace

public void postDeleteSpace(java.lang.String spaceName,
                            boolean deleteData,
                            com.xpn.xwiki.XWikiContext context)
After space deletion by the spacemanager plugin (see SpaceManager.deleteSpace(String, boolean, XWikiContext), delete inherited spaces documents (Applications spaces documents) of the workspace.

Specified by:
postDeleteSpace in interface com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerExtension
Overrides:
postDeleteSpace in class com.xpn.xwiki.plugin.spacemanager.impl.SpaceManagerExtensionImpl
Parameters:
spaceName - the name of the root space (web) of the workspace for which to delete application data. This is the name present in the 'parent' field of the XWikiPreferences object of the application spaces (webs).
if - true, will delete the application documents, will do nothing otherwise.

prepareWorkspaceContent

protected void prepareWorkspaceContent(java.lang.String spaceName,
                                       com.xpn.xwiki.XWikiContext context)
                                throws com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException
Prepare a newly created Workspace by adding some document for it. Iterate over an application list, and for each application to install in the workspace, copy or link inside the workspace resources defined by the application object.

Throws:
com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException

makeSpacePrivate

public void makeSpacePrivate(java.lang.String spaceName,
                             com.xpn.xwiki.XWikiContext context)
                      throws WorkspacesManagerException
Save the rights of a workspace to make it private : deny view right to XWiki.XWikiAllGroup and XWiki.XWikiGuest

Throws:
WorkspacesManagerException

makeSpacePublic

public void makeSpacePublic(java.lang.String spaceName,
                            com.xpn.xwiki.XWikiContext context)
                     throws WorkspacesManagerException
Save the rights of a workspace to make it private : deny view right to XWiki.XWikiGuest but allow view right to XWiki.XWikiAllGroup so that authenticated users can access the Workspace.

Throws:
WorkspacesManagerException

addApplicationToSpace

protected void addApplicationToSpace(java.lang.String appName,
                                     java.lang.String spaceName,
                                     com.xpn.xwiki.XWikiContext context)
                              throws com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException
Install an application in the space, by copying or linking documents. Read the list of documents to include (link) and copy from the ApplicationManagerPlugin and save their content locally in a wiki space (web) composed of the space wiki name and the application name. Also make the application web inherits its rights from the space root space (web).

Parameters:
appName - the name of the application to install
spaceName - the wiki name of the space to install the application in
Throws:
com.xpn.xwiki.plugin.spacemanager.api.SpaceManagerException


Copyright © 2004-2008 XWiki. All Rights Reserved.