com.arsdigita.acs.portals
Class PortalsProcs

java.lang.Object
  |
  +--com.arsdigita.acs.portals.PortalsProcs

public class PortalsProcs
extends Object


Constructor Summary
PortalsProcs()
           
 
Method Summary
static ContextBarWs adminContextBar()
          Same as adminContextBar(false)
static ContextBarWs adminContextBar(boolean finalP)
          Generates a standard context bar to use for portal admin pages
static ContextBarWs adminContextBar(String sectionTitle)
          Same as adminContextBar(false) + one more link
static String adminFormatOnePortalPage(String currentPage, String maxPage, String groupName, String pageName, String leftSelect, String rightSelect, String extraOptions)
           
static String adminHeader(String title)
          Generates the admin header for /portals/admin
static UserInfo checkAdministratorMaybeRedirect(HttpServletRequest req, HttpServletResponse resp)
          Same as checkAdministratorMaybeRedirect(req, resp, null, null)
static UserInfo checkAdministratorMaybeRedirect(HttpServletRequest req, HttpServletResponse resp, Integer groupId)
          Same as checkAdministratorMaybeRedirect(req, resp, groupId.toString(), null);
static UserInfo checkAdministratorMaybeRedirect(HttpServletRequest req, HttpServletResponse resp, String groupId, String redirectLocation)
          Redirects to user registration unless the user is a portal administrator (role of "administrator" in the group "Super Administrators" of type "portal_group")
static AdSet getDisplayInfo()
          Returns the subset of portals parameters associated with the display of each portlet
static String getSuperAdminGroupId()
          Returns the group_id of the portals Super Administrators group
static String groupName(Integer groupId)
          Casts argument to string and returns with calll to groupName(String ...)
static String groupName(String groupId)
          Returns the group name associated with groupId.
static String portalsParam(String name)
          Same as portalsParam(name, null)
static String portalsParam(String name, String defaultValue)
          Returns the portals parameter for name.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortalsProcs

public PortalsProcs()
Method Detail

portalsParam

public static String portalsParam(String name,
                                  String defaultValue)
Returns the portals parameter for name. Wrapper since we use so many parameters
Parameters:
name - the name of the parameter
default - any default value to assign

portalsParam

public static String portalsParam(String name)
Same as portalsParam(name, null)

adminHeader

public static String adminHeader(String title)
Generates the admin header for /portals/admin
Parameters:
title - Title of the current page

adminContextBar

public static ContextBarWs adminContextBar(boolean finalP)
Generates a standard context bar to use for portal admin pages
Parameters:
finalP - If true, doesn't make the the section linkable

adminContextBar

public static ContextBarWs adminContextBar()
Same as adminContextBar(false)

adminContextBar

public static ContextBarWs adminContextBar(String sectionTitle)
Same as adminContextBar(false) + one more link

groupName

public static String groupName(String groupId)
                        throws SQLException,
                               ACSException
Returns the group name associated with groupId.
Parameters:
groupId - The group whose name we wants
Returns:
The name of the group (or empty string if the group doesn't exist)

groupName

public static String groupName(Integer groupId)
                        throws SQLException,
                               ACSException
Casts argument to string and returns with calll to groupName(String ...)

getSuperAdminGroupId

public static String getSuperAdminGroupId()
                                   throws SQLException,
                                          ACSException
Returns the group_id of the portals Super Administrators group
Returns:
group id of Super Administrators

checkAdministratorMaybeRedirect

public static UserInfo checkAdministratorMaybeRedirect(HttpServletRequest req,
                                                       HttpServletResponse resp,
                                                       Integer groupId)
                                                throws SQLException,
                                                       IOException,
                                                       ACSException
Same as checkAdministratorMaybeRedirect(req, resp, groupId.toString(), null);

checkAdministratorMaybeRedirect

public static UserInfo checkAdministratorMaybeRedirect(HttpServletRequest req,
                                                       HttpServletResponse resp,
                                                       String groupId,
                                                       String redirectLocation)
                                                throws SQLException,
                                                       IOException,
                                                       ACSException
Redirects to user registration unless the user is a portal administrator (role of "administrator" in the group "Super Administrators" of type "portal_group")
Parameters:
userId - User id of the person we are checking. If "0", we redirect.
groupId - optional argument. If specified, user must also be an administrator of that group.
redirectLocation - Where to redirect (defaults to /register)
Returns:
UserInfo object of the logged in user (or null if not logged in)

checkAdministratorMaybeRedirect

public static UserInfo checkAdministratorMaybeRedirect(HttpServletRequest req,
                                                       HttpServletResponse resp)
                                                throws SQLException,
                                                       IOException,
                                                       ACSException
Same as checkAdministratorMaybeRedirect(req, resp, null, null)

getDisplayInfo

public static AdSet getDisplayInfo()
Returns the subset of portals parameters associated with the display of each portlet
Returns:
AdSet of all the parameters associated with the display of each portlet

adminFormatOnePortalPage

public static String adminFormatOnePortalPage(String currentPage,
                                              String maxPage,
                                              String groupName,
                                              String pageName,
                                              String leftSelect,
                                              String rightSelect,
                                              String extraOptions)