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

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

public class MetaDataManager
extends java.lang.Object

Id: MetaDataManager.java,v 1.0 30 sept. 2004 Copyright (c) 2004 Esup Portail (www.esup-portail.org) Classes: MetaDataManager Original Author: Yohan Colmant A tool metadata manager


Field Summary
protected static org.apache.commons.logging.Log log
          Logger object
 
Constructor Summary
MetaDataManager()
           
 
Method Summary
static java.lang.String getDirectoryType(ServerAccess access, java.lang.String path)
          Get the directory type (document, space, ... ?)
static java.lang.String getDocumentOwner(ServerAccess access, java.lang.String path)
          Get the owner of a document
static java.lang.String getDocumentState(ServerAccess access, java.lang.String path)
          Get the document state: published, refused, waiting, expired...
static java.lang.String getMetadataDescription(ServerAccess access, java.lang.String path)
          Return in the MD description
static void getMetadataEditorsOnSpace(ServerAccess access, java.lang.String path, java.util.Vector users, java.util.Vector groups)
          Return the MD : list of editors on the space
static void getMetadataManagersOnSpace(ServerAccess access, java.lang.String path, java.util.Vector users, java.util.Vector groups)
          Return the MD : list of managers on the space
static java.lang.String getMetadataRenderingType(ServerAccess access, java.lang.String path)
          Return the rendering type MD that the user have to set
static java.lang.String getMetadataSpaceProfile(ServerAccess access, java.lang.String path)
          Return the list of MD that the user have to set
static void getMetadataWritersOnSpace(ServerAccess access, java.lang.String path, java.util.Vector users, java.util.Vector groups)
          Return the MD : list of writers on the space
static java.util.Date getPublicationDateBegin(ServerAccess access, java.lang.String path)
          Get the publication date begin
static java.util.Date getPublicationDateEnd(ServerAccess access, java.lang.String path)
          Get the publication date end
static java.lang.String getRejectCause(ServerAccess access, java.lang.String path)
          Get the refuse message
private static boolean parseXmlUser(java.lang.String property, java.util.Vector users, java.util.Vector groups)
          Parse the Metadata containing users and groups for a role
static boolean setDirectoryAsPublishedDocument(ServerAccess access, java.lang.String path)
          Set the injac-type metadata of the directory specified by its path to "document" value, and document-state to "published"
static boolean setDirectoryAsRejectedDocument(ServerAccess access, java.lang.String path)
          Set the injac-type metadata of the directory specified by its path to "document" value, and document-state to "refused"
static boolean setDirectoryAsSpace(ServerAccess access, java.lang.String path)
          Set the injac-type metadata of the directory specified by its path to "space" value
static boolean setDirectoryAsWaitingDocument(ServerAccess access, java.lang.String path)
          Set the injac-type metadata of the directory specified by its path to "document" value, and document-state to "waiting"
static boolean setMetadataOnDocument(ServerAccess access, java.lang.String path, java.util.ArrayList metadataToSet)
          Set the metadata set by user on a document
static boolean setMetadataOnSpace(ServerAccess access, java.lang.String path, InjacSpaceManagementProperties smp)
          Set the metadata set by manager on a space
static boolean setUserAsDocumentOwner(ServerAccess access, java.lang.String path, java.lang.String value)
          Set the owner of a document
 
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

Constructor Detail

MetaDataManager

public MetaDataManager()
Method Detail

getDocumentOwner

public static java.lang.String getDocumentOwner(ServerAccess access,
                                                java.lang.String path)
                                         throws ServerException
Get the owner of a document

Parameters:
access - to access the server
path - the resource path
Returns:
the type of the resource
Throws:
ServerException

setUserAsDocumentOwner

public static boolean setUserAsDocumentOwner(ServerAccess access,
                                             java.lang.String path,
                                             java.lang.String value)
                                      throws ServerException
Set the owner of a document

Parameters:
access - to access the server
path - the resource path
value - the MD value
Returns:
true if well done, else false
Throws:
ServerException

getDirectoryType

public static java.lang.String getDirectoryType(ServerAccess access,
                                                java.lang.String path)
                                         throws ServerException
Get the directory type (document, space, ... ?)

Parameters:
access - to access the server
path - the resource path
Returns:
the type of the resource
Throws:
ServerException

getPublicationDateBegin

public static java.util.Date getPublicationDateBegin(ServerAccess access,
                                                     java.lang.String path)
                                              throws ServerException
Get the publication date begin

Parameters:
access - to access the server
path - the resource path
Returns:
the date, null if no date
Throws:
ServerException

getPublicationDateEnd

public static java.util.Date getPublicationDateEnd(ServerAccess access,
                                                   java.lang.String path)
                                            throws ServerException
Get the publication date end

Parameters:
access - to access the server
path - the resource path
Returns:
the date, null if no date
Throws:
ServerException

getRejectCause

public static java.lang.String getRejectCause(ServerAccess access,
                                              java.lang.String path)
                                       throws ServerException
Get the refuse message

Parameters:
access - to access the server
path - the resource path
Returns:
the type of the resource
Throws:
ServerException

getDocumentState

public static java.lang.String getDocumentState(ServerAccess access,
                                                java.lang.String path)
                                         throws ServerException
Get the document state: published, refused, waiting, expired...

Parameters:
access - to access the server
path - the resource path
Returns:
the type of the resource
Throws:
ServerException

setDirectoryAsSpace

public static boolean setDirectoryAsSpace(ServerAccess access,
                                          java.lang.String path)
                                   throws ServerException
Set the injac-type metadata of the directory specified by its path to "space" value

Parameters:
access - to access the server
path - the resource path
Returns:
true if well done
Throws:
ServerException

setDirectoryAsWaitingDocument

public static boolean setDirectoryAsWaitingDocument(ServerAccess access,
                                                    java.lang.String path)
                                             throws ServerException
Set the injac-type metadata of the directory specified by its path to "document" value, and document-state to "waiting"

Parameters:
access - to access the server
path - the resource path
Returns:
true if well done
Throws:
ServerException

setDirectoryAsPublishedDocument

public static boolean setDirectoryAsPublishedDocument(ServerAccess access,
                                                      java.lang.String path)
                                               throws ServerException
Set the injac-type metadata of the directory specified by its path to "document" value, and document-state to "published"

Parameters:
access - to access the server
path - the resource path
Returns:
true if well done
Throws:
ServerException

setDirectoryAsRejectedDocument

public static boolean setDirectoryAsRejectedDocument(ServerAccess access,
                                                     java.lang.String path)
                                              throws ServerException
Set the injac-type metadata of the directory specified by its path to "document" value, and document-state to "refused"

Parameters:
access - to access the server
path - the resource path
Returns:
true if well done
Throws:
ServerException

setMetadataOnSpace

public static boolean setMetadataOnSpace(ServerAccess access,
                                         java.lang.String path,
                                         InjacSpaceManagementProperties smp)
                                  throws ServerException,
                                         ApplicationException,
                                         PropertiesException
Set the metadata set by manager on a space

Parameters:
access - to access the server
path - the resource path
smp - object containing all properties
Returns:
true if well done, else false
Throws:
ServerException
ApplicationException
PropertiesException

setMetadataOnDocument

public static boolean setMetadataOnDocument(ServerAccess access,
                                            java.lang.String path,
                                            java.util.ArrayList metadataToSet)
                                     throws ServerException
Set the metadata set by user on a document

Parameters:
access - to access the server
path - the resource path
metadataToSet - object containing all properties
Returns:
true if well done, else false
Throws:
ServerException

getMetadataDescription

public static java.lang.String getMetadataDescription(ServerAccess access,
                                                      java.lang.String path)
                                               throws ServerException
Return in the MD description

Parameters:
access - to access the file server
path - the resource path
Returns:
the MD description
Throws:
ServerException

getMetadataSpaceProfile

public static java.lang.String getMetadataSpaceProfile(ServerAccess access,
                                                       java.lang.String path)
                                                throws ServerException
Return the list of MD that the user have to set

Parameters:
access - to access the file server
path - the resource path
Returns:
the list of MD that the user have to set
Throws:
ServerException

getMetadataRenderingType

public static java.lang.String getMetadataRenderingType(ServerAccess access,
                                                        java.lang.String path)
                                                 throws ServerException
Return the rendering type MD that the user have to set

Parameters:
access - to access the file server
path - the resource path
Returns:
the rendering type MD that the user have to set
Throws:
ServerException

parseXmlUser

private static boolean parseXmlUser(java.lang.String property,
                                    java.util.Vector users,
                                    java.util.Vector groups)
Parse the Metadata containing users and groups for a role

Parameters:
property - the property value
users - users completing in this method
groups - groups completing in this method
Returns:
true if public user, false else

getMetadataWritersOnSpace

public static void getMetadataWritersOnSpace(ServerAccess access,
                                             java.lang.String path,
                                             java.util.Vector users,
                                             java.util.Vector groups)
                                      throws ServerException
Return the MD : list of writers on the space

Parameters:
access - the server access object
path - the resource path
users - the users list to set
groups - the groups list to set
Throws:
ServerException

getMetadataEditorsOnSpace

public static void getMetadataEditorsOnSpace(ServerAccess access,
                                             java.lang.String path,
                                             java.util.Vector users,
                                             java.util.Vector groups)
                                      throws ServerException
Return the MD : list of editors on the space

Parameters:
access - the server access object
path - the resource path
users - the users list to set
groups - the groups list to set
Throws:
ServerException

getMetadataManagersOnSpace

public static void getMetadataManagersOnSpace(ServerAccess access,
                                              java.lang.String path,
                                              java.util.Vector users,
                                              java.util.Vector groups)
                                       throws ServerException
Return the MD : list of managers on the space

Parameters:
access - the server access object
path - the resource path
users - the users list to set
groups - the groups list to set
Throws:
ServerException