Class ApogeeDAO
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.datasource.AbstractMyBatisDAO
-
- org.ametys.plugins.odfsync.apogee.ApogeeDAO
-
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Component
,Configurable
,Contextualizable
,Serviceable
public class ApogeeDAO extends AbstractMyBatisDAO
Data access object to the remote DB Apogee
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
DATASOURCE_REQUEST_ATTR
The name of request attribute for the datasource idstatic String
ROLE
Avalon ROLE-
Fields inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
_manager
-
-
Constructor Summary
Constructors Constructor Description ApogeeDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_configureDatasource(Configuration configuration)
Configure datasourceprotected List<Map<String,Object>>
_executeSearch(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params, String query)
Returns the Apogee objects matching the search criteria on the asked statement.protected String
_getDataSourceId()
Get datasource idprotected org.apache.ibatis.session.Configuration
_getMyBatisConfiguration(org.apache.ibatis.mapping.Environment env)
Get the mybatis configurationprotected Request
_getRequest()
Get the requestprotected void
_prepareSqlRequest(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Common method to prepare the SQL request to executevoid
contextualize(Context context)
List<Map<String,Object>>
getAddElements(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the add elements (rich texts) to a programList<Map<String,Object>>
getCourseParts(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the course parts (hours) to a courseList<Map<String,Object>>
getDomains(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the domains to a programList<Map<String,Object>>
getFormOfTeachingOrg(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns form of teaching linked to a programList<Map<String,Object>>
getJointOrgUnits(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns joint org units linked to a programList<Map<String,Object>>
searchContainers(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns Apogee containers matching the search criteriaList<Map<String,Object>>
searchCourseLists(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the Apogee course lists matching the search criteriaList<Map<String,Object>>
searchCourses(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the Apogee educational elements matching the search criteriaList<Map<String,Object>>
searchOrgUnits(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns Apogee organizational units matching the search criteriaList<Map<String,Object>>
searchPrograms(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns Apogee programs matching the search criteriaList<Map<String,Object>>
searchSubPrograms(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns Apogee subprograms matching the search criteria-
Methods inherited from class org.ametys.core.datasource.AbstractMyBatisDAO
configure, getSession, getSession, reload, service, setPluginInfo
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
DATASOURCE_REQUEST_ATTR
protected static final String DATASOURCE_REQUEST_ATTR
The name of request attribute for the datasource id
-
-
Constructor Detail
-
ApogeeDAO
public ApogeeDAO()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Overrides:
contextualize
in classAbstractMyBatisDAO
- Throws:
ContextException
-
_getMyBatisConfiguration
protected org.apache.ibatis.session.Configuration _getMyBatisConfiguration(org.apache.ibatis.mapping.Environment env)
Description copied from class:AbstractMyBatisDAO
Get the mybatis configuration- Overrides:
_getMyBatisConfiguration
in classAbstractMyBatisDAO
- Parameters:
env
- the mybatis environnement- Returns:
- the mybatis configuration
-
_configureDatasource
protected void _configureDatasource(Configuration configuration) throws ConfigurationException
Description copied from class:AbstractMyBatisDAO
Configure datasource- Overrides:
_configureDatasource
in classAbstractMyBatisDAO
- Parameters:
configuration
- the configuration- Throws:
ConfigurationException
- if an error occurred
-
_getDataSourceId
protected String _getDataSourceId()
Description copied from class:AbstractMyBatisDAO
Get datasource id- Overrides:
_getDataSourceId
in classAbstractMyBatisDAO
- Returns:
- the datasource id
-
_getRequest
protected Request _getRequest()
Get the request- Returns:
- the request
-
searchPrograms
public List<Map<String,Object>> searchPrograms(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns Apogee programs matching the search criteria- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: DIP code, VDI code, title- Returns:
- the list Apogee course lists matching the search criteria
-
getJointOrgUnits
public List<Map<String,Object>> getJointOrgUnits(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns joint org units linked to a program- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: Program ID- Returns:
- The list of Apogee joint org units matching the program
-
getFormOfTeachingOrg
public List<Map<String,Object>> getFormOfTeachingOrg(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns form of teaching linked to a program- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: Program ID- Returns:
- The list of Apogee form of teaching matching the program
-
getAddElements
public List<Map<String,Object>> getAddElements(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the add elements (rich texts) to a program- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: Program ID- Returns:
- The list of Apogee add elements matching the program
-
getDomains
public List<Map<String,Object>> getDomains(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the domains to a program- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: Program ID- Returns:
- The list of Apogee domains matching the program
-
searchOrgUnits
public List<Map<String,Object>> searchOrgUnits(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns Apogee organizational units matching the search criteria- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: cod_cmp, cod_tpc, title- Returns:
- The list of Apogee organizational units matching the search criteria
-
searchContainers
public List<Map<String,Object>> searchContainers(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns Apogee containers matching the search criteria- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: code, type, title- Returns:
- The list of Apogee containers matching the search criteria
-
searchSubPrograms
public List<Map<String,Object>> searchSubPrograms(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns Apogee subprograms matching the search criteria- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: "dip", "vdi", "vdi-ter", "etp-code", "vet-code", "vet-title"- Returns:
- The list of Apogee subprograms matching the search criteria
-
searchCourses
public List<Map<String,Object>> searchCourses(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the Apogee educational elements matching the search criteria- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: ELP code (code), ELP type (type), title (title)- Returns:
- the list of Apogee educational elements matching the search criteria
-
getCourseParts
public List<Map<String,Object>> getCourseParts(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the course parts (hours) to a course- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: Course ID- Returns:
- The list of Apogee course parts matching the course
-
searchCourseLists
public List<Map<String,Object>> searchCourseLists(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Returns the Apogee course lists matching the search criteria- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteria: ELP code (code), NEL code (cod_nel), title (title)- Returns:
- the list Apogee course lists matching the search criteria
-
_executeSearch
protected List<Map<String,Object>> _executeSearch(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params, String query)
Returns the Apogee objects matching the search criteria on the asked statement.- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the Apogee synchronizable collectionparams
- The parameters for search criteriaquery
- The query identifier to execute- Returns:
- the list Apogee objects matching the search criteria
-
_prepareSqlRequest
protected void _prepareSqlRequest(String dataSourceId, Map<String,Object> sccParams, Map<String,Object> params)
Common method to prepare the SQL request to execute- Parameters:
dataSourceId
- The id of data source. Can not be null.sccParams
- the parameters values of the used Apogee synchronizable collectionparams
- the SQL parameters
-
-