org.esupportail.portal.channels.CWebdav.channelAction.injac.metadata
Class InjacSpaceManagementProperties

java.lang.Object
  extended byorg.esupportail.portal.channels.CWebdav.channelAction.injac.metadata.InjacSpaceManagementProperties

public class InjacSpaceManagementProperties
extends java.lang.Object

Id: InjacSpaceManagementProperties.java,v 1.0 7 oct. 2004 Copyright (c) 2004 Esup Portail (www.esup-portail.org) Classes: InjacSpaceManagementProperties Original Author: Yohan Colmant Class used to manage an injac space


Field Summary
private  java.util.Vector addedReaderGroups
          the reader groups we want to add
private  java.util.Vector addedReaderUsers
          the reader users we want to add
private  java.util.ArrayList availableMetadataProfiles
          Available metadata profiles for this space
private  java.util.ArrayList availableRenderingTypes
          Available rendering types for this space
private  java.util.Vector deletedReaderGroups
          the reader groups we want to delete
private  java.util.Vector deletedReaderUsers
          the reader users we want to delete
private  java.lang.String description
          This space description
private  java.util.Vector editorGroups
          The editor groups
private  java.util.Vector editorUsers
          The editor users
protected static org.apache.commons.logging.Log log
          Logger object
private  java.util.Vector managerGroups
          The manager groups
private  java.util.Vector managerUsers
          The manager users
private  boolean publicReading
          If this space is public
private  java.util.Vector readerGroups
          The groups of readers
private  java.util.Vector readerUsers
          The users reader
private  org.esupportail.portal.utils.webdav.acl.EsupPermissions readingPermission
          The acl permissions for the readers
private  java.lang.String selectedMetadataProfile
          The selected metadata profile key
private  java.lang.String selectedRenderingType
          The selected rendering type key
private  java.util.Vector writerGroups
          The writer groups
private  java.util.Vector writerUsers
          The writer users
 
Constructor Summary
InjacSpaceManagementProperties(java.lang.String selectedMetadataProfile, java.lang.String selectedRenderingType, java.lang.String description, boolean publicReading, org.esupportail.portal.utils.webdav.acl.EsupPermissions readingPermission, java.util.Vector readerGroups, java.util.Vector readerUsers, java.util.Vector writerGroups, java.util.Vector writerUsers, java.util.Vector editorGroups, java.util.Vector editorUsers, java.util.Vector managerGroups, java.util.Vector managerUsers)
          Constructor
 
Method Summary
 java.util.Vector getAddedReaderGroups()
           
 java.util.Vector getAddedReaderUsers()
           
 java.util.ArrayList getAvailableMetadataProfiles()
           
 java.util.ArrayList getAvailableRenderingTypes()
           
 java.util.Vector getDeletedReaderGroups()
           
 java.util.Vector getDeletedReaderUsers()
           
 java.lang.String getDescription()
           
 java.util.Vector getEditorGroups()
           
 java.util.Vector getEditorUsers()
           
 java.util.Vector getManagerGroups()
           
 java.util.Vector getManagerUsers()
           
 java.lang.String getMetadataDescription()
          Return in the good format the MD description
 java.lang.String getMetadataEditorsOnSpace()
          Return in the good format the MD : list of editors on the space
 java.lang.String getMetadataManagersOnSpace()
          Return in the good format the MD : list of managers on the space
 java.lang.String getMetadataProfile()
          Return in the good format the list of MD that the user have to set
 java.lang.String getMetadataReadersOnSpace()
          Return in the good format the MD : list of readers on the space
 java.lang.String getMetadataWritersOnSpace()
          Return in the good format the MD : list of writers on the space
static InjacSpaceManagementProperties getProperties(ChannelConfiguration config, Space currentSpace, java.lang.String path)
          Get the properties sets on a space
 java.util.Vector getReaderGroups()
           
 java.util.Vector getReaderUsers()
           
 org.esupportail.portal.utils.webdav.acl.EsupPermissions getReadingPermission()
           
private  java.lang.StringBuffer getRoleOnSpace(java.util.Vector users, java.util.Vector groups, java.lang.String type)
          Return the list of roles in the good format
 java.lang.String getSelectedMetadataProfile()
           
 java.lang.String getSelectedRenderingType()
           
 java.util.Vector getWriterGroups()
           
 java.util.Vector getWriterUsers()
           
 boolean isPublicReading()
           
static boolean isUserEditor(java.lang.String login, java.util.Vector userGroups, ServerAccess access, java.lang.String path)
          Check if a user is editor on a space
static boolean isUserManager(java.lang.String login, java.util.Vector userGroups, ServerAccess access, java.lang.String path)
          Check if a user is manager on a space
static boolean isUserWriter(java.lang.String login, java.util.Vector userGroups, ServerAccess access, java.lang.String path)
          Check if a user is writer on a space
 void setDescription(java.lang.String description)
           
 void setPublicReading(boolean publicReading)
           
 void setReadingPermission(org.esupportail.portal.utils.webdav.acl.EsupPermissions readingPermission)
           
 void setSelectedMetadataProfile(java.lang.String selectedMetadataProfile)
           
 void setSelectedRenderingType(java.lang.String selectedRenderingType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Logger object


availableMetadataProfiles

private java.util.ArrayList availableMetadataProfiles
Available metadata profiles for this space


selectedMetadataProfile

private java.lang.String selectedMetadataProfile
The selected metadata profile key


availableRenderingTypes

private java.util.ArrayList availableRenderingTypes
Available rendering types for this space


selectedRenderingType

private java.lang.String selectedRenderingType
The selected rendering type key


description

private java.lang.String description
This space description


readerGroups

private java.util.Vector readerGroups
The groups of readers


readerUsers

private java.util.Vector readerUsers
The users reader


addedReaderUsers

private java.util.Vector addedReaderUsers
the reader users we want to add


addedReaderGroups

private java.util.Vector addedReaderGroups
the reader groups we want to add


deletedReaderUsers

private java.util.Vector deletedReaderUsers
the reader users we want to delete


deletedReaderGroups

private java.util.Vector deletedReaderGroups
the reader groups we want to delete


publicReading

private boolean publicReading
If this space is public


readingPermission

private org.esupportail.portal.utils.webdav.acl.EsupPermissions readingPermission
The acl permissions for the readers


writerGroups

private java.util.Vector writerGroups
The writer groups


writerUsers

private java.util.Vector writerUsers
The writer users


editorGroups

private java.util.Vector editorGroups
The editor groups


editorUsers

private java.util.Vector editorUsers
The editor users


managerGroups

private java.util.Vector managerGroups
The manager groups


managerUsers

private java.util.Vector managerUsers
The manager users

Constructor Detail

InjacSpaceManagementProperties

public InjacSpaceManagementProperties(java.lang.String selectedMetadataProfile,
                                      java.lang.String selectedRenderingType,
                                      java.lang.String description,
                                      boolean publicReading,
                                      org.esupportail.portal.utils.webdav.acl.EsupPermissions readingPermission,
                                      java.util.Vector readerGroups,
                                      java.util.Vector readerUsers,
                                      java.util.Vector writerGroups,
                                      java.util.Vector writerUsers,
                                      java.util.Vector editorGroups,
                                      java.util.Vector editorUsers,
                                      java.util.Vector managerGroups,
                                      java.util.Vector managerUsers)
                               throws PropertiesException
Constructor

Parameters:
selectedMetadataProfile - The selected metadata profile key
selectedRenderingType - The selected rendering type key
description - the space description
publicReading - is the space is public
readingPermission - the acl permission of reading
readerGroups - the reader groups
readerUsers - the reader users
writerGroups - the writer groups
writerUsers - the writer users
editorGroups - the editor groups
editorUsers - the editor users
managerGroups - the manager groups
managerUsers - the manager users
Throws:
PropertiesException
Method Detail

getReadingPermission

public org.esupportail.portal.utils.webdav.acl.EsupPermissions getReadingPermission()
Returns:
Returns the readingPermission.

setReadingPermission

public void setReadingPermission(org.esupportail.portal.utils.webdav.acl.EsupPermissions readingPermission)
Parameters:
readingPermission - The readingPermission to set.

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description to set.

isPublicReading

public boolean isPublicReading()
Returns:
Returns the publicReading.

setPublicReading

public void setPublicReading(boolean publicReading)
Parameters:
publicReading - The publicReading to set.

getReaderGroups

public java.util.Vector getReaderGroups()
Returns:
Returns the readerGroups.

getReaderUsers

public java.util.Vector getReaderUsers()
Returns:
Returns the readerUsers.

getDeletedReaderGroups

public java.util.Vector getDeletedReaderGroups()
Returns:
Returns the readerGroups.

getDeletedReaderUsers

public java.util.Vector getDeletedReaderUsers()
Returns:
Returns the readerUsers.

getAddedReaderGroups

public java.util.Vector getAddedReaderGroups()
Returns:
Returns the readerGroups.

getAddedReaderUsers

public java.util.Vector getAddedReaderUsers()
Returns:
Returns the readerUsers.

getEditorGroups

public java.util.Vector getEditorGroups()
Returns:
Returns the editorGroups.

getEditorUsers

public java.util.Vector getEditorUsers()
Returns:
Returns the editorUsers.

getManagerGroups

public java.util.Vector getManagerGroups()
Returns:
Returns the managerGroups.

getManagerUsers

public java.util.Vector getManagerUsers()
Returns:
Returns the managerUsers.

getWriterGroups

public java.util.Vector getWriterGroups()
Returns:
Returns the writerGroups.

getWriterUsers

public java.util.Vector getWriterUsers()
Returns:
Returns the writerUsers.

getSelectedMetadataProfile

public java.lang.String getSelectedMetadataProfile()
Returns:
Returns the selectedMetadataProfile.

setSelectedMetadataProfile

public void setSelectedMetadataProfile(java.lang.String selectedMetadataProfile)
Parameters:
selectedMetadataProfile - The selectedMetadataProfile to set.

getAvailableMetadataProfiles

public java.util.ArrayList getAvailableMetadataProfiles()
Returns:
Returns the availableMetadataProfiles.

getSelectedRenderingType

public java.lang.String getSelectedRenderingType()
Returns:
Returns the selectedRenderingType.

setSelectedRenderingType

public void setSelectedRenderingType(java.lang.String selectedRenderingType)
Parameters:
selectedRenderingType - The selectedRenderingType to set.

getAvailableRenderingTypes

public java.util.ArrayList getAvailableRenderingTypes()
Returns:
Returns the availableRenderingTypes.

getMetadataDescription

public java.lang.String getMetadataDescription()
Return in the good format the MD description

Returns:
in the good format the MD description

getMetadataProfile

public java.lang.String getMetadataProfile()
                                    throws ApplicationException,
                                           PropertiesException
Return in the good format the list of MD that the user have to set

Returns:
in the good format the list of MD that the user have to set
Throws:
ApplicationException
PropertiesException

getMetadataReadersOnSpace

public java.lang.String getMetadataReadersOnSpace()
Return in the good format the MD : list of readers on the space

Returns:
in the good format the MD : list of readers on the space

getMetadataWritersOnSpace

public java.lang.String getMetadataWritersOnSpace()
Return in the good format the MD : list of writers on the space

Returns:
in the good format the MD : list of writers on the space

getMetadataEditorsOnSpace

public java.lang.String getMetadataEditorsOnSpace()
Return in the good format the MD : list of editors on the space

Returns:
in the good format the MD : list of editors on the space

getMetadataManagersOnSpace

public java.lang.String getMetadataManagersOnSpace()
Return in the good format the MD : list of managers on the space

Returns:
in the good format the MD : list of managers on the space

getRoleOnSpace

private java.lang.StringBuffer getRoleOnSpace(java.util.Vector users,
                                              java.util.Vector groups,
                                              java.lang.String type)
Return the list of roles in the good format

Parameters:
users - the list of users
groups - the list of groups
type - the type of role: manager, writer, ...
Returns:
the list of roles in the good format

getProperties

public static InjacSpaceManagementProperties getProperties(ChannelConfiguration config,
                                                           Space currentSpace,
                                                           java.lang.String path)
                                                    throws ChannelException
Get the properties sets on a space

Parameters:
config - the channel configuration file access object
currentSpace - the current space
path - the resource path
Returns:
the properties sets on a space
Throws:
ChannelException

isUserManager

public static boolean isUserManager(java.lang.String login,
                                    java.util.Vector userGroups,
                                    ServerAccess access,
                                    java.lang.String path)
                             throws ServerException
Check if a user is manager on a space

Parameters:
login - the user login
userGroups - the groups of the user
access - the server access object
path - the resource path
Returns:
true if user is manager, false else
Throws:
ServerException

isUserWriter

public static boolean isUserWriter(java.lang.String login,
                                   java.util.Vector userGroups,
                                   ServerAccess access,
                                   java.lang.String path)
                            throws ServerException
Check if a user is writer on a space

Parameters:
login - the user login
userGroups - the groups of the user
access - the server access object
path - the resource path
Returns:
true is user is writer
Throws:
ServerException

isUserEditor

public static boolean isUserEditor(java.lang.String login,
                                   java.util.Vector userGroups,
                                   ServerAccess access,
                                   java.lang.String path)
                            throws ServerException
Check if a user is editor on a space

Parameters:
login - the user login
userGroups - the groups of the user
access - the server access object
path - the resource path
Returns:
true is user is editor
Throws:
ServerException