org.sakaiproject.portal.api
Interface Portal


public interface Portal

This 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: 86609 $
Author:
ieb

Field Summary
static String ATTR_ERROR
          ThreadLocal attribute set while we are processing an error.
static String ATTR_MAXIMIZED_URL
          Session variable passing a maximized URL between a portlet and the portal
static String ATTR_SITE_PAGE
          Session attribute root for storing a site's last page visited - just append the site id.
static String CONFIG_AUTO_RESET
          Configuration option to enable/disable state reset on navigation change
static String CONFIG_DEFAULT_TABS
          Configuration option for default number of site tabs to display to users
static String DEFAULT_PORTAL_CONTEXT
          The default portal name is none is specified.
static int ERROR_GALLERY
           
static int ERROR_SITE
          Error response modes.
static int ERROR_WORKSITE
           
static String FORCE_CLASSIC_COOKIE_VALUE
          Value that this cookie will have if we are forcing classic mode
static String FORCE_CLASSIC_REQ_PARAM
          Parameter to signal that we should force the request back to the normal portal view rather than the PDA portal view.
static String FRAMESET_SUPPORT
          Configuration option indicaing support for frame set mode.
static 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.
static 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).
static String PARAM_FORCE_LOGOUT
           
static String PORTAL_MODE_COOKIE_NAME
          Name of cookie that is set to signal what view we want It is an abstract name to we can later set other preferred modes into same cookie if desired
static String PREFER_MAXIMIZE
          Tool property used to indicate if a tool prefers a maximized view with minimal portal navigation.
static String SAKAI_NAV_MINIMIZED
          Name of cookie that is set to signal that the user wants us to start minimized
static String SAKAI_PORTAL_ALLOW_NEO
          Constants for SAK-19455 - The NEO Portlet Feature that allows a portlet to suppress its title and add to the system breadcrumbs.
static String SAKAI_PORTAL_BREADCRUMBS
           
static String SAKAI_PORTAL_HELP_ACTION
           
static String SAKAI_PORTAL_RESET_ACTION
           
static String SAKAI_PORTAL_SUPPRESSTITLE
           
static String TOOLCONFIG_HELP_DOCUMENT_ID
           
static String TOOLCONFIG_HELP_DOCUMENT_URL
           
static String TOOLCONFIG_SHOW_HELP_BUTTON
           
static String TOOLCONFIG_SHOW_RESET_BUTTON
          Names of tool config/registration attributes that control the rendering of the tool's titlebar
 
Method Summary
 String calcSiteType(String siteId)
          work out the type of the site based on the site id.
 void doError(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, int mode)
          populate the model with error status
 void doLogin(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, String returnPath, boolean skipContainer)
          perform login
 void doLogout(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, String returnPath)
          Process a logout
 javax.servlet.http.Cookie findCookie(javax.servlet.http.HttpServletRequest req, String name)
          Find a cookie by this name from the request
 void forwardPortal(org.sakaiproject.tool.api.ActiveTool tool, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.site.api.ToolConfiguration siteTool, String skin, String toolContextPath, String toolPathInfo)
          forward to a portal url
 void forwardTool(org.sakaiproject.tool.api.ActiveTool tool, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Placement placement, String skin, String toolContextPath, String toolPathInfo)
          forward the request to a tool
 PageFilter getPageFilter()
          Get a the page Filter Implementation
 String getPlacement(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, String placementId, boolean doPage)
          get the placement for the request
 String getPortalContext()
          Get the context name of the portal.
 String getPortalPageUrl(org.sakaiproject.site.api.ToolConfiguration siteTool)
          get the portal page URL base on the tool supplied
 javax.servlet.ServletContext getServletContext()
          Get the servlet context associated with the portal
 PortalSiteHelper getSiteHelper()
           
 SiteNeighbourhoodService getSiteNeighbourhoodService()
           
 String getUserEidBasedSiteId(String userId)
          get the site id for the user
 void includeBottom(PortalRenderContext rcontext)
          include the model section that relates to the bottom of the page.
 void includeLogin(PortalRenderContext rcontext, javax.servlet.http.HttpServletRequest req, org.sakaiproject.tool.api.Session session)
          include the part od the view tree needed to render login
 PortalRenderContext includePortal(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Session session, String siteId, String toolId, String toolContextPath, String prefix, boolean doPages, boolean resetTools, boolean includeSummary, boolean expandSite)
          populate the view tree for the model
 void includeSubSites(PortalRenderContext rcontext, javax.servlet.http.HttpServletRequest req, org.sakaiproject.tool.api.Session session, String siteId, String toolContextPath, String prefix, boolean resetTools)
          Return the sub sites below a particular site Map.
 Map includeTool(javax.servlet.http.HttpServletResponse res, javax.servlet.http.HttpServletRequest req, org.sakaiproject.site.api.ToolConfiguration placement)
          include the tool part of the view tree
 boolean isPortletPlacement(org.sakaiproject.tool.api.Placement placement)
          Indicate if a placement is a JSR-168 placement
 boolean redirectIfLoggedOut(javax.servlet.http.HttpServletResponse res)
          perform a redirect if logged out
 void sendResponse(PortalRenderContext rcontext, javax.servlet.http.HttpServletResponse res, String template, String contentType)
          prepare the response and send it to the render engine
 void setPageFilter(PageFilter pageFilter)
          Set page Filter
 void setupForward(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, org.sakaiproject.tool.api.Placement p, String skin)
          setup in preparation for a forward
 void setupMobileDevice(javax.servlet.http.HttpServletRequest req, PortalRenderContext rcontext)
          Look at the user agent and add Mobile Browser related material to the context.
 PortalRenderContext startPageContext(String siteType, String title, String skin, javax.servlet.http.HttpServletRequest request)
          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

ATTR_MAXIMIZED_URL

static final String ATTR_MAXIMIZED_URL
Session variable passing a maximized URL between a portlet and the portal

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

FRAMESET_SUPPORT

static final String FRAMESET_SUPPORT
Configuration option indicaing support for frame set mode.

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

CONFIG_DEFAULT_TABS

static final String CONFIG_DEFAULT_TABS
Configuration option for default number of site tabs to display to users

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

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

PREFER_MAXIMIZE

static final String PREFER_MAXIMIZE
Tool property used to indicate if a tool prefers a maximized view with minimal portal navigation.

See Also:
Constant Field Values

FORCE_CLASSIC_REQ_PARAM

static final String FORCE_CLASSIC_REQ_PARAM
Parameter to signal that we should force the request back to the normal portal view rather than the PDA portal view.

See Also:
Constant Field Values

PORTAL_MODE_COOKIE_NAME

static final String PORTAL_MODE_COOKIE_NAME
Name of cookie that is set to signal what view we want It is an abstract name to we can later set other preferred modes into same cookie if desired

See Also:
Constant Field Values

FORCE_CLASSIC_COOKIE_VALUE

static final String FORCE_CLASSIC_COOKIE_VALUE
Value that this cookie will have if we are forcing classic mode

See Also:
Constant Field Values

SAKAI_NAV_MINIMIZED

static final String SAKAI_NAV_MINIMIZED
Name of cookie that is set to signal that the user wants us to start minimized

See Also:
Constant Field Values

SAKAI_PORTAL_ALLOW_NEO

static final String SAKAI_PORTAL_ALLOW_NEO
Constants for SAK-19455 - The NEO Portlet Feature that allows a portlet to suppress its title and add to the system breadcrumbs.

See Also:
Constant Field Values

SAKAI_PORTAL_HELP_ACTION

static final String SAKAI_PORTAL_HELP_ACTION
See Also:
Constant Field Values

SAKAI_PORTAL_RESET_ACTION

static final String SAKAI_PORTAL_RESET_ACTION
See Also:
Constant Field Values

SAKAI_PORTAL_BREADCRUMBS

static final String SAKAI_PORTAL_BREADCRUMBS
See Also:
Constant Field Values

SAKAI_PORTAL_SUPPRESSTITLE

static final String SAKAI_PORTAL_SUPPRESSTITLE
See Also:
Constant Field Values
Method Detail

sendResponse

void sendResponse(PortalRenderContext rcontext,
                  javax.servlet.http.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(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res,
                    org.sakaiproject.tool.api.Session session,
                    String placementId,
                    boolean doPage)
                    throws org.sakaiproject.tool.api.ToolException
get the placement for the request

Parameters:
req -
res -
session -
placementId -
doPage -
Returns:
Throws:
org.sakaiproject.tool.api.ToolException

doLogin

void doLogin(javax.servlet.http.HttpServletRequest req,
             javax.servlet.http.HttpServletResponse res,
             org.sakaiproject.tool.api.Session session,
             String returnPath,
             boolean skipContainer)
             throws org.sakaiproject.tool.api.ToolException
perform login

Parameters:
req -
res -
session -
returnPath -
skipContainer -
Throws:
org.sakaiproject.tool.api.ToolException

doLogout

void doLogout(javax.servlet.http.HttpServletRequest req,
              javax.servlet.http.HttpServletResponse res,
              org.sakaiproject.tool.api.Session session,
              String returnPath)
              throws org.sakaiproject.tool.api.ToolException
Process a logout

Parameters:
req - Request object
res - Response object
session - Current session
returnPath - 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:
org.sakaiproject.tool.api.ToolException

startPageContext

PortalRenderContext startPageContext(String siteType,
                                     String title,
                                     String skin,
                                     javax.servlet.http.HttpServletRequest request)
get a new render context from the render engine

Parameters:
siteType -
title -
skin -
request -
Returns:

redirectIfLoggedOut

boolean redirectIfLoggedOut(javax.servlet.http.HttpServletResponse res)
                            throws IOException
perform a redirect if logged out

Parameters:
res -
Returns:
Throws:
IOException

getPortalPageUrl

String getPortalPageUrl(org.sakaiproject.site.api.ToolConfiguration siteTool)
get the portal page URL base on the tool supplied

Parameters:
siteTool -
Returns:

doError

void doError(javax.servlet.http.HttpServletRequest req,
             javax.servlet.http.HttpServletResponse res,
             org.sakaiproject.tool.api.Session session,
             int mode)
             throws org.sakaiproject.tool.api.ToolException,
                    IOException
populate the model with error status

Parameters:
req -
res -
session -
mode -
Throws:
org.sakaiproject.tool.api.ToolException
IOException

forwardPortal

void forwardPortal(org.sakaiproject.tool.api.ActiveTool tool,
                   javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res,
                   org.sakaiproject.site.api.ToolConfiguration siteTool,
                   String skin,
                   String toolContextPath,
                   String toolPathInfo)
                   throws org.sakaiproject.tool.api.ToolException,
                          IOException
forward to a portal url

Parameters:
tool -
req -
res -
siteTool -
skin -
toolContextPath -
toolPathInfo -
Throws:
IOException
org.sakaiproject.tool.api.ToolException

setupForward

void setupForward(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res,
                  org.sakaiproject.tool.api.Placement p,
                  String skin)
                  throws org.sakaiproject.tool.api.ToolException
setup in preparation for a forward

Parameters:
req -
res -
p -
skin -
Throws:
org.sakaiproject.tool.api.ToolException

includeBottom

void includeBottom(PortalRenderContext rcontext)
include the model section that relates to the bottom of the page.

Parameters:
rcontext -

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,
                  javax.servlet.http.HttpServletRequest req,
                  org.sakaiproject.tool.api.Session session)
include the part od the view tree needed to render login

Parameters:
rcontext -
req -
session -

forwardTool

void forwardTool(org.sakaiproject.tool.api.ActiveTool tool,
                 javax.servlet.http.HttpServletRequest req,
                 javax.servlet.http.HttpServletResponse res,
                 org.sakaiproject.tool.api.Placement placement,
                 String skin,
                 String toolContextPath,
                 String toolPathInfo)
                 throws org.sakaiproject.tool.api.ToolException
forward the request to a tool

Parameters:
tool -
req -
res -
siteTool -
skin -
toolContextPath -
toolPathInfo -
Throws:
org.sakaiproject.tool.api.ToolException

getUserEidBasedSiteId

String getUserEidBasedSiteId(String userId)
get the site id for the user

Parameters:
userId -
Returns:

includePortal

PortalRenderContext includePortal(javax.servlet.http.HttpServletRequest req,
                                  javax.servlet.http.HttpServletResponse res,
                                  org.sakaiproject.tool.api.Session session,
                                  String siteId,
                                  String toolId,
                                  String toolContextPath,
                                  String prefix,
                                  boolean doPages,
                                  boolean resetTools,
                                  boolean includeSummary,
                                  boolean expandSite)
                                  throws org.sakaiproject.tool.api.ToolException,
                                         IOException
populate the view tree for the model

Parameters:
req -
res -
session -
siteId -
toolId -
toolContextPath -
prefix -
doPages -
resetTools -
includeSummary -
expandSite -
Returns:
Throws:
org.sakaiproject.tool.api.ToolException
IOException

includeTool

Map includeTool(javax.servlet.http.HttpServletResponse res,
                javax.servlet.http.HttpServletRequest req,
                org.sakaiproject.site.api.ToolConfiguration placement)
                throws IOException
include the tool part of the view tree

Parameters:
res -
req -
placement -
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

javax.servlet.ServletContext getServletContext()
Get the servlet context associated with the portal

Returns:

setupMobileDevice

void setupMobileDevice(javax.servlet.http.HttpServletRequest req,
                       PortalRenderContext rcontext)
Look at the user agent and add Mobile Browser related material to the context.


includeSubSites

void includeSubSites(PortalRenderContext rcontext,
                     javax.servlet.http.HttpServletRequest req,
                     org.sakaiproject.tool.api.Session session,
                     String siteId,
                     String toolContextPath,
                     String prefix,
                     boolean resetTools)
Return the sub sites below a particular site Map.

Parameters:
rcontext -
req -
siteId -
toolContextPath -
prefix -
loggedIn -

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(org.sakaiproject.tool.api.Placement placement)
Indicate if a placement is a JSR-168 placement

Returns:

findCookie

javax.servlet.http.Cookie findCookie(javax.servlet.http.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.


Copyright © 2003-2012 Sakai Project. All Rights Reserved.