Package org.sakaiproject.portal.api
Interface PortalSiteHelper
-
public interface PortalSiteHelper- Author:
- ieb
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanallowTool(Site site, Placement placement)Map<String,Object>convertSiteToMap(HttpServletRequest req, Site s, String prefix, String currentSiteId, String myWorkspaceSiteId, boolean includeSummary, boolean expandSite, boolean resetTools, boolean doPages, String toolContextPath, boolean loggedIn, List<String> siteProviders)booleandoGatewaySiteList()StringgetGatewaySiteId()SitegetMyWorkspace(Session session)SitegetSite(String siteId)This looks up a site but also checks for any aliases.SiteViewgetSitesView(SiteView.View view, HttpServletRequest req, Session session, String siteId)Generates a SiteView object from the current request and locationSitegetSiteVisit(String siteId)StringgetUserSpecificSiteTitle(Site site, boolean escaped)SAK-29138 - Get the site or section title for the current user for the current site.StringgetUserSpecificSiteTitle(Site site, boolean truncated, boolean escaped)Similar to getUserSpecificSiteTitle(Site site, boolean escaped), but also takes truncated parameterStringgetUserSpecificSiteTitle(Site site, boolean truncated, boolean escaped, List<String> siteProviders)Similar to getUserSpecificSiteTitle(Site site, boolean escaped), but consumes the specified siteProviders (for performance savings)booleanisJoinable(String siteId, String userId)Check if the site is joinable by the supplied user and the user isn't currently a member of the site.StringlookupPageToAlias(String siteId, SitePage page)Find an alias for a page.SitePagelookupSitePage(String pageId, Site site)Map<String,Object>pageListToMap(HttpServletRequest req, boolean loggedIn, Site site, SitePage page, String toolContextPath, String portalPrefix, boolean doPages, boolean resetTools, boolean includeSummary)Iterate through the pages in a site and return information in a Map.
-
-
-
Method Detail
-
getSiteVisit
Site getSiteVisit(String siteId) throws IdUnusedException, PermissionException
- Parameters:
siteId-- Returns:
- Throws:
IdUnusedExceptionPermissionException
-
allowTool
boolean allowTool(Site site, Placement placement)
- Parameters:
site-placement-- Returns:
-
doGatewaySiteList
boolean doGatewaySiteList()
- Returns:
-
getGatewaySiteId
String getGatewaySiteId()
- Returns:
-
lookupSitePage
SitePage lookupSitePage(String pageId, Site site)
- Parameters:
portal-pageId-site-- Returns:
-
pageListToMap
Map<String,Object> pageListToMap(HttpServletRequest req, boolean loggedIn, Site site, SitePage page, String toolContextPath, String portalPrefix, boolean doPages, boolean resetTools, boolean includeSummary)
Iterate through the pages in a site and return information in a Map.- Parameters:
req-loggedIn-site-page-toolContextPath-portalPrefix-doPages-resetTools-includeSummary-
-
convertSiteToMap
Map<String,Object> convertSiteToMap(HttpServletRequest req, Site s, String prefix, String currentSiteId, String myWorkspaceSiteId, boolean includeSummary, boolean expandSite, boolean resetTools, boolean doPages, String toolContextPath, boolean loggedIn, List<String> siteProviders)
-
getUserSpecificSiteTitle
String getUserSpecificSiteTitle(Site site, boolean escaped)
SAK-29138 - Get the site or section title for the current user for the current site. Takes into account 'portal.use.sectionTitle' sakai.property; if set to true, this method will return the title of the section the current user is enrolled in for the site (if it can be found). Otherwise, it will return the site title (default behaviour)- Parameters:
site- the site in questionescaped- true if you want the site title HTML escaped, false otherwise- Returns:
- the site or section title
-
getUserSpecificSiteTitle
String getUserSpecificSiteTitle(Site site, boolean truncated, boolean escaped)
Similar to getUserSpecificSiteTitle(Site site, boolean escaped), but also takes truncated parameter- Parameters:
truncated- true if you want long titles to be truncated with an ellipses- See Also:
getUserSpecificSiteTitle(Site site, String userId)
-
getUserSpecificSiteTitle
String getUserSpecificSiteTitle(Site site, boolean truncated, boolean escaped, List<String> siteProviders)
Similar to getUserSpecificSiteTitle(Site site, boolean escaped), but consumes the specified siteProviders (for performance savings)- Parameters:
truncated- true if you want long titles to be truncated with an ellipsessiteProviders- the site providers corresponding to the specified site; if null, they will be looked up- See Also:
getUserSpecificSiteTitle(Site site, String userId)
-
getSitesView
SiteView getSitesView(SiteView.View view, HttpServletRequest req, Session session, String siteId)
Generates a SiteView object from the current request and location- Parameters:
view-req-session-siteId-- Returns:
-
lookupPageToAlias
String lookupPageToAlias(String siteId, SitePage page)
Find an alias for a page.- Parameters:
siteId-page-- Returns:
nullif no alias was found, otherwise the short alias for the page.
-
isJoinable
boolean isJoinable(String siteId, String userId)
Check if the site is joinable by the supplied user and the user isn't currently a member of the site.- Parameters:
siteId- The ID of the site.userId- The ID of the user.- Returns:
trueif the user can join the site.
-
getSite
Site getSite(String siteId) throws IdUnusedException
This looks up a site but also checks for any aliases. This doesn't do any permission checks.- Parameters:
siteId- The siteId/alias to lookup- Returns:
- The site.
- Throws:
IdUnusedException- If the siteId doesn't exist and there isn't an alias for this.
-
-