Class MainSessionController
- java.lang.Object
-
- org.silverpeas.core.web.mvc.controller.MainSessionController
-
- All Implemented Interfaces:
Serializable
,Clipboard
,SessionCloseable
public class MainSessionController extends Object implements Clipboard, SessionCloseable, Serializable
This object is used by all the components jsp that have access to the session. It is initialized given a login and a password which is authenticated. It provides functions to get information about the logged user (which is unique). It is also used to update the current environment of the user (current domain, current component).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
MAIN_SESSION_CONTROLLER_ATT
-
Constructor Summary
Constructors Modifier Constructor Description protected
MainSessionController()
Default constructor just for tests.MainSessionController(String authenticationKey, javax.servlet.http.HttpSession httpSession)
Creates a new instance ofMainSessionController
related to the user which has just connected to Silverpeas.MainSessionController(SessionInfo sessionInfo, javax.servlet.http.HttpSession httpSession)
Creates a new instance ofMainSessionController
related to the user already connected to Silverpeas.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(ClipboardSelection clipObject)
void
clear()
void
close()
The user session is being in close, close all resources relative to the session.ComponentContext
createComponentContext(String spaceId, String componentInstanceId)
Helper function.String
getComponentParameterValue(String sComponentId, String parameterName)
Return the value of the parameter for the given component and the given name of parameterint
getCount()
UserDetail
getCurrentUserDetail()
Return the UserDetail of the the current userException
getExceptionError()
String
getFavoriteLanguage()
Return the user's favorite languageString
getFavoriteLook()
Return the user's favorite languageString
getFavoriteSpace()
Return the user's favorite spaceZoneId
getFavoriteZoneId()
Return the user's favorite zone identifierjavax.servlet.http.HttpSession
getHttpSession()
static MainSessionController
getInstance(javax.servlet.http.HttpSession session)
Gets theMainSessionController
instance set in the current user session.String
getMessageError()
ClipboardSelection
getObject()
ClipboardSelection
getObject(int index)
Collection<ClipboardSelection>
getObjects()
UserPreferences
getPersonalization()
Return the personalization EJBCollection<ClipboardSelection>
getSelectedObjects()
Selection
getSelection()
String
getSessionId()
SubscriptionContext
getSubscriptionContext()
UserAccessLevel
getUserAccessLevel()
Return the user access level of the current userString[]
getUserAvailComponentIds()
Return the components ids available for the current userString
getUserId()
List<String>
getUserManageableGroupIds()
String[]
getUserManageableSpaceIds()
Return the spaces ids manageable by the current userboolean
isAllowPasswordChange()
static boolean
isAppInMaintenance()
boolean
isBackOfficeVisible()
boolean
isDragNDropEnabled()
boolean
isPDCBackOfficeVisible()
boolean
isSpaceInMaintenance(String spaceId)
boolean
isWebDAVEditingEnabled()
void
PasteDone()
void
removeObject(int index)
void
setAllowPasswordChange(boolean flag)
static void
setAppModeMaintenance(boolean mode)
void
setMessageError(String messageID, Exception e)
void
setMultiClipboard()
void
setSelected(int index, boolean setIt)
void
setSingleClipboard()
void
setSpaceModeMaintenance(String spaceId, boolean mode)
int
size()
-
-
-
Field Detail
-
MAIN_SESSION_CONTROLLER_ATT
public static final String MAIN_SESSION_CONTROLLER_ATT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MainSessionController
protected MainSessionController()
Default constructor just for tests.
-
MainSessionController
public MainSessionController(String authenticationKey, javax.servlet.http.HttpSession httpSession) throws org.silverpeas.kernel.SilverpeasException
Creates a new instance ofMainSessionController
related to the user which has just connected to Silverpeas.- Parameters:
authenticationKey
- the authentication key of the user.httpSession
- the http session.- Throws:
org.silverpeas.kernel.SilverpeasException
- if the user session is not open.
-
MainSessionController
public MainSessionController(SessionInfo sessionInfo, javax.servlet.http.HttpSession httpSession) throws org.silverpeas.kernel.SilverpeasException
Creates a new instance ofMainSessionController
related to the user already connected to Silverpeas.- Parameters:
sessionInfo
- an existing session info.httpSession
- the http session.- Throws:
org.silverpeas.kernel.SilverpeasException
- if the user session is not open.
-
-
Method Detail
-
getInstance
public static MainSessionController getInstance(javax.servlet.http.HttpSession session)
Gets theMainSessionController
instance set in the current user session. If the session doesn't refer any identified user, then null is returned.- Parameters:
session
- the current HTTP session- Returns:
- the
MainSessionController
instance attached to the current user session or null if there is no identified user in the current HTTP session.
-
isAppInMaintenance
public static boolean isAppInMaintenance()
-
setAppModeMaintenance
public static void setAppModeMaintenance(boolean mode)
-
isSpaceInMaintenance
public boolean isSpaceInMaintenance(String spaceId)
-
setSpaceModeMaintenance
public void setSpaceModeMaintenance(String spaceId, boolean mode)
-
getUserId
public String getUserId()
-
getHttpSession
public javax.servlet.http.HttpSession getHttpSession()
-
getSessionId
public String getSessionId()
-
getSelection
public Selection getSelection()
-
getSubscriptionContext
public SubscriptionContext getSubscriptionContext()
-
getPersonalization
public UserPreferences getPersonalization()
Return the personalization EJB
-
getFavoriteLanguage
public String getFavoriteLanguage()
Return the user's favorite language
-
getFavoriteZoneId
public ZoneId getFavoriteZoneId()
Return the user's favorite zone identifier
-
getFavoriteSpace
public String getFavoriteSpace()
Return the user's favorite space
-
getFavoriteLook
public String getFavoriteLook()
Return the user's favorite language
-
isWebDAVEditingEnabled
public boolean isWebDAVEditingEnabled()
-
isDragNDropEnabled
public boolean isDragNDropEnabled()
-
getUserAccessLevel
public UserAccessLevel getUserAccessLevel()
Return the user access level of the current user
-
getCurrentUserDetail
public UserDetail getCurrentUserDetail()
Return the UserDetail of the the current user
-
getComponentParameterValue
public String getComponentParameterValue(String sComponentId, String parameterName)
Return the value of the parameter for the given component and the given name of parameter
-
getUserAvailComponentIds
public String[] getUserAvailComponentIds()
Return the components ids available for the current user
-
getUserManageableSpaceIds
public String[] getUserManageableSpaceIds()
Return the spaces ids manageable by the current user
-
isBackOfficeVisible
public boolean isBackOfficeVisible()
-
isPDCBackOfficeVisible
public boolean isPDCBackOfficeVisible()
-
createComponentContext
public ComponentContext createComponentContext(String spaceId, String componentInstanceId)
Helper function. Create a new CurrentSessionControl object and fill it with the values of the current space Id and component instance Id passed in parameters
-
setAllowPasswordChange
public void setAllowPasswordChange(boolean flag)
-
isAllowPasswordChange
public boolean isAllowPasswordChange()
-
add
public void add(ClipboardSelection clipObject) throws ClipboardException
- Specified by:
add
in interfaceClipboard
- Throws:
ClipboardException
-
getObject
public ClipboardSelection getObject()
-
PasteDone
public void PasteDone() throws ClipboardException
- Specified by:
PasteDone
in interfaceClipboard
- Throws:
ClipboardException
-
getSelectedObjects
public Collection<ClipboardSelection> getSelectedObjects() throws ClipboardException
- Specified by:
getSelectedObjects
in interfaceClipboard
- Throws:
ClipboardException
-
getObjects
public Collection<ClipboardSelection> getObjects() throws ClipboardException
- Specified by:
getObjects
in interfaceClipboard
- Throws:
ClipboardException
-
size
public int size() throws ClipboardException
- Specified by:
size
in interfaceClipboard
- Throws:
ClipboardException
-
getObject
public ClipboardSelection getObject(int index) throws ClipboardException
- Specified by:
getObject
in interfaceClipboard
- Throws:
ClipboardException
-
setSelected
public void setSelected(int index, boolean setIt) throws ClipboardException
- Specified by:
setSelected
in interfaceClipboard
- Throws:
ClipboardException
-
removeObject
public void removeObject(int index) throws ClipboardException
- Specified by:
removeObject
in interfaceClipboard
- Throws:
ClipboardException
-
close
public void close()
Description copied from interface:SessionCloseable
The user session is being in close, close all resources relative to the session.- Specified by:
close
in interfaceSessionCloseable
-
setMultiClipboard
public void setMultiClipboard() throws ClipboardException
- Specified by:
setMultiClipboard
in interfaceClipboard
- Throws:
ClipboardException
-
setSingleClipboard
public void setSingleClipboard() throws ClipboardException
- Specified by:
setSingleClipboard
in interfaceClipboard
- Throws:
ClipboardException
-
getCount
public int getCount() throws ClipboardException
- Specified by:
getCount
in interfaceClipboard
- Throws:
ClipboardException
-
getMessageError
public String getMessageError() throws ClipboardException
- Specified by:
getMessageError
in interfaceClipboard
- Throws:
ClipboardException
-
getExceptionError
public Exception getExceptionError() throws ClipboardException
- Specified by:
getExceptionError
in interfaceClipboard
- Throws:
ClipboardException
-
setMessageError
public void setMessageError(String messageID, Exception e) throws ClipboardException
- Specified by:
setMessageError
in interfaceClipboard
- Throws:
ClipboardException
-
-