blackboard.platform.plugin
Class PlugInUtil

java.lang.Object
  extended by blackboard.platform.plugin.PlugInUtil

public class PlugInUtil
extends java.lang.Object

The PlugInUtil class is a utility class for plug-ins for the Blackboard application.

Since:
Bb 5.5
Version:
$Revision: #1 $ $Date: 2005/06/27 $

Field Summary
static CourseMembership.Role[] CONTENT_COURSE_ALLOWED_ROLES
          Allowed user roles for editing course content
static User.SystemRole[] CONTENT_SYS_ALLOWED_ROLES
          Allowed system roles for editing course content
static User.SystemRole[] INSTALL_SYS_ALLOWED_ROLES
           
 
Constructor Summary
PlugInUtil()
           
 
Method Summary
static boolean authorizeForCourse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Authorizes the user's system and course roles for entering the Course.
static boolean authorizeForCourseControlPanel(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Authorizes the user's system and course roles for using the Instructor Control Panel.
static boolean authorizeForCourseControlPanelContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Authorizes the user's system and course roles for modifying content from the Instructor Control Panel.
static boolean authorizeForSystemAdmin(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Authorizes the user's system role for the Administrator Control panel.
static java.io.File getConfigDirectory(java.lang.String vid, java.lang.String handle)
          Returns the configuration directory for installing plug-ins.
static Id getCourseId(javax.servlet.http.HttpServletRequest request)
          Returns the CourseId given an HttpServletRequest object
static java.lang.String getDisplayContentReturnURL(Id contentId)
          Deprecated. use getDisplayContentReturnURL(contentId, courseId)
static java.lang.String getDisplayContentReturnURL(Id contentId, Id courseId)
          Returns the return URL for jsps going back to the Editable Content page.
static java.lang.String getDisplayContentReturnURL(java.lang.String contentId)
          Deprecated. use getDisplayContentReturnURL(contentId, courseId)
static java.lang.String getDisplayContentReturnURL(java.lang.String contentId, java.lang.String courseId)
          Returns the return URL for jsps going back to the Display Content page.
static java.lang.String getEditableContentReturnURL(Id contentId)
          Deprecated. use getEditableContentReturnURL(contentId,courseId)
static java.lang.String getEditableContentReturnURL(Id contentId, Id courseId)
          Returns the return URL for jsps going back to the Editable Content page.
static java.lang.String getEditableContentReturnURL(java.lang.String contentId)
          Deprecated. use getEditableContentReturnURL(contentId, courseId)
static java.lang.String getEditableContentReturnURL(java.lang.String contentId, java.lang.String courseId)
          Returns the return URL for jsps going back to the Editable Content page.
static java.lang.String getNavItemHandle(CourseDocument courseDoc)
          Deprecated.  
static java.lang.String getToolType(NavigationItem item)
          Returns a human readable name for specific navitem family identifiers.
static java.lang.String getUri(PlugIn pin, java.lang.String path)
          Returns the a URI generated for this plugin and the specified resource.
static java.lang.String getUri(java.lang.String vid, java.lang.String handle, java.lang.String path)
          Returns the a URI generated for this plugin and the specified resource.
static java.lang.String getUriStem(java.lang.String vid, java.lang.String handle)
          Returns the a URI-stem generated for this plugin.
static java.lang.String getUriStem(java.lang.String vid, java.lang.String handle, VirtualInstallation vi)
          Returns the a URI-stem generated for this plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_SYS_ALLOWED_ROLES

public static final User.SystemRole[] CONTENT_SYS_ALLOWED_ROLES
Allowed system roles for editing course content


CONTENT_COURSE_ALLOWED_ROLES

public static final CourseMembership.Role[] CONTENT_COURSE_ALLOWED_ROLES
Allowed user roles for editing course content


INSTALL_SYS_ALLOWED_ROLES

public static final User.SystemRole[] INSTALL_SYS_ALLOWED_ROLES
Constructor Detail

PlugInUtil

public PlugInUtil()
Method Detail

getConfigDirectory

public static java.io.File getConfigDirectory(java.lang.String vid,
                                              java.lang.String handle)
                                       throws PlugInException
Returns the configuration directory for installing plug-ins.

Parameters:
vid - String that makes up first part of the unique handle for the directory
handle - String that makes up second part of the unique handle for the directory
Returns:
File containing the configuration directory
Throws:
PlugInException
PlugInException

authorizeForSystemAdmin

public static boolean authorizeForSystemAdmin(javax.servlet.http.HttpServletRequest request,
                                              javax.servlet.http.HttpServletResponse response)
                                       throws PlugInException
Authorizes the user's system role for the Administrator Control panel.

Parameters:
request - HttpServletRequest from the jsp
response - HttpServletResponse from the jsp
Returns:
true if user is authorized
Throws:
PlugInException
PlugInException

authorizeForCourse

public static boolean authorizeForCourse(javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response)
                                  throws PlugInException
Authorizes the user's system and course roles for entering the Course.

Parameters:
request - HttpServletRequest from the jsp
response - HttpServletResponse from the jsp
Returns:
true if user is authorized
Throws:
PlugInException
PlugInException

authorizeForCourseControlPanel

public static boolean authorizeForCourseControlPanel(javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response)
                                              throws PlugInException
Authorizes the user's system and course roles for using the Instructor Control Panel.

Parameters:
request - HttpServletRequest from the jsp
response - HttpServletResponse from the jsp
Returns:
true if user is authorized
Throws:
PlugInException
PlugInException

authorizeForCourseControlPanelContent

public static boolean authorizeForCourseControlPanelContent(javax.servlet.http.HttpServletRequest request,
                                                            javax.servlet.http.HttpServletResponse response)
                                                     throws PlugInException
Authorizes the user's system and course roles for modifying content from the Instructor Control Panel.

Parameters:
request - HttpServletRequest from the jsp
response - HttpServletResponse from the jsp
Returns:
true if user is authorized
Throws:
PlugInException
PlugInException

getNavItemHandle

public static java.lang.String getNavItemHandle(CourseDocument courseDoc)
Deprecated. 

Returns the Nav Item Handle for the navigation (breadcrumb) bar. The previous implementation of this method relied on CourseDocument.Area, which is no longer usable in the CourseTOC scheme. However, for compatibility, this method will be kept in the API. The return value will always be the nav item handle 'control_panel'.

Parameters:
courseDoc - CourseDocument
Returns:
nav item handle

getEditableContentReturnURL

public static java.lang.String getEditableContentReturnURL(Id contentId)
Deprecated. use getEditableContentReturnURL(contentId,courseId)

Returns the return URL for jsps going back to the Editable Content page.

Parameters:
contentId - Id
Returns:
return URL

getEditableContentReturnURL

public static java.lang.String getEditableContentReturnURL(Id contentId,
                                                           Id courseId)
Returns the return URL for jsps going back to the Editable Content page.

Parameters:
contentId - Id
courseId - Id
Returns:
return URL
Since:
App Pack 3

getDisplayContentReturnURL

public static java.lang.String getDisplayContentReturnURL(Id contentId)
Deprecated. use getDisplayContentReturnURL(contentId, courseId)

Returns the return URL for jsps going back to the Editable Content page.

Parameters:
contentId - Id
Returns:
return URL

getDisplayContentReturnURL

public static java.lang.String getDisplayContentReturnURL(Id contentId,
                                                          Id courseId)
Returns the return URL for jsps going back to the Editable Content page.

Parameters:
contentId - Id
courseId - Id
Returns:
return URL
Since:
App Pack 3

getEditableContentReturnURL

public static java.lang.String getEditableContentReturnURL(java.lang.String contentId)
Deprecated. use getEditableContentReturnURL(contentId, courseId)

Returns the return URL for jsps going back to the Editable Content page.

Parameters:
contentId - String
Returns:
return URL

getEditableContentReturnURL

public static java.lang.String getEditableContentReturnURL(java.lang.String contentId,
                                                           java.lang.String courseId)
Returns the return URL for jsps going back to the Editable Content page.

Parameters:
contentId - String
courseId - String that represents the primary key Id for the course to return to
Returns:
return URL
Since:
App Pack 3

getDisplayContentReturnURL

public static java.lang.String getDisplayContentReturnURL(java.lang.String contentId)
Deprecated. use getDisplayContentReturnURL(contentId, courseId)

Returns the return URL for jsps going back to the Display Content page.

Parameters:
contentId - String
Returns:
return URL

getDisplayContentReturnURL

public static java.lang.String getDisplayContentReturnURL(java.lang.String contentId,
                                                          java.lang.String courseId)
Returns the return URL for jsps going back to the Display Content page.

Parameters:
contentId - String
courseId - String that represents the primary key Id for the course to return to
Returns:
return URL
Since:
App Pack 3

getUriStem

public static java.lang.String getUriStem(java.lang.String vid,
                                          java.lang.String handle)
Returns the a URI-stem generated for this plugin. For example, if the plugin has a vendor id of Bb, and a handle of plugin, the following code fragment:

PlugInUtil.getUriStem( "bb", "plugin" );

returns the string "/webapps/bb-plugin/". Using this method for URL generation in a system extension is very important, as the URIs are not guaranteed to be identical between versions of the platform.

Parameters:
vid - Developer or vendor id
handle - Developer assigned handle for the plugin
Returns:
URI stem, including leading and trailing slashes

getUriStem

public static java.lang.String getUriStem(java.lang.String vid,
                                          java.lang.String handle,
                                          VirtualInstallation vi)
Returns the a URI-stem generated for this plugin. For example, if the plugin has a vendor id of Bb, and a handle of plugin, the following code fragment:

PlugInUtil.getUriStem( "bb", "plugin", vi );

returns the string "/webapps/bb-plugin-<vi.getBbUid()>/". Using this method for URL generation in a system extension is very important, as the URIs are not guaranteed to be identical between versions of the platform.

Parameters:
vid - Developer or vendor id
handle - Developer assigned handle for the plugin
vi -
Returns:
URI stem, including leading and trailing slashes

getUri

public static java.lang.String getUri(PlugIn pin,
                                      java.lang.String path)
Returns the a URI generated for this plugin and the specified resource. For example, if the plugin has a vendor id of Bb, and a handle of plugin, the following code fragment:

PlugInUtil.getUri( "bb", "plugin", "start.jsp" );

returns the string "/webapps/bb-plugin/start.jsp". Using this method for URL generation in a system extension is very important, as the URIs are not guaranteed to be identical between versions of the platform.

Parameters:
pin - Plugin
path - Resource to retrieve. This may be any resource in the web application space.
Returns:
Properly formatted URI, including virtual installation stem

getUri

public static java.lang.String getUri(java.lang.String vid,
                                      java.lang.String handle,
                                      java.lang.String path)
Returns the a URI generated for this plugin and the specified resource. For example, if the plugin has a vendor id of Bb, and a handle of plugin, the following code fragment:

PlugInUtil.getUri( "bb", "plugin", "start.jsp" );

returns the string "/webapps/bb-plugin/start.jsp". Using this method for URL generation in a system extension is very important, as the URIs are not guaranteed to be identical between versions of the platform.

Parameters:
vid - Plugin vendor id
handle - Developer assigned handle for the plug in
path - Resource to retrieve. This may be any resource in the web application space.
Returns:
Properly formatted URI

getCourseId

public static Id getCourseId(javax.servlet.http.HttpServletRequest request)
Returns the CourseId given an HttpServletRequest object

Parameters:
request - HttpServletRequest from the session
Returns:
courseId Id object

getToolType

public static java.lang.String getToolType(NavigationItem item)
Returns a human readable name for specific navitem family identifiers.

Parameters:
item - Navigation item to detect type
Returns:
Human readable name.


Copyright © 2003 Blackboard, Inc. All Rights Reserved.