Package org.sakaiproject.portal.api
Interface PortalService
-
public interface PortalServicePortal Service acts as a focus for all Portal based activities, the service implementation should act as a holder to enable the varous webapps to communicate with one annother.- Since:
- Sakai 2.4
- Version:
- $Rev$
- Author:
- ieb
-
-
Field Summary
Fields Modifier and Type Field Description static StringPLACEMENT_ATTRIBUTEA portal request scope attribute that reprenset the placement id of the current request.static StringSAKAI_CONTROLLING_PORTALthis is the property in session to keep track of the current portalstatic StringSAKAI_PORTAL_ORIGINAL_SITEIDThe Site ID that the user was originally trying to access when they hit the error.static StringTOOL_PORTLET_APP_NAMEthis is the property in the tool config that defines the name of the portlet applicationstatic StringTOOL_PORTLET_CONTEXT_PATHthis is the property in the tool config that defines the portlet context of tool.static StringTOOL_PORTLET_NAMEthis is the property in the tool config that defines the name of the portlet
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddHandler(String portalContext, PortalHandler handler)Add a PortalHandler when you don't have a reference to the portal.voidaddHandler(Portal portal, PortalHandler handler)Add a PortalHandler to the portal Handler map for the named context.voidaddPortal(Portal portal)Remove a portal from the portal service this should perform all the necessary cleanupvoidaddRenderEngine(String context, PortalRenderEngine vengine)add a render engine to the available render engines.StringdecodeToolState(Map<String,String[]> params, String placementId)Inverts the operation of encodeToolState, and returns the URL stub which was supplied for the supplied placementId.Map<String,String[]>encodeToolState(String placementId, String URLstub)Returns a parameter map suitable for appending to a portal URL, representing that the URL state of a tool being shown with the specified placementId will be equal to the URLstub.EditorgetActiveEditor()Retrieve the activated system-wide Editor.EditorgetActiveEditor(Placement placement)Retrieve the activated Editor, considering the tool Placement.StringgetBrowserCollectionId(Placement placement)Retrieves the site collection ID for a placement for file browsing to an appropriate location.ContentHostingServicegetContentHostingService()Bean getter for Content Hosting dependency.StringgetContentItemUrl(Site site)Retrieves the url for the ContentItem selector - if there are any to selectEditorRegistrygetEditorRegistry()Bean getter for Editor Registry.Map<String,PortalHandler>getHandlerMap(Portal portal)Get the PortalHandler map for the portal Context.List<Map>getQuickLinks(String siteSkin)StringgetQuickLinksTitle(String siteSkin)Iterator<PortletApplicationDescriptor>getRegisteredApplications()Get an Iterator of Portlet Application Descriptors from the whole of the applicationPortalRenderEnginegetRenderEngine(String context, HttpServletRequest request)get a render engine possibly based on the requestStringgetResetState()get the state of the state of the portal reset flagStringgetResetStateParam()Get the parameter used to communicate reset state operations on the URLSiteNeighbourhoodServicegetSiteNeighbourhoodService()StringgetSkinPrefix()StoredStategetStoredState()get the StoredState object that is used to hold initial request state on direct access to a portlet state or on GET or POST that requires other initial actions.StyleAbleProvidergetStylableService()Get the implimentation of the StylableService from the portal implbooleanisEnableDirect()Is the direct URL mechnism enabled in the configation file.booleanisResetRequested(HttpServletRequest req)Was a reset requestedStoredStatenewStoredState(String marker, String replacement)Create a new Stored StatevoidremoveHandler(String portalContext, String urlFragment)Remove a PortalHandler when you don't have a reference to the portal.voidremoveHandler(Portal portal, String urlFragment)Remove the Portal Handler identitied by the URL fragment associated with the portal ContextvoidremovePortal(Portal portal)Add a portal to the portal servicevoidremoveRenderEngine(String context, PortalRenderEngine vengine)remove a render engine from the avaialble render enginesvoidsetContentHostingService(ContentHostingService contentHostingService)Bean setter for Content Hosting dependency.voidsetEditorRegistry(EditorRegistry editorRegistry)Bean setter for Editor Registry.voidsetResetState(String state)ste the state of the portal reset flag.voidsetStoredState(StoredState storedstate)set the StoredState of the request for later retrieval
-
-
-
Field Detail
-
PLACEMENT_ATTRIBUTE
static final String PLACEMENT_ATTRIBUTE
A portal request scope attribute that reprenset the placement id of the current request. It should be a string, and should be implimented where the request is portlet dispatched.
-
TOOL_PORTLET_CONTEXT_PATH
static final String TOOL_PORTLET_CONTEXT_PATH
this is the property in the tool config that defines the portlet context of tool. At the moment we assume that this is in the read-only properties of the tool, but there could be a generic tool placement that enabled any portlet to be mounted- See Also:
- Constant Field Values
-
TOOL_PORTLET_APP_NAME
static final String TOOL_PORTLET_APP_NAME
this is the property in the tool config that defines the name of the portlet application- See Also:
- Constant Field Values
-
TOOL_PORTLET_NAME
static final String TOOL_PORTLET_NAME
this is the property in the tool config that defines the name of the portlet- See Also:
- Constant Field Values
-
SAKAI_CONTROLLING_PORTAL
static final String SAKAI_CONTROLLING_PORTAL
this is the property in session to keep track of the current portal- See Also:
- Constant Field Values
-
SAKAI_PORTAL_ORIGINAL_SITEID
static final String SAKAI_PORTAL_ORIGINAL_SITEID
The Site ID that the user was originally trying to access when they hit the error.- See Also:
- Constant Field Values
-
-
Method Detail
-
setResetState
void setResetState(String state)
ste the state of the portal reset flag.- Parameters:
state-
-
encodeToolState
Map<String,String[]> encodeToolState(String placementId, String URLstub)
Returns a parameter map suitable for appending to a portal URL, representing that the URL state of a tool being shown with the specified placementId will be equal to the URLstub. URLstub may contain anchor state, which the portal implementation may honour if it is capable. The Map may also include the encoded state of other placements if they are being shown in the current render state.
-
decodeToolState
String decodeToolState(Map<String,String[]> params, String placementId)
Inverts the operation of encodeToolState, and returns the URL stub which was supplied for the supplied placementId. Will returnnullif there was no special state registered.
-
getResetState
String getResetState()
get the state of the state of the portal reset flag- Returns:
-
getStoredState
StoredState getStoredState()
get the StoredState object that is used to hold initial request state on direct access to a portlet state or on GET or POST that requires other initial actions.- Returns:
-
isResetRequested
boolean isResetRequested(HttpServletRequest req)
Was a reset requested- Parameters:
req-- Returns:
-
setStoredState
void setStoredState(StoredState storedstate)
set the StoredState of the request for later retrieval- Parameters:
storedstate-
-
isEnableDirect
boolean isEnableDirect()
Is the direct URL mechnism enabled in the configation file.- Returns:
-
getResetStateParam
String getResetStateParam()
Get the parameter used to communicate reset state operations on the URL- Returns:
-
newStoredState
StoredState newStoredState(String marker, String replacement)
Create a new Stored State- Parameters:
marker- the mark within the URLreplacement- and the replacement text on restoration- Returns:
-
getRegisteredApplications
Iterator<PortletApplicationDescriptor> getRegisteredApplications()
Get an Iterator of Portlet Application Descriptors from the whole of the application- Returns:
-
getRenderEngine
PortalRenderEngine getRenderEngine(String context, HttpServletRequest request)
get a render engine possibly based on the request- Parameters:
context- - the context from whcih to take the render engine.request-- Returns:
-
addRenderEngine
void addRenderEngine(String context, PortalRenderEngine vengine)
add a render engine to the available render engines.- Parameters:
context- - the context to rengister the render engine in, as there may be more than one portal in a sakai instance, you need to register the render engine against a context. The context should match the context used by the portal to retrieve its render engine. This is dependant on the Portal implementation details.vengine- the render engine implementation to register with the portal service
-
removeRenderEngine
void removeRenderEngine(String context, PortalRenderEngine vengine)
remove a render engine from the avaialble render engines- Parameters:
context- - the context to deregister the render engine from, as there may be more than one portal in a sakai instance, you need to deregister the render engine from a context. The context should match the context used by the portal to retrieve its render engine. This is dependant on the Portal implementation details.vengine-
-
addHandler
void addHandler(Portal portal, PortalHandler handler)
Add a PortalHandler to the portal Handler map for the named context.- Parameters:
portal-handler-
-
removeHandler
void removeHandler(Portal portal, String urlFragment)
Remove the Portal Handler identitied by the URL fragment associated with the portal Context- Parameters:
portal-urlFragment-
-
getHandlerMap
Map<String,PortalHandler> getHandlerMap(Portal portal)
Get the PortalHandler map for the portal Context.- Parameters:
portal-- Returns:
-
removePortal
void removePortal(Portal portal)
Add a portal to the portal service- Parameters:
portal-
-
addPortal
void addPortal(Portal portal)
Remove a portal from the portal service this should perform all the necessary cleanup- Parameters:
portal-
-
getStylableService
StyleAbleProvider getStylableService()
Get the implimentation of the StylableService from the portal impl- Returns:
-
addHandler
void addHandler(String portalContext, PortalHandler handler)
Add a PortalHandler when you don't have a reference to the portal. Eg. If the portal handler is in a different servlet context to the portal.- Parameters:
portalContext- The context of the portal. Eg: charon.handler- The portal handler to add.- See Also:
removeHandler(String, String)
-
removeHandler
void removeHandler(String portalContext, String urlFragment)
Remove a PortalHandler when you don't have a reference to the portal.- See Also:
addHandler(String, PortalHandler)
-
getSiteNeighbourhoodService
SiteNeighbourhoodService getSiteNeighbourhoodService()
- Returns:
-
setContentHostingService
void setContentHostingService(ContentHostingService contentHostingService)
Bean setter for Content Hosting dependency.- Parameters:
contentHostingService-
-
getContentHostingService
ContentHostingService getContentHostingService()
Bean getter for Content Hosting dependency.- Returns:
-
getContentItemUrl
String getContentItemUrl(Site site)
Retrieves the url for the ContentItem selector - if there are any to select- Parameters:
site- The site that is being rendered.- Returns:
- The ContentItem selctor URL or null
-
getBrowserCollectionId
String getBrowserCollectionId(Placement placement)
Retrieves the site collection ID for a placement for file browsing to an appropriate location. If this is null or cannot be found, the user's My Workspace resources are returned.- Parameters:
placement- The placement that is being rendered.- Returns:
- The collection ID for the placement's context or current user's My Workspace.
-
setEditorRegistry
void setEditorRegistry(EditorRegistry editorRegistry)
Bean setter for Editor Registry.- Parameters:
editorRegistry-
-
getEditorRegistry
EditorRegistry getEditorRegistry()
Bean getter for Editor Registry.- Returns:
-
getActiveEditor
Editor getActiveEditor()
Retrieve the activated system-wide Editor.- Returns:
- The active configured Editor instance.
-
getActiveEditor
Editor getActiveEditor(Placement placement)
Retrieve the activated Editor, considering the tool Placement. This allows for site-specific editor selection by administrators via the wysiwyg.editor site property.- Parameters:
placement- The placement that is being rendered.- Returns:
- The configured Editor instance for this placement.
-
getSkinPrefix
String getSkinPrefix()
- Returns:
- the skin prefix. Will return empty string if no prefix is set.
-
getQuickLinksTitle
String getQuickLinksTitle(String siteSkin)
- Returns:
- the quick links title for display in the top navigation bar. Will return empty string if no title is set.
-
-