Package org.sakaiproject.portal.api
Interface Portal
-
public interface PortalThis interface represents a portal and is used mainly by portal handlers that will not know the details of the portal implimentation.- Since:
- Sakai 2.4
- Version:
- $Rev$
- Author:
- ieb
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_ERRORThreadLocal attribute set while we are processing an error.static StringATTR_SITE_PAGESession attribute root for storing a site's last page visited - just append the site id.static StringCONFIG_AUTO_RESETConfiguration option to enable/disable state reset on navigation changestatic StringCONFIG_DEFAULT_TABSstatic StringDEFAULT_PORTAL_CONTEXTThe default portal name is none is specified.static intERROR_GALLERYstatic intERROR_SITEError response modes.static intERROR_WORKSITEstatic StringJSR_168_PRE_RENDERTool property used to indicate if JSR_168 tools are to be pre-rendered as they are being placed in the context.static StringPARAM_FORCE_LOGINParameter value to allow anonymous users of gallery mode to be sent to the gateway site as anonymous user (like the /portal URL) instead of making them log in (like worksite, site, and tool URLs).static StringPARAM_FORCE_LOGOUTstatic StringTOOL_DIRECTURL_ENABLED_PROPTool property to allow the enabling/disabling of the direct url linking UIstatic StringTOOLCONFIG_HELP_DOCUMENT_IDstatic StringTOOLCONFIG_HELP_DOCUMENT_URLstatic StringTOOLCONFIG_SHOW_HELP_BUTTONstatic StringTOOLCONFIG_SHOW_RESET_BUTTONNames of tool config/registration attributes that control the rendering of the tool's titlebar
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringcalcSiteType(String siteId)work out the type of the site based on the site id.voiddoError(HttpServletRequest req, HttpServletResponse res, Session session, int mode)populate the model with error statusvoiddoLogin(HttpServletRequest req, HttpServletResponse res, Session session, String returnPath, boolean skipContainer)perform loginvoiddoLogout(HttpServletRequest req, HttpServletResponse res, Session session, String returnPath)Process a logoutCookiefindCookie(HttpServletRequest req, String name)Find a cookie by this name from the requestvoidforwardPortal(ActiveTool tool, HttpServletRequest req, HttpServletResponse res, ToolConfiguration siteTool, String skin, String toolContextPath, String toolPathInfo)forward to a portal urlvoidforwardTool(ActiveTool tool, HttpServletRequest req, HttpServletResponse res, Placement placement, String skin, String toolContextPath, String toolPathInfo)forward the request to a toolPageFiltergetPageFilter()Get a the page Filter ImplementationStringgetPlacement(HttpServletRequest req, HttpServletResponse res, Session session, String placementId, boolean doPage)get the placement for the requestStringgetPortalContext()Get the context name of the portal.StringgetPortalPageUrl(ToolConfiguration siteTool)get the portal page URL base on the tool suppliedServletContextgetServletContext()Get the servlet context associated with the portalPortalSiteHelpergetSiteHelper()SiteNeighbourhoodServicegetSiteNeighbourhoodService()StringgetUserEidBasedSiteId(String userId)get the site id for the uservoidincludeBottom(PortalRenderContext rcontext, Site site)include the model section that relates to the bottom of the page.voidincludeLogin(PortalRenderContext rcontext, HttpServletRequest req, Session session)include the part od the view tree needed to render loginPortalRenderContextincludePortal(HttpServletRequest req, HttpServletResponse res, Session session, String siteId, String toolId, String toolContextPath, String prefix, boolean doPages, boolean resetTools, boolean includeSummary, boolean expandSite)populate the view tree for the modelMapincludeTool(HttpServletResponse res, HttpServletRequest req, ToolConfiguration placement)include the tool part of the view treeMapincludeTool(HttpServletResponse res, HttpServletRequest req, ToolConfiguration placement, boolean inlineTool)include the tool part of the view treebooleanisPortletPlacement(Placement placement)Indicate if a placement is a JSR-168 placementbooleanredirectIfLoggedOut(HttpServletResponse res)perform a redirect if logged outvoidsendResponse(PortalRenderContext rcontext, HttpServletResponse res, String template, String contentType)prepare the response and send it to the render enginevoidsetPageFilter(PageFilter pageFilter)Set page FiltervoidsetupForward(HttpServletRequest req, HttpServletResponse res, Placement p, String skin)setup in preparation for a forwardPortalRenderContextstartPageContext(String siteType, String title, String skin, HttpServletRequest request, Site site)get a new render context from the render engine
-
-
-
Field Detail
-
ERROR_SITE
static final int ERROR_SITE
Error response modes.- See Also:
- Constant Field Values
-
ERROR_GALLERY
static final int ERROR_GALLERY
- See Also:
- Constant Field Values
-
ERROR_WORKSITE
static final int ERROR_WORKSITE
- See Also:
- Constant Field Values
-
PARAM_FORCE_LOGIN
static final String PARAM_FORCE_LOGIN
Parameter value to allow anonymous users of gallery mode to be sent to the gateway site as anonymous user (like the /portal URL) instead of making them log in (like worksite, site, and tool URLs).- See Also:
- Constant Field Values
-
PARAM_FORCE_LOGOUT
static final String PARAM_FORCE_LOGOUT
- See Also:
- Constant Field Values
-
ATTR_ERROR
static final String ATTR_ERROR
ThreadLocal attribute set while we are processing an error.- See Also:
- Constant Field Values
-
ATTR_SITE_PAGE
static final String ATTR_SITE_PAGE
Session attribute root for storing a site's last page visited - just append the site id.- See Also:
- Constant Field Values
-
DEFAULT_PORTAL_CONTEXT
static final String DEFAULT_PORTAL_CONTEXT
The default portal name is none is specified.- See Also:
- Constant Field Values
-
CONFIG_AUTO_RESET
static final String CONFIG_AUTO_RESET
Configuration option to enable/disable state reset on navigation change- See Also:
- Constant Field Values
-
TOOLCONFIG_SHOW_RESET_BUTTON
static final String TOOLCONFIG_SHOW_RESET_BUTTON
Names of tool config/registration attributes that control the rendering of the tool's titlebar- See Also:
- Constant Field Values
-
TOOLCONFIG_SHOW_HELP_BUTTON
static final String TOOLCONFIG_SHOW_HELP_BUTTON
- See Also:
- Constant Field Values
-
TOOLCONFIG_HELP_DOCUMENT_ID
static final String TOOLCONFIG_HELP_DOCUMENT_ID
- See Also:
- Constant Field Values
-
TOOLCONFIG_HELP_DOCUMENT_URL
static final String TOOLCONFIG_HELP_DOCUMENT_URL
- See Also:
- Constant Field Values
-
CONFIG_DEFAULT_TABS
static final String CONFIG_DEFAULT_TABS
- See Also:
- Constant Field Values
-
JSR_168_PRE_RENDER
static final String JSR_168_PRE_RENDER
Tool property used to indicate if JSR_168 tools are to be pre-rendered as they are being placed in the context.- See Also:
- Constant Field Values
-
TOOL_DIRECTURL_ENABLED_PROP
static final String TOOL_DIRECTURL_ENABLED_PROP
Tool property to allow the enabling/disabling of the direct url linking UI- See Also:
- Constant Field Values
-
-
Method Detail
-
sendResponse
void sendResponse(PortalRenderContext rcontext, HttpServletResponse res, String template, String contentType) throws IOException
prepare the response and send it to the render engine- Parameters:
rcontext-res-template-contentType-- Throws:
IOException
-
getPlacement
String getPlacement(HttpServletRequest req, HttpServletResponse res, Session session, String placementId, boolean doPage) throws ToolException
get the placement for the request- Parameters:
req-res-session-placementId-doPage-- Returns:
- Throws:
ToolException
-
doLogin
void doLogin(HttpServletRequest req, HttpServletResponse res, Session session, String returnPath, boolean skipContainer) throws ToolException
perform login- Parameters:
req-res-session-returnPath-skipContainer-- Throws:
ToolException
-
doLogout
void doLogout(HttpServletRequest req, HttpServletResponse res, Session session, String returnPath) throws ToolException
Process a logout- Parameters:
req- Request objectres- Response objectsession- Current sessionreturnPath- if not null, the path to use for the end-user browser redirect after the logout is complete. Leave null to use the configured logged out URL.- Throws:
ToolException
-
startPageContext
PortalRenderContext startPageContext(String siteType, String title, String skin, HttpServletRequest request, Site site)
get a new render context from the render engine- Parameters:
siteType-title-skin-request-site-- Returns:
-
redirectIfLoggedOut
boolean redirectIfLoggedOut(HttpServletResponse res) throws IOException
perform a redirect if logged out- Parameters:
res-- Returns:
- Throws:
IOException
-
getPortalPageUrl
String getPortalPageUrl(ToolConfiguration siteTool)
get the portal page URL base on the tool supplied- Parameters:
siteTool-- Returns:
-
doError
void doError(HttpServletRequest req, HttpServletResponse res, Session session, int mode) throws ToolException, IOException
populate the model with error status- Parameters:
req-res-session-mode-- Throws:
ToolExceptionIOException
-
forwardPortal
void forwardPortal(ActiveTool tool, HttpServletRequest req, HttpServletResponse res, ToolConfiguration siteTool, String skin, String toolContextPath, String toolPathInfo) throws ToolException, IOException
forward to a portal url- Parameters:
tool-req-res-siteTool-skin-toolContextPath-toolPathInfo-- Throws:
IOExceptionToolException
-
setupForward
void setupForward(HttpServletRequest req, HttpServletResponse res, Placement p, String skin) throws ToolException
setup in preparation for a forward- Parameters:
req-res-p-skin-- Throws:
ToolException
-
includeBottom
void includeBottom(PortalRenderContext rcontext, Site site)
include the model section that relates to the bottom of the page.- Parameters:
rcontext-site-
-
calcSiteType
String calcSiteType(String siteId)
work out the type of the site based on the site id.- Parameters:
siteId-- Returns:
-
includeLogin
void includeLogin(PortalRenderContext rcontext, HttpServletRequest req, Session session)
include the part od the view tree needed to render login- Parameters:
rcontext-req-session-
-
forwardTool
void forwardTool(ActiveTool tool, HttpServletRequest req, HttpServletResponse res, Placement placement, String skin, String toolContextPath, String toolPathInfo) throws ToolException
forward the request to a tool- Parameters:
tool-req-res-siteTool-skin-toolContextPath-toolPathInfo-- Throws:
ToolException
-
getUserEidBasedSiteId
String getUserEidBasedSiteId(String userId)
get the site id for the user- Parameters:
userId-- Returns:
-
includePortal
PortalRenderContext includePortal(HttpServletRequest req, HttpServletResponse res, Session session, String siteId, String toolId, String toolContextPath, String prefix, boolean doPages, boolean resetTools, boolean includeSummary, boolean expandSite) throws ToolException, IOException
populate the view tree for the model- Parameters:
req-res-session-siteId-toolId-toolContextPath-prefix-doPages-resetTools-includeSummary-expandSite-- Returns:
- Throws:
ToolExceptionIOException
-
includeTool
Map includeTool(HttpServletResponse res, HttpServletRequest req, ToolConfiguration placement) throws IOException
include the tool part of the view tree- Parameters:
res-req-placement-- Returns:
- Throws:
IOException
-
includeTool
Map includeTool(HttpServletResponse res, HttpServletRequest req, ToolConfiguration placement, boolean inlineTool) throws IOException
include the tool part of the view tree- Parameters:
res-req-placement-inlineTool-- Returns:
- Throws:
IOException
-
getPortalContext
String getPortalContext()
Get the context name of the portal. This is the name used to identify the portal implimentation in the portal service and to other parts of the system. Typically portals will be registered with the portal service using a name and render engines and PortalHandlers will connect to named portals.- Returns:
-
getServletContext
ServletContext getServletContext()
Get the servlet context associated with the portal- Returns:
-
getPageFilter
PageFilter getPageFilter()
Get a the page Filter Implementation- Returns:
-
setPageFilter
void setPageFilter(PageFilter pageFilter)
Set page Filter
-
getSiteHelper
PortalSiteHelper getSiteHelper()
- Returns:
-
getSiteNeighbourhoodService
SiteNeighbourhoodService getSiteNeighbourhoodService()
- Returns:
-
isPortletPlacement
boolean isPortletPlacement(Placement placement)
Indicate if a placement is a JSR-168 placement- Returns:
-
findCookie
Cookie findCookie(HttpServletRequest req, String name)
Find a cookie by this name from the request- Parameters:
req- The servlet request.name- The cookie name- Returns:
- The cookie of this name in the request, or null if not found.
-
-