org.sakaiproject.tool.assessment.shared.api.assessment
Interface SecureDeliveryServiceAPI


public interface SecureDeliveryServiceAPI

Author:
Luis Camargo (lcamargo@respondus.com)

Nested Class Summary
static class SecureDeliveryServiceAPI.Phase
           
static class SecureDeliveryServiceAPI.PhaseStatus
           
 
Field Summary
static String EXITPWD_KEY
           
static String MODULE_KEY
           
static String NONE_ID
           
static String TITLE_DECORATION
           
 
Method Summary
 String decryptPassword(String moduleId, String password)
          Uses the module specified to decrypt the exit password.
 String encryptPassword(String moduleId, String password)
          Uses the module specified to encrypt the exit password before storing it on the assessment settings.
 String getHTMLFragment(String moduleId, PublishedAssessmentIfc assessment, javax.servlet.http.HttpServletRequest request, SecureDeliveryServiceAPI.Phase phase, SecureDeliveryServiceAPI.PhaseStatus status, Locale locale)
          Returns an HTML appropriate for the combination of parameters.
 String getInitialHTMLFragments(javax.servlet.http.HttpServletRequest request, Locale locale)
          Returns the initial HTML fragments for all active modules.
 SecureDeliveryModuleIfc getModuleReference(String moduleId, Object context)
          Helper method to obtain a reference to the runtime instance of the module specified.
 SortedSet<RegisteredSecureDeliveryModuleIfc> getSecureDeliveryModules(Locale locale)
           
 String getTitleDecoration(String moduleId, Locale locale)
           
 boolean isSecureDeliveryAvaliable()
           
 boolean isSecureDeliveryModuleAvailable(String moduleId)
           
 SecureDeliveryServiceAPI.PhaseStatus validatePhase(String moduleId, SecureDeliveryServiceAPI.Phase phase, PublishedAssessmentIfc assessment, javax.servlet.http.HttpServletRequest request)
          Checks with the module specified by moduleId if the current delivery phase can continue.
 

Field Detail

MODULE_KEY

static final String MODULE_KEY
See Also:
Constant Field Values

EXITPWD_KEY

static final String EXITPWD_KEY
See Also:
Constant Field Values

TITLE_DECORATION

static final String TITLE_DECORATION
See Also:
Constant Field Values

NONE_ID

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

isSecureDeliveryAvaliable

boolean isSecureDeliveryAvaliable()
Returns:
true if at least one secure delivery module (other than NONE_ID) is available. A secure delivery module is available if the plugin that provides it was successfully loaded.

isSecureDeliveryModuleAvailable

boolean isSecureDeliveryModuleAvailable(String moduleId)
Parameters:
moduleId -
Returns:
true if the module with moduleId is available. NONE_ID is always available.

getSecureDeliveryModules

SortedSet<RegisteredSecureDeliveryModuleIfc> getSecureDeliveryModules(Locale locale)
Returns:
A set of RegisteredSecureDeliveryModuleIfc entries with the module name internationalized for the given locale. The list always includes NONE_ID as its first element. Others are ordered alphabetically by their name.

getTitleDecoration

String getTitleDecoration(String moduleId,
                          Locale locale)
Parameters:
moduleId -
locale -
Returns:
The title decoration for the given module and locale. Returns empty string if moduleId is NONE_ID, null, not available or disabled. The title decoration provides a visual indication that the assesment requires a particular secure delivery module.

validatePhase

SecureDeliveryServiceAPI.PhaseStatus validatePhase(String moduleId,
                                                   SecureDeliveryServiceAPI.Phase phase,
                                                   PublishedAssessmentIfc assessment,
                                                   javax.servlet.http.HttpServletRequest request)
Checks with the module specified by moduleId if the current delivery phase can continue. Returns SUCCESS if moduleId is null or NONE_ID or if the module is no longer available or disabled.

Parameters:
moduleId -
phase -
assessment -
request -
Returns:

getInitialHTMLFragments

String getInitialHTMLFragments(javax.servlet.http.HttpServletRequest request,
                               Locale locale)
Returns the initial HTML fragments for all active modules. The fragments are inserted into the assessment list.

Parameters:
request -
locale -
Returns:

getHTMLFragment

String getHTMLFragment(String moduleId,
                       PublishedAssessmentIfc assessment,
                       javax.servlet.http.HttpServletRequest request,
                       SecureDeliveryServiceAPI.Phase phase,
                       SecureDeliveryServiceAPI.PhaseStatus status,
                       Locale locale)
Returns an HTML appropriate for the combination of parameters. The fragment is injected during delivery. Returns empty string if module id is null or NONE_ID or if the module is no longer available or disabled.

Parameters:
moduleId -
assessment -
request -
phase -
status -
locale -
Returns:

encryptPassword

String encryptPassword(String moduleId,
                       String password)
Uses the module specified to encrypt the exit password before storing it on the assessment settings. The encryption method used is up to the module implementation. Returns the same password if module id is null or NONE_ID or if the module is no longer available.

Parameters:
moduleId -
password -
Returns:
the encrypted password

decryptPassword

String decryptPassword(String moduleId,
                       String password)
Uses the module specified to decrypt the exit password. The encryption method used is up to the module implementation. Returns the same password if module id is null or NONE_ID or if the module is no longer available.

Parameters:
moduleId -
password -
Returns:
the plain text password

getModuleReference

SecureDeliveryModuleIfc getModuleReference(String moduleId,
                                           Object context)
Helper method to obtain a reference to the runtime instance of the module specified. The context object provided is passed to the module itself for validation and the reference is only returned if the module validation is successful. How the actual context type and how it's validated is up to each module implementation.

Parameters:
moduleId -
context -
Returns:
the reference. null if the module is not avaliable or if the module rejected the context


Copyright © 2005-2013 Sakai Project. All Rights Reserved.