|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.esupportail.portal.channels.CStockage.spacesPersonalization.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 id,
java.lang.String serverName,
java.lang.String xmlServer,
java.lang.String fromKey)
Add sharing properties into the database |
int |
addStorageAvailableSpaceTarget(java.lang.String targetKey,
boolean targetIsUser,
boolean reading,
boolean writing,
boolean sharing,
java.lang.String serverId,
java.lang.String spaceKey,
boolean obliged)
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 |
delStorageAvailableSpaceTarget(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 |
getAdministratedSpaces()
Get the servers and spaces set into the administration database |
java.util.Vector |
getAvailableSpacesForTarget(java.lang.String targetKey,
boolean targetIsUser,
boolean obliged)
Get the available spaces for a group or a user |
java.util.Vector[] |
getIdAndXmlOfSharing(java.lang.String serverName)
Get the id of shared spaces from url and path |
java.util.Vector[] |
getIdOfSpacesWithServerName(java.lang.String serverName)
Get the id of shared spaces from url and path |
java.util.Vector |
getKeyOfSpacesFromPreferences(java.lang.String targetKey)
Get the list of ids of spaces which has already been selected by the current user |
java.util.Vector |
getTargetsOfAdministratedSpaces(java.lang.String idStorageAvailableSpaces,
java.lang.String spaceKey)
Get the targets set into the administration database |
java.util.Vector |
getTargetsOfAvailableSpace(java.lang.String serverName)
Get the users for whose the resource is shared |
private boolean |
isAlreadyAvailable(org.esupportail.portal.utils.database.Query queryManager,
java.lang.String serverId)
Check if the space is already shared for a specified user |
private boolean |
isAlreadyAvailableForTarget(org.esupportail.portal.utils.database.Query queryManager,
java.lang.String serverId,
java.lang.String targetKey,
boolean targetIsUser,
java.lang.String spaceKey)
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 |
updatePathOfSharing(java.lang.String serverName,
java.lang.String xml,
java.lang.String id)
Update the path of shared spaces |
int |
updateReadAndWriteAndShareSpace(boolean reading,
boolean writing,
boolean sharing,
boolean obliged,
java.lang.String id)
Update the "reading" and "writing" attributes for a specifical sharing |
int |
updateServerNameAvailableSpace(java.lang.String serverId,
java.lang.String newName)
Update the name of the server of the sharing properties into the database |
int |
updateXmlServerAvailableSpace(java.lang.String xmlServer,
java.lang.String id)
Update the label of the sharing properties into the database |
| 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 java.util.Vector getTargetsOfAvailableSpace(java.lang.String serverName)
throws DataBaseException
serverName - the name of the server
DataBaseException
private boolean isAlreadyAvailable(org.esupportail.portal.utils.database.Query queryManager,
java.lang.String serverId)
throws DataBaseException
queryManager - the query manager for the database accessserverId - the id of the server
DataBaseException
private boolean isAlreadyAvailableForTarget(org.esupportail.portal.utils.database.Query queryManager,
java.lang.String serverId,
java.lang.String targetKey,
boolean targetIsUser,
java.lang.String spaceKey)
throws DataBaseException
queryManager - the query manager for the database accessserverId - the id of the servertargetKey - 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 addStorageAvailableSpace(java.lang.String id,
java.lang.String serverName,
java.lang.String xmlServer,
java.lang.String fromKey)
throws DataBaseException
id - the id of the serverserverName - the name of the serverxmlServer - the server into an xml formatfromKey - the key of the people who shares
DataBaseException
public int addStorageAvailableSpaceTarget(java.lang.String targetKey,
boolean targetIsUser,
boolean reading,
boolean writing,
boolean sharing,
java.lang.String serverId,
java.lang.String spaceKey,
boolean obliged)
throws DataBaseException
targetKey - the key of the target usertargetIsUser - if the target is a user or notreading - if we have the reading rightswriting - if we have the writing rightssharing - if we have the sharing rightsserverId - theid of the serverspaceKey - the key of the spaceobliged - if we are obliged to see this space
DataBaseException
public int delStorageAvailableSpaceTarget(java.lang.String id)
throws DataBaseException
id - the space id
DataBaseException
public int delStorageAvailableSpace(java.lang.String id)
throws DataBaseException
id - the space id
DataBaseException
public int delStorageUsersPreferences(java.lang.String id)
throws DataBaseException
id - the id of the sharement in the other database
DataBaseException
public int updateReadAndWriteAndShareSpace(boolean reading,
boolean writing,
boolean sharing,
boolean obliged,
java.lang.String id)
throws DataBaseException
reading - the reading value 'T' or 'F'writing - the writing value 'T' or 'F'sharing - the manage value 'T' or 'F'obliged - the obliged value 'T' or 'F'id - the id of the server
DataBaseException
public int updateXmlServerAvailableSpace(java.lang.String xmlServer,
java.lang.String id)
throws DataBaseException
xmlServer - the xml of the serverid - the id of the server
DataBaseException
public java.util.Vector[] getIdOfSpacesWithServerName(java.lang.String serverName)
throws DataBaseException
serverName - the name of the server
DataBaseException
public java.util.Vector[] getIdAndXmlOfSharing(java.lang.String serverName)
throws DataBaseException
serverName - the name of the server
DataBaseException
public int updatePathOfSharing(java.lang.String serverName,
java.lang.String xml,
java.lang.String id)
throws DataBaseException
serverName - the name of the serverxml - the xml for the serverid - the name of the server
DataBaseException
public java.util.Vector getAvailableSpacesForTarget(java.lang.String targetKey,
boolean targetIsUser,
boolean obliged)
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 getKeyOfSpacesFromPreferences(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 java.util.Vector getAdministratedSpaces()
throws DataBaseException
DataBaseException
public java.util.Vector getTargetsOfAdministratedSpaces(java.lang.String idStorageAvailableSpaces,
java.lang.String spaceKey)
throws DataBaseException
idStorageAvailableSpaces - the id of storage targetspaceKey - the key of the space
DataBaseException
public int updateServerNameAvailableSpace(java.lang.String serverId,
java.lang.String newName)
throws DataBaseException
serverId - the id of the servernewName - the new name of the server administration
DataBaseException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||