001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/facade/AssessmentFacadeQueriesAPI.java $
003: * $Id: AssessmentFacadeQueriesAPI.java 9273 2006-05-10 22:34:28Z daisyf@stanford.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the"License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.tool.assessment.facade;
021:
022: import java.util.ArrayList;
023: import java.util.HashMap;
024: import java.util.List;
025:
026: import org.sakaiproject.tool.assessment.data.dao.assessment.AssessmentBaseData;
027: import org.sakaiproject.tool.assessment.data.dao.assessment.AssessmentData;
028: import org.sakaiproject.tool.assessment.data.dao.assessment.AssessmentTemplateData;
029: import org.sakaiproject.tool.assessment.data.dao.assessment.AttachmentData;
030: import org.sakaiproject.tool.assessment.data.dao.assessment.SectionData;
031: import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentAttachmentIfc;
032: import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentBaseIfc;
033: import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentIfc;
034: import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemAttachmentIfc;
035: import org.sakaiproject.tool.assessment.data.ifc.assessment.ItemDataIfc;
036: import org.sakaiproject.tool.assessment.data.ifc.assessment.SectionAttachmentIfc;
037: import org.sakaiproject.tool.assessment.data.ifc.assessment.SectionDataIfc;
038: import org.sakaiproject.tool.assessment.osid.shared.impl.IdImpl;
039:
040: public interface AssessmentFacadeQueriesAPI {
041:
042: public IdImpl getId(String id);
043:
044: public IdImpl getId(Long id);
045:
046: public IdImpl getId(long id);
047:
048: public IdImpl getAssessmentId(String id);
049:
050: public IdImpl getAssessmentId(Long id);
051:
052: public IdImpl getAssessmentId(long id);
053:
054: public IdImpl getAssessmentTemplateId(String id);
055:
056: public IdImpl getAssessmentTemplateId(Long id);
057:
058: public IdImpl getAssessmentTemplateId(long id);
059:
060: public Long addTemplate();
061:
062: public void removeTemplate(Long assessmentId);
063:
064: public Long addAssessment(Long assessmentTemplateId);
065:
066: public AssessmentBaseData load(Long id);
067:
068: public AssessmentTemplateData loadTemplate(Long assessmentTemplateId);
069:
070: public AssessmentData loadAssessment(Long assessmentId);
071:
072: /*
073: * The following methods are real
074: *
075: */
076: public AssessmentTemplateFacade getAssessmentTemplate(
077: Long assessmentTemplateId);
078:
079: public ArrayList getAllAssessmentTemplates();
080:
081: public ArrayList getAllActiveAssessmentTemplates();
082:
083: /**
084: *
085: * @return a list of AssessmentTemplateFacade. However, it is IMPORTANT to
086: * note that it is not a full object, it contains merely
087: * assessmentBaseId (which is the templateId) & title. This methods
088: * is used when a list of template titles is required for displaying
089: * purposes.
090: */
091: public ArrayList getTitleOfAllActiveAssessmentTemplates();
092:
093: public AssessmentFacade getAssessment(Long assessmentId);
094:
095: public void removeAssessment(Long assessmentId);
096:
097: public AssessmentData cloneAssessmentFromTemplate(
098: AssessmentTemplateData t);
099:
100: /**
101: * This method is the same as createAssessment() except that no default
102: * section will be created with the assessment.
103: */
104: public AssessmentFacade createAssessmentWithoutDefaultSection(
105: String title, String description, Long typeId,
106: Long templateId) throws Exception;
107:
108: public AssessmentFacade createAssessment(String title,
109: String description, Long typeId, Long templateId)
110: throws Exception;
111:
112: public ArrayList getAllAssessments(String orderBy);
113:
114: public ArrayList getAllActiveAssessments(String orderBy);
115:
116: public ArrayList getBasicInfoOfAllActiveAssessments(String orderBy,
117: boolean ascending);
118:
119: public ArrayList getBasicInfoOfAllActiveAssessmentsByAgent(
120: String orderBy, String siteAgentId, boolean ascending);
121:
122: public ArrayList getBasicInfoOfAllActiveAssessmentsByAgent(
123: String orderBy, String siteAgentId);
124:
125: public AssessmentFacade getBasicInfoOfAnAssessment(Long assessmentId);
126:
127: public ArrayList getSettingsOfAllActiveAssessments(String orderBy);
128:
129: public ArrayList getAllAssessments(int pageSize, int pageNumber,
130: String orderBy);
131:
132: public int getQuestionSize(final Long assessmentId);
133:
134: public void deleteAllSecuredIP(AssessmentIfc assessment);
135:
136: public void saveOrUpdate(AssessmentFacade assessment);
137:
138: public void saveOrUpdate(AssessmentTemplateData template);
139:
140: public void deleteTemplate(Long templateId);
141:
142: public SectionFacade addSection(Long assessmentId);
143:
144: public SectionFacade getSection(Long sectionId);
145:
146: public void removeSection(Long sectionId);
147:
148: public SectionData loadSection(Long sectionId);
149:
150: public void saveOrUpdateSection(SectionFacade section);
151:
152: /**
153: * This method move a set of questions form one section to another
154: *
155: * @param sourceSectionId
156: * @param destSectionId
157: */
158: public void moveAllItems(Long sourceSectionId, Long destSectionId);
159:
160: public ArrayList getBasicInfoOfAllActiveAssessmentTemplates(
161: String orderBy);
162:
163: public void checkForQuestionPoolItem(AssessmentData assessment,
164: HashMap qpItemHash);
165:
166: public void checkForQuestionPoolItem(SectionData section,
167: HashMap qpItemHash);
168:
169: public void removeAllItems(Long sourceSectionId);
170:
171: public boolean assessmentTitleIsUnique(Long assessmentBaseId,
172: String title, Boolean isTemplate);
173:
174: public List getAssessmentByTemplate(Long templateId);
175:
176: public List getDefaultMetaDataSet();
177:
178: public void deleteAllMetaData(AssessmentBaseIfc assessment);
179:
180: public ItemAttachmentIfc createItemAttachment(ItemDataIfc item,
181: String resourceId, String filename, String protocol);
182:
183: public void removeItemAttachment(Long itemAttachmentId);
184:
185: public void updateAssessmentLastModifiedInfo(
186: AssessmentFacade assessmentFacade);
187:
188: public SectionAttachmentIfc createSectionAttachment(
189: SectionDataIfc section, String resourceId, String filename,
190: String protocol);
191:
192: public void removeSectionAttachment(Long sectionAttachmentId);
193:
194: public AssessmentAttachmentIfc createAssessmentAttachment(
195: AssessmentIfc assessment, String resourceId,
196: String filename, String protocol);
197:
198: public void removeAssessmentAttachment(Long assessmentAttachmentId);
199:
200: public AttachmentData createEmailAttachment(String resourceId,
201: String filename, String protocol);
202:
203: public void saveOrUpdateAttachments(List list);
204:
205: public String getAssessmentSiteId(String assessmentId);
206:
207: public String getAssessmentCreatedBy(String assessmentId);
208:
209: public void copyAllAssessments(String fromContext, String toContext);
210:
211: public List getAllActiveAssessmentsByAgent(String fromContext);
212:
213: }
|