|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.esupportail.portal.channels.CStockage.channelAction.classic.sharing.DataBaseAccess
Id: DataBaseAccess.java,v 1.0 13 janv. 2005 Copyright (c) 2005 Esup Portail (www.esup-portail.org) Classes: DataBaseAccess Original Author: Yohan Colmant This class manage the access to the database, for the sharing actions.
Field Summary | |
private static org.esupportail.portal.utils.database.Database |
dataBaseAccess
The database access object |
static boolean |
initialized
If the database parameters are still initialized |
protected static Log |
log
Logger object |
Constructor Summary | |
DataBaseAccess()
Constructor Initialize the parameters for a connexion to the database |
Method Summary | |
int |
addStorageAvailableSpace(java.lang.String serverUrl,
java.lang.String path,
java.lang.String label,
java.lang.String targetKey,
boolean targetIsUser,
java.lang.String ownerUserKey,
java.lang.String xmlSpace,
boolean reading,
boolean writing,
boolean manage)
Add sharing properties into the database |
int |
addStorageUsersPreferences(java.lang.String id,
java.lang.String userKey)
Add a user preference into the database |
int |
delStorageAvailableSpace(java.lang.String id)
Delete sharing properties into the database |
int |
delStorageUsersPreferences(java.lang.String id)
Delete users preferences for a shared space from the database |
int |
delStorageUsersPreferencesForUser(java.lang.String id,
java.lang.String userKey)
Delete a user preference from the database |
java.util.Vector |
getAvailableSpacesForTarget(java.lang.String targetKey,
boolean targetIsUser)
Get the available spaces for a group or a user |
java.util.Vector |
getIdOfSpaceFromPreferences(java.lang.String targetKey)
Get the list of ids of spaces which has already been selected by the current user |
java.util.Vector |
getIdOfSpacesWithPath(java.lang.String url,
java.lang.String path)
Get the id of shared spaces from url and path |
java.util.Vector |
getTargetsOfAvailableSpace(java.lang.String serverUrl,
java.lang.String path,
boolean targetIsUser)
Get the users for whose the resource is shared |
private boolean |
isAlreadyAvailableForTarget(org.esupportail.portal.utils.database.Query queryManager,
java.lang.String serverUrl,
java.lang.String path,
java.lang.String targetKey,
boolean targetIsUser)
Check if the space is already shared for a specified user |
private boolean |
isAlreadyInPreferencesForUser(org.esupportail.portal.utils.database.Query queryManager,
java.lang.String id,
java.lang.String userKey)
Check if the space is already in the user preferences |
int |
updateLabelAvailableSpace(java.lang.String newLabel,
java.lang.String serverUrl,
java.lang.String path)
Update the label of the sharing properties into the database |
int |
updatePathOfSharing(java.lang.String url,
java.lang.String oldPath,
java.lang.String newPath)
Update the path of shared spaces |
int |
updateReadAndWriteAndManageSpaceUser(boolean reading,
boolean writing,
boolean manage,
java.lang.String serverUrl,
java.lang.String path,
java.lang.String targetKey,
boolean targetIsUser)
Update the "reading" and "writing" attributes for a specifical sharing |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final Log log
public static boolean initialized
private static org.esupportail.portal.utils.database.Database dataBaseAccess
Constructor Detail |
public DataBaseAccess() throws PropertiesException
PropertiesException
Method Detail |
public int addStorageAvailableSpace(java.lang.String serverUrl, java.lang.String path, java.lang.String label, java.lang.String targetKey, boolean targetIsUser, java.lang.String ownerUserKey, java.lang.String xmlSpace, boolean reading, boolean writing, boolean manage) throws DataBaseException
serverUrl
- the url of the serverpath
- the resource pathlabel
- the space's labeltargetKey
- the key of the target userownerUserKey
- the key of the ownerxmlSpace
- the space into an xml formatreading
- if we have the reading rightswriting
- if we have the writing rightsmanage
- if we have the sharing rights
DataBaseException
public int delStorageAvailableSpace(java.lang.String id) throws DataBaseException
id
- the space id
DataBaseException
public java.util.Vector getTargetsOfAvailableSpace(java.lang.String serverUrl, java.lang.String path, boolean targetIsUser) throws DataBaseException
serverUrl
- the url of the serverpath
- the path of the resourcetargetIsUser
- to know if the target of this sharing is a user or not
DataBaseException
private boolean isAlreadyAvailableForTarget(org.esupportail.portal.utils.database.Query queryManager, java.lang.String serverUrl, java.lang.String path, java.lang.String targetKey, boolean targetIsUser) throws DataBaseException
queryManager
- the query manager for the database accessserverUrl
- the url of the serverpath
- the path of the resourcetargetKey
- the key of the user we want to checktargetIsUser
- to know if the target of this sharing is a user or not
DataBaseException
public int updateLabelAvailableSpace(java.lang.String newLabel, java.lang.String serverUrl, java.lang.String path) throws DataBaseException
newLabel
- the new label of the shared spacesserverUrl
- the url of the serverpath
- the resource path
DataBaseException
public int updateReadAndWriteAndManageSpaceUser(boolean reading, boolean writing, boolean manage, java.lang.String serverUrl, java.lang.String path, java.lang.String targetKey, boolean targetIsUser) throws DataBaseException
reading
- the reading value 'T' or 'F'writing
- the writing value 'T' or 'F'manage
- the manage value 'T' or 'F'serverUrl
- the url of the serverpath
- the resource pathtargetKey
- the key of the targettargetIsUser
- to know if the target of this sharing is a user or not
DataBaseException
public java.util.Vector getAvailableSpacesForTarget(java.lang.String targetKey, boolean targetIsUser) throws DataBaseException
targetKey
- the key of the targettargetIsUser
- to know if the target of this sharing is a user or not
DataBaseException
public int addStorageUsersPreferences(java.lang.String id, java.lang.String userKey) throws DataBaseException
id
- the id of the sharement in the other databaseuserKey
- the key of the user who wants to add preference into the database
DataBaseException
private boolean isAlreadyInPreferencesForUser(org.esupportail.portal.utils.database.Query queryManager, java.lang.String id, java.lang.String userKey) throws DataBaseException
queryManager
- the query manager to access the databaseid
- the id of the shared spaceuserKey
- the key of the user to check
DataBaseException
public java.util.Vector getIdOfSpaceFromPreferences(java.lang.String targetKey) throws DataBaseException
targetKey
- the user or group target key
DataBaseException
public int delStorageUsersPreferencesForUser(java.lang.String id, java.lang.String userKey) throws DataBaseException
id
- the id of the sharement in the other databaseuserKey
- the key of the user
DataBaseException
public int delStorageUsersPreferences(java.lang.String id) throws DataBaseException
id
- the id of the sharement in the other database
DataBaseException
public java.util.Vector getIdOfSpacesWithPath(java.lang.String url, java.lang.String path) throws DataBaseException
url
- the url of the spacepath
- the path of the space
DataBaseException
public int updatePathOfSharing(java.lang.String url, java.lang.String oldPath, java.lang.String newPath) throws DataBaseException
url
- the url of the spaceoldPath
- the old path of the spacenewPath
- the new path of the space
DataBaseException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |