com.stratelia.silverpeas.peasCore
Class AbstractComponentSessionController

java.lang.Object
  extended by com.stratelia.silverpeas.peasCore.AbstractComponentSessionController
All Implemented Interfaces:
ComponentSessionController
Direct Known Subclasses:
AgendaSessionController, AlertUserPeasSessionController, ClipboardSessionController, CommunicationUserSessionController, DirectorySessionController, FileSharingSessionController, FormTemplateSessionController, GenericPanelPeasSessionController, ImportExportSessionController, InterestCenterSessionController, JobDomainPeasSessionController, JobManagerPeasSessionController, JobOrganizationPeasSessionController, JobSearchPeasSessionController, JobStartPagePeasSessionController, MyContactProfilSessionController, MyLinksPeasSessionController, MyProfilSessionController, NotificationUserSessionController, PdcClassifySessionController, PdcSearchSessionController, PdcSessionController, PdcSubscriptionSessionController, PdcUtilizationSessionController, PersonalizationSessionController, POPUPSessionController, ProfilSessionController, SelectionPeasSessionController, SelectionPeasWrapperSessionController, SILVERMAILSessionController, SilverStatisticsPeasSessionController, SubscriptionSessionController, TemplateDesignerSessionController, ThesaurusSessionController, ThumbnailSessionController, ToDoSessionController, VersioningSessionController, WebComponentController, WebConnectionsSessionController, WorkflowDesignerSessionController

public class AbstractComponentSessionController
extends Object
implements ComponentSessionController

Base class for all component session controller.


Field Summary
static String CHARACTER_ENCODING
          The default character encoded supported by Silverpeas.
protected  ComponentContext context
           
 
Constructor Summary
AbstractComponentSessionController(MainSessionController controller, ComponentContext context)
          Constructor declaration
AbstractComponentSessionController(MainSessionController controller, ComponentContext context, String resourceFileName)
          Constructor declaration
AbstractComponentSessionController(MainSessionController controller, ComponentContext context, String multilangFileName, String iconFileName)
           
AbstractComponentSessionController(MainSessionController controller, ComponentContext context, String multilangFileName, String iconFileName, String settingsFileName)
           
AbstractComponentSessionController(MainSessionController controller, String spaceId, String componentId)
          Constructor declaration
 
Method Summary
 void addClipboardSelection(ClipboardSelection selection)
           
 void clipboardPasteDone()
           
 void close()
           
 AlertUser getAlertUser()
           
 Integer getClipboardCount()
           
 String getClipboardErrorMessage()
           
 Exception getClipboardExceptionError()
           
 String getClipboardName()
           
 Collection<ClipboardSelection> getClipboardObjects()
           
 Collection<ClipboardSelection> getClipboardSelectedObjects()
           
 int getClipboardSize()
           
protected  ComponentAccessController getComponentAccessController()
           
 String getComponentId()
          Return the unique identifier of the current component.
 String getComponentLabel()
          Gets the label of the current used component (as known by the user).
 String getComponentName()
          Return the name of the component (as specified in the xmlComponent)
 List<Parameter> getComponentParameters()
          Gets the parameters for the current component instance.
 String getComponentParameterValue(ComponentInstanceParameterName parameterName)
          Gets the value of the specified current component's parameter.
 String getComponentParameterValue(String parameterName)
          Gets the value of the specified current component's parameter.
 String getComponentRootName()
          return the component Root name : i.e.
 String getComponentUrl()
          Gets the URL at which is located the current selected component.
 String getFavoriteSpace()
           
 GenericPanel getGenericPanel(String panelKey)
           
 SilverpeasRole getHighestSilverpeasUserRole()
          Gets the highest role the user has on the component.
 ResourceLocator getIcon()
           
 String getLanguage()
          Gets the main language of the user.
 List<GlobalSilverContent> getLastResults()
           
 String getLook()
          Gets the identifier of the user website look.
 ResourceLocator getMultilang()
           
 OrganisationController getOrganisationController()
          Method declaration
 UserPreferences getPersonalization()
           
 String getRSSUrl()
           
 Selection getSelection()
           
 String getServerNameAndPort()
           
 ResourceLocator getSettings()
           
 Collection<SilverpeasRole> getSilverpeasUserRoles()
          Gets the roles the user has on the component.
 String getSpaceId()
          Gets the unique identifier of the current selected workspace.
 String getSpaceLabel()
          Gets the space label (as known by the user).
 String getString(String resName)
          Method declaration
 SubscriptionContext getSubscriptionContext()
           
protected  String getUrlEncodedParameter(String param)
          Gets the URL encoded representation of the specified parameter.
 UserAccessLevel getUserAccessLevel()
           
 String[] getUserAvailComponentIds()
          Gets the user's available components.
 String[] getUserAvailSpaceIds()
          Gets the user's available workspace.
 UserDetail getUserDetail()
          Gets details on the connected current user.
 UserDetail getUserDetail(String userId)
           
 String getUserId()
          Gets the unique identifier of the current connected user.
 List<String> getUserManageableGroupIds()
           
 String[] getUserManageableSpaceIds()
           
 String getUserRoleLevel()
          Deprecated. 
 String[] getUserRoles()
          Deprecated. 
 boolean isAppInMaintenance()
           
 boolean isGroupManager()
           
 boolean isPasswordChangeAllowed()
           
 boolean isSpaceInMaintenance(String spaceId)
           
 void removeClipboardElement(int index)
           
 void setAppModeMaintenance(boolean mode)
           
 void setClipboardError(String messageId, Exception ex)
           
 void setClipboardSelectedElement(int index, boolean selected)
           
protected  void setComponentRootName(String newRootName)
          Sets the component root name : i.e.
 void setFavoriteSpaceToMainSessionController(String newSpace)
          The utilization of this method is allowed only for PersonalizationSessionController
 void setGenericPanel(String panelKey, GenericPanel panel)
           
 void setIconFileName(String iconFileName)
          Sets the icon file by its name.
 void setLastResults(List<GlobalSilverContent> results)
           
 void setMultilangFileName(String multilangFileName)
          Method declaration
 void setResourceFileName(String resourceFileName)
          Method declaration
 void setSpaceModeMaintenance(String spaceId, boolean mode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHARACTER_ENCODING

public static final String CHARACTER_ENCODING
The default character encoded supported by Silverpeas.

See Also:
Constant Field Values

context

protected ComponentContext context
Constructor Detail

AbstractComponentSessionController

public AbstractComponentSessionController(MainSessionController controller,
                                          String spaceId,
                                          String componentId)
Constructor declaration

Parameters:
controller -
spaceId -
componentId -
See Also:

AbstractComponentSessionController

public AbstractComponentSessionController(MainSessionController controller,
                                          ComponentContext context)
Constructor declaration

Parameters:
controller -
context -
See Also:

AbstractComponentSessionController

public AbstractComponentSessionController(MainSessionController controller,
                                          ComponentContext context,
                                          String resourceFileName)
Constructor declaration

Parameters:
controller -
context -
resourceFileName -
See Also:

AbstractComponentSessionController

public AbstractComponentSessionController(MainSessionController controller,
                                          ComponentContext context,
                                          String multilangFileName,
                                          String iconFileName)

AbstractComponentSessionController

public AbstractComponentSessionController(MainSessionController controller,
                                          ComponentContext context,
                                          String multilangFileName,
                                          String iconFileName,
                                          String settingsFileName)
Method Detail

getMultilang

public ResourceLocator getMultilang()
Specified by:
getMultilang in interface ComponentSessionController

getIcon

public ResourceLocator getIcon()
Specified by:
getIcon in interface ComponentSessionController

getSettings

public ResourceLocator getSettings()
Specified by:
getSettings in interface ComponentSessionController

setMultilangFileName

public final void setMultilangFileName(String multilangFileName)
Method declaration

Parameters:
multilangFileName -

setIconFileName

public final void setIconFileName(String iconFileName)
Sets the icon file by its name. The icon file is a file in which is stored the icon that represents the underlying Silverpeas component this controller works with.

Parameters:
iconFileName - the name of the icon file.

setResourceFileName

public final void setResourceFileName(String resourceFileName)
Method declaration

Parameters:
resourceFileName -
See Also:

getString

public String getString(String resName)
Method declaration

Parameters:
resName -
Returns:
See Also:

getOrganisationController

public OrganisationController getOrganisationController()
Method declaration

Specified by:
getOrganisationController in interface ComponentSessionController
Returns:
See Also:

getLanguage

public String getLanguage()
Gets the main language of the user.

Specified by:
getLanguage in interface ComponentSessionController
Returns:
the user language code.

getFavoriteSpace

public String getFavoriteSpace()

setFavoriteSpaceToMainSessionController

public void setFavoriteSpaceToMainSessionController(String newSpace)
The utilization of this method is allowed only for PersonalizationSessionController

Parameters:
newSpace - the new user favorite space.

getLook

public String getLook()
Gets the identifier of the user website look.

Returns:
the user favorite look name.

getUserDetail

public UserDetail getUserDetail()
Gets details on the connected current user.

Specified by:
getUserDetail in interface ComponentSessionController
Returns:
the UserDetail information about the current user.

getUserDetail

public UserDetail getUserDetail(String userId)

getUserId

public String getUserId()
Gets the unique identifier of the current connected user.

Specified by:
getUserId in interface ComponentSessionController
Returns:
the user identifier.

getSpaceLabel

public String getSpaceLabel()
Gets the space label (as known by the user).

Specified by:
getSpaceLabel in interface ComponentSessionController
Returns:
the space label.

getSpaceId

public String getSpaceId()
Gets the unique identifier of the current selected workspace.

Specified by:
getSpaceId in interface ComponentSessionController
Returns:
the space identifier.

getComponentName

public String getComponentName()
Description copied from interface: ComponentSessionController
Return the name of the component (as specified in the xmlComponent)

Specified by:
getComponentName in interface ComponentSessionController

getComponentLabel

public final String getComponentLabel()
Gets the label of the current used component (as known by the user).

Specified by:
getComponentLabel in interface ComponentSessionController
Returns:
the component label.

getComponentId

public final String getComponentId()
Return the unique identifier of the current component.

Specified by:
getComponentId in interface ComponentSessionController
Returns:
the current component identifier.

getComponentUrl

public final String getComponentUrl()
Gets the URL at which is located the current selected component. Warning: For old components' use ONLY! (use it in the jsp:forward lines).

Specified by:
getComponentUrl in interface ComponentSessionController
Returns:
the current component URL.

getComponentRootName

public final String getComponentRootName()
return the component Root name : i.e. 'agenda', 'todo', 'kmelia', .... (the name that appears in the URL's root (the 'R' prefix is added later when needed))

Returns:
the component root name.

setComponentRootName

protected final void setComponentRootName(String newRootName)
Sets the component root name : i.e. 'agenda', 'todo', 'kmelia', .... (the name that appears in the URL's root (the 'R' prefix is added later when needed)) this function is called by the class of non-instanciable components the inherits from this class

Parameters:
newRootName - the new root component.

getComponentParameters

public List<Parameter> getComponentParameters()
Gets the parameters for the current component instance.

Specified by:
getComponentParameters in interface ComponentSessionController
Returns:
a list of current component parameters.

getComponentParameterValue

public String getComponentParameterValue(String parameterName)
Gets the value of the specified current component's parameter.

Specified by:
getComponentParameterValue in interface ComponentSessionController
Parameters:
parameterName - the name of the parameter to get.
Returns:
the value of the parameter.

getComponentParameterValue

public String getComponentParameterValue(ComponentInstanceParameterName parameterName)
Gets the value of the specified current component's parameter.

Specified by:
getComponentParameterValue in interface ComponentSessionController
Parameters:
parameterName - the name (centralized) of the parameter to get.
Returns:
the value of the parameter.

getUserAvailComponentIds

public String[] getUserAvailComponentIds()
Gets the user's available components.

Specified by:
getUserAvailComponentIds in interface ComponentSessionController
Returns:
an array with all available component identifiers.

getUserAvailSpaceIds

public String[] getUserAvailSpaceIds()
Gets the user's available workspace.

Specified by:
getUserAvailSpaceIds in interface ComponentSessionController
Returns:
an array with all available spaces identifiers.

getUserManageableSpaceIds

public String[] getUserManageableSpaceIds()

getUserManageableGroupIds

public List<String> getUserManageableGroupIds()

isGroupManager

public boolean isGroupManager()

getUserRoles

@Deprecated
public String[] getUserRoles()
Deprecated. 

Gets all of the roles the current user plays in Silverpeas.

Specified by:
getUserRoles in interface ComponentSessionController
Returns:
an array with all the user role names.

getUserRoleLevel

@Deprecated
public String getUserRoleLevel()
Deprecated. 

Gets the highest privileged role the current user can play (administrator, publisher or user).

Specified by:
getUserRoleLevel in interface ComponentSessionController
Returns:
the highest privileged role name of the current user.

getSilverpeasUserRoles

public Collection<SilverpeasRole> getSilverpeasUserRoles()
Description copied from interface: ComponentSessionController
Gets the roles the user has on the component.

Specified by:
getSilverpeasUserRoles in interface ComponentSessionController
Returns:
a list of user roles.

getHighestSilverpeasUserRole

public SilverpeasRole getHighestSilverpeasUserRole()
Description copied from interface: ComponentSessionController
Gets the highest role the user has on the component.

Specified by:
getHighestSilverpeasUserRole in interface ComponentSessionController
Returns:
a user role.

getPersonalization

public UserPreferences getPersonalization()
Specified by:
getPersonalization in interface ComponentSessionController

getUserAccessLevel

public UserAccessLevel getUserAccessLevel()

setGenericPanel

public void setGenericPanel(String panelKey,
                            GenericPanel panel)

getGenericPanel

public GenericPanel getGenericPanel(String panelKey)

getSelection

public Selection getSelection()

getSubscriptionContext

public SubscriptionContext getSubscriptionContext()

getAlertUser

public AlertUser getAlertUser()

isAppInMaintenance

public boolean isAppInMaintenance()
Specified by:
isAppInMaintenance in interface ComponentSessionController

setAppModeMaintenance

public void setAppModeMaintenance(boolean mode)
Specified by:
setAppModeMaintenance in interface ComponentSessionController

isSpaceInMaintenance

public boolean isSpaceInMaintenance(String spaceId)
Specified by:
isSpaceInMaintenance in interface ComponentSessionController

setSpaceModeMaintenance

public void setSpaceModeMaintenance(String spaceId,
                                    boolean mode)
Specified by:
setSpaceModeMaintenance in interface ComponentSessionController

getServerNameAndPort

public String getServerNameAndPort()

getLastResults

public List<GlobalSilverContent> getLastResults()

setLastResults

public void setLastResults(List<GlobalSilverContent> results)

close

public void close()

isPasswordChangeAllowed

public boolean isPasswordChangeAllowed()

getRSSUrl

public String getRSSUrl()

getUrlEncodedParameter

protected String getUrlEncodedParameter(String param)
Gets the URL encoded representation of the specified parameter.

Parameters:
param - the parameter.
Returns:
a URL encoded representation of the parameter.

getClipboardSelectedObjects

public Collection<ClipboardSelection> getClipboardSelectedObjects()
                                                           throws ClipboardException
Specified by:
getClipboardSelectedObjects in interface ComponentSessionController
Throws:
ClipboardException

getClipboardErrorMessage

public String getClipboardErrorMessage()
                                throws ClipboardException
Specified by:
getClipboardErrorMessage in interface ComponentSessionController
Throws:
ClipboardException

getClipboardExceptionError

public Exception getClipboardExceptionError()
                                     throws ClipboardException
Specified by:
getClipboardExceptionError in interface ComponentSessionController
Throws:
ClipboardException

getClipboardObjects

public Collection<ClipboardSelection> getClipboardObjects()
                                                   throws ClipboardException
Specified by:
getClipboardObjects in interface ComponentSessionController
Throws:
ClipboardException

addClipboardSelection

public void addClipboardSelection(ClipboardSelection selection)
                           throws ClipboardException
Specified by:
addClipboardSelection in interface ComponentSessionController
Throws:
ClipboardException

getClipboardName

public String getClipboardName()
Specified by:
getClipboardName in interface ComponentSessionController

getClipboardCount

public Integer getClipboardCount()
                          throws ClipboardException
Specified by:
getClipboardCount in interface ComponentSessionController
Throws:
ClipboardException

clipboardPasteDone

public void clipboardPasteDone()
                        throws ClipboardException
Specified by:
clipboardPasteDone in interface ComponentSessionController
Throws:
ClipboardException

setClipboardSelectedElement

public void setClipboardSelectedElement(int index,
                                        boolean selected)
                                 throws ClipboardException
Specified by:
setClipboardSelectedElement in interface ComponentSessionController
Throws:
ClipboardException

getClipboardSize

public int getClipboardSize()
                     throws ClipboardException
Specified by:
getClipboardSize in interface ComponentSessionController
Throws:
ClipboardException

removeClipboardElement

public void removeClipboardElement(int index)
                            throws ClipboardException
Specified by:
removeClipboardElement in interface ComponentSessionController
Throws:
ClipboardException

setClipboardError

public void setClipboardError(String messageId,
                              Exception ex)
                       throws ClipboardException
Specified by:
setClipboardError in interface ComponentSessionController
Throws:
ClipboardException

getComponentAccessController

protected ComponentAccessController getComponentAccessController()


Copyright © 2016 Silverpeas. All Rights Reserved.