org.sakaiproject.lti.impl
Class BaseLTIService

java.lang.Object
  extended by org.sakaiproject.lti.impl.BaseLTIService
All Implemented Interfaces:
LTIService
Direct Known Subclasses:
DBLTIService

public abstract class BaseLTIService
extends Object
implements LTIService

Implements the LTIService, all but a Storage model.


Field Summary
protected static SakaiFoorm foorm
           
 String LAUNCH_PREFIX
           
protected  org.sakaiproject.event.api.EventTrackingService m_eventTrackingService
          Dependency: EventTrackingService
protected  org.sakaiproject.tool.api.SessionManager m_sessionManager
          Dependency: SessionManager
protected  org.sakaiproject.event.api.UsageSessionService m_usageSessionService
          Dependency: UsageSessionService
protected  org.sakaiproject.user.api.UserDirectoryService m_userDirectoryService
          Dependency: UserDirectoryService
protected static org.sakaiproject.util.ResourceLoader rb
          Resource bundle using current language locale
protected  org.sakaiproject.authz.api.SecurityService securityService
           
protected  org.sakaiproject.site.api.SiteService siteService
           
protected  org.sakaiproject.tool.api.ToolManager toolManager
           
 
Fields inherited from interface org.sakaiproject.lti.api.LTIService
CONTENT_MODEL, LTI_ALLOWCONSUMERKEY, LTI_ALLOWCUSTOM, LTI_ALLOWFRAMEHEIGHT, LTI_ALLOWLAUNCH, LTI_ALLOWLORI, LTI_ALLOWOUTCOMES, LTI_ALLOWPAGETITLE, LTI_ALLOWROSTER, LTI_ALLOWSECRET, LTI_ALLOWSETTINGS, LTI_ALLOWTITLE, LTI_CONSUMERKEY, LTI_CREATED_AT, LTI_CUSTOM, LTI_DEBUG, LTI_DESCRIPTION, LTI_FRAMEHEIGHT, LTI_ID, LTI_LAUNCH, LTI_MATCHPATTERN, LTI_NEWPAGE, LTI_NOTE, LTI_OLDPLACEMENTSECRET, LTI_PAGETITLE, LTI_PLACEMENT, LTI_PLACEMENTSECRET, LTI_SECRET, LTI_SECRET_INCOMPLETE, LTI_SENDEMAILADDR, LTI_SENDNAME, LTI_SETTINGS, LTI_SITE_ID, LTI_SPLASH, LTI_STATUS, LTI_TITLE, LTI_TOOL_ID, LTI_UPATED_AT, LTI_VISIBLE, LTI_XMLIMPORT, MAPPING_MODEL, REFERENCE_ROOT, TOOL_MODEL, WEB_PORTLET
 
Constructor Summary
BaseLTIService()
           
 
Method Summary
 boolean deleteContent(Long key)
           
protected abstract  boolean deleteContentDao(Long key, String siteId, boolean isMaintainRole)
           
 String deleteContentLink(Long key)
           
 String deleteContentLinkDao(Long key, String siteId)
           
protected  String deleteContentLinkDao(Long key, String siteId, boolean isMaintainRole)
           
 boolean deleteTool(Long key)
           
 boolean deleteToolDao(Long key, String siteId)
           
 void destroy()
          Returns to uninitialized state.
 void filterContent(Map<String,Object> content, Map<String,Object> tool)
           
 String formInput(Object row, String fieldInfo)
          
 String formInput(Object row, String[] fieldInfo)
          
 String formOutput(Object row, String fieldInfo)
          
 String formOutput(Object row, String[] fieldInfo)
          
 Map<String,Object> getContent(Long key)
           
 Map<String,Object> getContent(Long key, String siteId)
           
 Map<String,Object> getContentDao(Long key)
           
 Map<String,Object> getContentDao(Long key, String siteId)
           
protected abstract  Map<String,Object> getContentDao(Long key, String siteId, boolean isMaintainRole)
           
 String getContentLaunch(Map<String,Object> content)
          
 String[] getContentModel(Long tool_id)
           
 String[] getContentModel(Map<String,Object> tool)
           
 String[] getContentModelDao(Map<String,Object> tool, String siteId)
          
protected  String[] getContentModelDao(Map<String,Object> tool, String siteId, boolean isMaintainRole)
          
 List<Map<String,Object>> getContents(String search, String order, int first, int last)
           
 List<Map<String,Object>> getContentsDao(String search, String order, int first, int last, String siteId)
           
protected abstract  List<Map<String,Object>> getContentsDao(String search, String order, int first, int last, String siteId, boolean isMaintainRole)
           
protected  String getContext()
           
static Integer getCorrectProperty(String propName, Map<String,Object> content, Map<String,Object> tool)
           
static int getInt(Object o)
           
 String[] getMappingModel()
           
protected  void getServices()
          Pull in any necessary services using factory pattern
 Map<String,Object> getTool(Long key)
           
 Map<String,Object> getTool(String url)
          
 Map<String,Object> getToolDao(Long key, String siteId)
           
protected abstract  Map<String,Object> getToolDao(Long key, String siteId, boolean isMaintainRole)
           
 String[] getToolModel()
          
 String[] getToolModelDao(String siteId)
          
 String[] getToolModelDao(String siteId, boolean isMaintainRole)
          
 List<Map<String,Object>> getTools(String search, String order, int first, int last)
           
 List<Map<String,Object>> getToolsDao(String search, String order, int first, int last, String siteId)
           
protected abstract  List<Map<String,Object>> getToolsDao(String search, String order, int first, int last, String siteId, boolean isMaintain)
           
 void init()
          Final initialization, once all dependencies are set.
 Object insertContent(Properties newProps)
           
 Object insertContentDao(Properties newProps, String siteId)
           
protected abstract  Object insertContentDao(Properties newProps, String siteId, boolean isMaintainRole)
           
 Object insertTool(Properties newProps)
           
 Object insertToolContent(String id, String toolId, Properties reqProps)
           
 Object insertToolContent(String id, String toolId, Properties reqProps, String siteId)
           
 Object insertToolContentDao(String id, String toolId, Properties reqProps, String siteId)
           
protected  Object insertToolContentDao(String id, String toolId, Properties reqProps, String siteId, boolean isMaintainRole)
           
 Object insertToolDao(Properties newProps, String siteId)
           
protected abstract  Object insertToolDao(Properties newProps, String siteId, boolean isMaintainRole)
           
 Object insertToolSiteLink(String id, String button_text)
           
 Object insertToolSiteLink(String id, String button_text, String siteId)
           
protected  Object insertToolSiteLinkDao(String id, String button_text, String siteId, boolean isMaintainRole)
           
 boolean isAdmin()
          
protected  boolean isAdmin(String siteId)
           
protected  boolean isAdmin(String siteId, boolean isMaintainRole)
           
 boolean isMaintain()
          
protected  boolean isMaintain(String siteId)
           
 void setEventTrackingService(org.sakaiproject.event.api.EventTrackingService service)
          Dependency: EventTrackingService.
 void setSessionManager(org.sakaiproject.tool.api.SessionManager service)
          Dependency: SessionManager.
 void setUsageSessionService(org.sakaiproject.event.api.UsageSessionService service)
          Dependency: UsageSessionService.
 void setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService service)
          Dependency: UserDirectoryService.
 Object updateContent(Long key, Map<String,Object> newProps)
          
 Object updateContent(Long key, Object newProps)
           
 Object updateContent(Long key, Properties newProps)
          
 Object updateContent(Long key, Properties newProps, String siteId)
           
 Object updateContentDao(Long key, Map<String,Object> newProps, String siteId)
           
protected abstract  Object updateContentDao(Long key, Object newProps, String siteId, boolean isMaintainRole)
           
 Object updateMapping(Long key, Map<String,Object> newProps)
          
abstract  Object updateMapping(Long key, Object newProps)
           
 Object updateMapping(Long key, Properties newProps)
          
 Object updateTool(Long key, Map<String,Object> newProps)
          Simple API signature for the update series of methods
protected  Object updateTool(Long key, Object newProps)
          
 Object updateTool(Long key, Properties newProps)
          Simple API signature for the update series of methods
 Object updateToolDao(Long key, Map<String,Object> newProps, String siteId)
          
abstract  Object updateToolDao(Long key, Object newProps, String siteId, boolean isMaintainRole)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sakaiproject.lti.api.LTIService
checkMapping, deleteMapping, getMapping, getMappings, insertMapping
 

Field Detail

LAUNCH_PREFIX

public final String LAUNCH_PREFIX
See Also:
Constant Field Values

rb

protected static org.sakaiproject.util.ResourceLoader rb
Resource bundle using current language locale


foorm

protected static SakaiFoorm foorm

m_sessionManager

protected org.sakaiproject.tool.api.SessionManager m_sessionManager
Dependency: SessionManager


m_usageSessionService

protected org.sakaiproject.event.api.UsageSessionService m_usageSessionService
Dependency: UsageSessionService


m_userDirectoryService

protected org.sakaiproject.user.api.UserDirectoryService m_userDirectoryService
Dependency: UserDirectoryService


m_eventTrackingService

protected org.sakaiproject.event.api.EventTrackingService m_eventTrackingService
Dependency: EventTrackingService


securityService

protected org.sakaiproject.authz.api.SecurityService securityService

siteService

protected org.sakaiproject.site.api.SiteService siteService

toolManager

protected org.sakaiproject.tool.api.ToolManager toolManager
Constructor Detail

BaseLTIService

public BaseLTIService()
Method Detail

setSessionManager

public void setSessionManager(org.sakaiproject.tool.api.SessionManager service)
Dependency: SessionManager.

Parameters:
service - The SessionManager.

setUsageSessionService

public void setUsageSessionService(org.sakaiproject.event.api.UsageSessionService service)
Dependency: UsageSessionService.

Parameters:
service - The UsageSessionService.

setUserDirectoryService

public void setUserDirectoryService(org.sakaiproject.user.api.UserDirectoryService service)
Dependency: UserDirectoryService.

Parameters:
service - The UserDirectoryService.

setEventTrackingService

public void setEventTrackingService(org.sakaiproject.event.api.EventTrackingService service)
Dependency: EventTrackingService.

Parameters:
service - The EventTrackingService.

getServices

protected void getServices()
Pull in any necessary services using factory pattern


init

public void init()
Final initialization, once all dependencies are set.


destroy

public void destroy()
Returns to uninitialized state.


getMappingModel

public String[] getMappingModel()
Specified by:
getMappingModel in interface LTIService

getToolModel

public String[] getToolModel()

Specified by:
getToolModel in interface LTIService
See Also:
LTIService.getToolModel()

getToolModelDao

public String[] getToolModelDao(String siteId)

See Also:
org.sakaiproject.lti.api.LTIService#getToolModelDao()

getToolModelDao

public String[] getToolModelDao(String siteId,
                                boolean isMaintainRole)

See Also:
org.sakaiproject.lti.api.LTIService#getToolModelDao(java.lang.String, boolean)

getContentModel

public String[] getContentModel(Map<String,Object> tool)
Specified by:
getContentModel in interface LTIService

getContentModel

public String[] getContentModel(Long tool_id)
Specified by:
getContentModel in interface LTIService

getContentModelDao

public String[] getContentModelDao(Map<String,Object> tool,
                                   String siteId)

See Also:
org.sakaiproject.lti.api.LTIService#getContentModel(Map, java.lang.String)

getContentModelDao

protected String[] getContentModelDao(Map<String,Object> tool,
                                      String siteId,
                                      boolean isMaintainRole)

See Also:
org.sakaiproject.lti.api.LTIService#getContentModel(Map, java.lang.String, boolean)

getContext

protected String getContext()
Returns:

getContentLaunch

public String getContentLaunch(Map<String,Object> content)

Specified by:
getContentLaunch in interface LTIService
See Also:
LTIService.getContentLaunch(java.util.Map)

formOutput

public String formOutput(Object row,
                         String fieldInfo)

Specified by:
formOutput in interface LTIService
See Also:
LTIService.formOutput(java.lang.Object, java.lang.String)

formOutput

public String formOutput(Object row,
                         String[] fieldInfo)

Specified by:
formOutput in interface LTIService
See Also:
LTIService.formOutput(java.lang.Object, java.lang.String[])

formInput

public String formInput(Object row,
                        String fieldInfo)

Specified by:
formInput in interface LTIService
See Also:
LTIService.formInput(java.lang.Object, java.lang.String)

formInput

public String formInput(Object row,
                        String[] fieldInfo)

Specified by:
formInput in interface LTIService
See Also:
LTIService.formInput(java.lang.Object, java.lang.String[])

isAdmin

public boolean isAdmin()

Specified by:
isAdmin in interface LTIService
See Also:
LTIService.isAdmin()

isAdmin

protected boolean isAdmin(String siteId)

isAdmin

protected boolean isAdmin(String siteId,
                          boolean isMaintainRole)

isMaintain

public boolean isMaintain()

Specified by:
isMaintain in interface LTIService
See Also:
LTIService.isMaintain()

isMaintain

protected boolean isMaintain(String siteId)

updateTool

public Object updateTool(Long key,
                         Map<String,Object> newProps)
Simple API signature for the update series of methods

Specified by:
updateTool in interface LTIService

updateTool

public Object updateTool(Long key,
                         Properties newProps)
Simple API signature for the update series of methods

Specified by:
updateTool in interface LTIService

updateTool

protected Object updateTool(Long key,
                            Object newProps)

See Also:
updateTool(java.lang.Long, java.lang.Object)

updateToolDao

public Object updateToolDao(Long key,
                            Map<String,Object> newProps,
                            String siteId)

See Also:
org.sakaiproject.lti.impl.BaseLTIService#updateToolDao(java.lang.Long, java.lang.Object, java.lang.String)

updateToolDao

public abstract Object updateToolDao(Long key,
                                     Object newProps,
                                     String siteId,
                                     boolean isMaintainRole)
Parameters:
key -
newProps -
siteId -
isMaintainRole -
Returns:

updateMapping

public Object updateMapping(Long key,
                            Map<String,Object> newProps)

Specified by:
updateMapping in interface LTIService
See Also:
LTIService.updateMapping(java.lang.Long, java.util.Map)

updateMapping

public Object updateMapping(Long key,
                            Properties newProps)

Specified by:
updateMapping in interface LTIService
See Also:
LTIService.updateMapping(java.lang.Long, java.util.Properties)

updateMapping

public abstract Object updateMapping(Long key,
                                     Object newProps)
Parameters:
key -
newProps -
Returns:

updateContent

public Object updateContent(Long key,
                            Map<String,Object> newProps)

Specified by:
updateContent in interface LTIService
See Also:
LTIService.updateContent(java.lang.Long, java.util.Map)

updateContent

public Object updateContent(Long key,
                            Properties newProps)

Specified by:
updateContent in interface LTIService
See Also:
LTIService.updateContent(java.lang.Long, java.util.Properties)

updateContent

public Object updateContent(Long key,
                            Properties newProps,
                            String siteId)
Specified by:
updateContent in interface LTIService
Parameters:
key -
newProps -
siteId -
Returns:

updateContent

public Object updateContent(Long key,
                            Object newProps)
Parameters:
key -
newProps -
Returns:

updateContentDao

public Object updateContentDao(Long key,
                               Map<String,Object> newProps,
                               String siteId)
Specified by:
updateContentDao in interface LTIService
Parameters:
key -
newProps -
siteId -
Returns:

updateContentDao

protected abstract Object updateContentDao(Long key,
                                           Object newProps,
                                           String siteId,
                                           boolean isMaintainRole)

deleteContent

public boolean deleteContent(Long key)
Specified by:
deleteContent in interface LTIService

deleteContentDao

protected abstract boolean deleteContentDao(Long key,
                                            String siteId,
                                            boolean isMaintainRole)

getInt

public static int getInt(Object o)
Parameters:
o -
Returns:

filterContent

public void filterContent(Map<String,Object> content,
                          Map<String,Object> tool)
Specified by:
filterContent in interface LTIService

getCorrectProperty

public static Integer getCorrectProperty(String propName,
                                         Map<String,Object> content,
                                         Map<String,Object> tool)
Parameters:
propName -
content -
tool -
Returns:

insertTool

public Object insertTool(Properties newProps)
Specified by:
insertTool in interface LTIService

insertToolDao

public Object insertToolDao(Properties newProps,
                            String siteId)
Specified by:
insertToolDao in interface LTIService

insertToolDao

protected abstract Object insertToolDao(Properties newProps,
                                        String siteId,
                                        boolean isMaintainRole)

deleteTool

public boolean deleteTool(Long key)
Specified by:
deleteTool in interface LTIService

deleteToolDao

public boolean deleteToolDao(Long key,
                             String siteId)

getTool

public Map<String,Object> getTool(String url)

Specified by:
getTool in interface LTIService
See Also:
LTIService.getTool(java.lang.String)

getTool

public Map<String,Object> getTool(Long key)
Specified by:
getTool in interface LTIService

getToolDao

public Map<String,Object> getToolDao(Long key,
                                     String siteId)
Specified by:
getToolDao in interface LTIService

getToolDao

protected abstract Map<String,Object> getToolDao(Long key,
                                                 String siteId,
                                                 boolean isMaintainRole)

getTools

public List<Map<String,Object>> getTools(String search,
                                         String order,
                                         int first,
                                         int last)
Specified by:
getTools in interface LTIService

getToolsDao

public List<Map<String,Object>> getToolsDao(String search,
                                            String order,
                                            int first,
                                            int last,
                                            String siteId)
Specified by:
getToolsDao in interface LTIService

getToolsDao

protected abstract List<Map<String,Object>> getToolsDao(String search,
                                                        String order,
                                                        int first,
                                                        int last,
                                                        String siteId,
                                                        boolean isMaintain)

insertContent

public Object insertContent(Properties newProps)
Specified by:
insertContent in interface LTIService

insertContentDao

public Object insertContentDao(Properties newProps,
                               String siteId)
Specified by:
insertContentDao in interface LTIService

insertContentDao

protected abstract Object insertContentDao(Properties newProps,
                                           String siteId,
                                           boolean isMaintainRole)

getContent

public Map<String,Object> getContent(Long key)
Specified by:
getContent in interface LTIService

getContent

public Map<String,Object> getContent(Long key,
                                     String siteId)
Specified by:
getContent in interface LTIService

getContentDao

public Map<String,Object> getContentDao(Long key)
Specified by:
getContentDao in interface LTIService

getContentDao

public Map<String,Object> getContentDao(Long key,
                                        String siteId)
Specified by:
getContentDao in interface LTIService

getContentDao

protected abstract Map<String,Object> getContentDao(Long key,
                                                    String siteId,
                                                    boolean isMaintainRole)

getContents

public List<Map<String,Object>> getContents(String search,
                                            String order,
                                            int first,
                                            int last)
Specified by:
getContents in interface LTIService

getContentsDao

public List<Map<String,Object>> getContentsDao(String search,
                                               String order,
                                               int first,
                                               int last,
                                               String siteId)

getContentsDao

protected abstract List<Map<String,Object>> getContentsDao(String search,
                                                           String order,
                                                           int first,
                                                           int last,
                                                           String siteId,
                                                           boolean isMaintainRole)

insertToolContent

public Object insertToolContent(String id,
                                String toolId,
                                Properties reqProps)
Specified by:
insertToolContent in interface LTIService

insertToolContent

public Object insertToolContent(String id,
                                String toolId,
                                Properties reqProps,
                                String siteId)
Specified by:
insertToolContent in interface LTIService

insertToolContentDao

public Object insertToolContentDao(String id,
                                   String toolId,
                                   Properties reqProps,
                                   String siteId)

insertToolContentDao

protected Object insertToolContentDao(String id,
                                      String toolId,
                                      Properties reqProps,
                                      String siteId,
                                      boolean isMaintainRole)

insertToolSiteLink

public Object insertToolSiteLink(String id,
                                 String button_text)
Specified by:
insertToolSiteLink in interface LTIService

insertToolSiteLink

public Object insertToolSiteLink(String id,
                                 String button_text,
                                 String siteId)
Specified by:
insertToolSiteLink in interface LTIService

insertToolSiteLinkDao

protected Object insertToolSiteLinkDao(String id,
                                       String button_text,
                                       String siteId,
                                       boolean isMaintainRole)

deleteContentLink

public String deleteContentLink(Long key)
Specified by:
deleteContentLink in interface LTIService

deleteContentLinkDao

public String deleteContentLinkDao(Long key,
                                   String siteId)

deleteContentLinkDao

protected String deleteContentLinkDao(Long key,
                                      String siteId,
                                      boolean isMaintainRole)


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