001/*
002 *  Copyright 2017 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.plugins.odfsync.apogee;
017
018import java.util.List;
019import java.util.Map;
020
021/**
022 * Data access object to the remote DB Apogee
023 */
024public class ApogeeDAO extends AbstractApogeeDAO
025{
026    /** Avalon ROLE */
027    public static final String ROLE = ApogeeDAO.class.getName();
028
029    /**
030     * Returns Apogee programs matching the search criteria
031     * @param dataSourceId The id of data source. Can not be null.
032     * @param sccParams the parameters values of the Apogee synchronizable collection
033     * @param params The parameters for search criteria: DIP code, VDI code, title
034     * @return the list Apogee course lists matching the search criteria
035     */
036    public List<Map<String, Object>> searchPrograms(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
037    {
038        return _executeSearch(dataSourceId, sccParams, params, "Apogee.searchPrograms");
039    }
040    
041    /**
042     * Returns joint org units linked to a program
043     * @param dataSourceId The id of data source. Can not be null.
044     * @param sccParams the parameters values of the Apogee synchronizable collection
045     * @param params The parameters for search criteria: Program ID
046     * @return The list of Apogee joint org units matching the program
047     */
048    public List<Map<String, Object>> getJointOrgUnits(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
049    {
050        return _executeSearch(dataSourceId, sccParams, params, "Apogee.getJointOrgUnits");
051    }
052
053    /**
054     * Returns form of teaching linked to a program
055     * @param dataSourceId The id of data source. Can not be null.
056     * @param sccParams the parameters values of the Apogee synchronizable collection
057     * @param params The parameters for search criteria: Program ID
058     * @return The list of Apogee form of teaching matching the program
059     */
060    public List<Map<String, Object>> getFormOfTeachingOrg(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
061    {
062        return _executeSearch(dataSourceId, sccParams, params, "Apogee.getFormOfTeachingOrg");
063    }
064    
065    /**
066     * Returns the add elements (rich texts) to a program
067     * @param dataSourceId The id of data source. Can not be null.
068     * @param sccParams the parameters values of the Apogee synchronizable collection
069     * @param params The parameters for search criteria: Program ID
070     * @return The list of Apogee add elements matching the program
071     */
072    public List<Map<String, Object>> getAddElements(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
073    {
074        return _executeSearch(dataSourceId, sccParams, params, "Apogee.getAddElements");
075    }
076    
077    /**
078     * Returns the domains to a program
079     * @param dataSourceId The id of data source. Can not be null.
080     * @param sccParams the parameters values of the Apogee synchronizable collection
081     * @param params The parameters for search criteria: Program ID
082     * @return The list of Apogee domains matching the program
083     */
084    public List<Map<String, Object>> getDomains(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
085    {
086        return _executeSearch(dataSourceId, sccParams, params, "Apogee.getDomains");
087    }
088    
089    /**
090     * Returns Apogee organizational units matching the search criteria
091     * @param dataSourceId The id of data source. Can not be null.
092     * @param sccParams the parameters values of the Apogee synchronizable collection
093     * @param params The parameters for search criteria: cod_cmp, cod_tpc, title
094     * @return The list of Apogee organizational units matching the search criteria
095     */
096    public List<Map<String, Object>> searchOrgUnits(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
097    {
098        return _executeSearch(dataSourceId, sccParams, params, "Apogee.searchOrgUnits");
099    }
100    
101    /**
102     * Returns Apogee containers matching the search criteria
103     * @param dataSourceId The id of data source. Can not be null.
104     * @param sccParams the parameters values of the Apogee synchronizable collection
105     * @param params The parameters for search criteria: code, type, title
106     * @return The list of Apogee containers matching the search criteria
107     */
108    public List<Map<String, Object>> searchContainers(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
109    {
110        return _executeSearch(dataSourceId, sccParams, params, "Apogee.searchContainers");
111    }
112    
113    /**
114     * Returns Apogee subprograms matching the search criteria
115     * @param dataSourceId The id of data source. Can not be null.
116     * @param sccParams the parameters values of the Apogee synchronizable collection
117     * @param params The parameters for search criteria: "dip", "vdi", "vdi-ter", "etp-code", "vet-code", "vet-title"
118     * @return The list of Apogee subprograms matching the search criteria
119     */
120    public List<Map<String, Object>> searchSubPrograms(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
121    {
122        return _executeSearch(dataSourceId, sccParams, params, "Apogee.searchSubPrograms");
123    }
124    
125    /**
126     * Returns the Apogee educational elements matching the search criteria
127     * @param dataSourceId The id of data source. Can not be null.
128     * @param sccParams the parameters values of the Apogee synchronizable collection
129     * @param params The parameters for search criteria: ELP code (code), ELP type (type), title (title)
130     * @return the list of Apogee educational elements matching the search criteria
131     */
132    public List<Map<String, Object>> searchCourses(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
133    {
134        return _executeSearch(dataSourceId, sccParams, params, "Apogee.searchCourses");
135    }
136    
137    /**
138     * Returns the course parts (hours) to a course
139     * @param dataSourceId The id of data source. Can not be null.
140     * @param sccParams the parameters values of the Apogee synchronizable collection
141     * @param params The parameters for search criteria: Course ID
142     * @return The list of Apogee course parts matching the course
143     */
144    public List<Map<String, Object>> searchCourseParts(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
145    {
146        return _executeSearch(dataSourceId, sccParams, params, "Apogee.searchCourseParts");
147    }
148    
149    /**
150     * Returns the Apogee course lists matching the search criteria
151     * @param dataSourceId The id of data source. Can not be null.
152     * @param sccParams the parameters values of the Apogee synchronizable collection
153     * @param params The parameters for search criteria: ELP code (code), NEL code (cod_nel), title (title)
154     * @return the list Apogee course lists matching the search criteria
155     */
156    public List<Map<String, Object>> searchCourseLists(String dataSourceId, Map<String, Object> sccParams, Map<String, Object> params)
157    {
158        return _executeSearch(dataSourceId, sccParams, params, "Apogee.searchCourseLists");
159    }
160}