001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/tags/sakai_2-4-1/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/web/action/InitAction.java $
003: * $Id: InitAction.java 20617 2007-01-24 07:11:56Z 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.ui.web.action;
021:
022: import javax.servlet.http.HttpServlet;
023:
024: import org.apache.commons.logging.Log;
025: import org.apache.commons.logging.LogFactory;
026: import org.sakaiproject.component.cover.ComponentManager;
027:
028: import org.sakaiproject.tool.assessment.facade.AssessmentFacadeQueriesAPI;
029: import org.sakaiproject.tool.assessment.facade.AssessmentGradingFacadeQueriesAPI;
030: import org.sakaiproject.tool.assessment.facade.AuthzQueriesFacadeAPI;
031: import org.sakaiproject.tool.assessment.facade.ItemFacadeQueriesAPI;
032: import org.sakaiproject.tool.assessment.facade.PublishedAssessmentFacadeQueriesAPI;
033: import org.sakaiproject.tool.assessment.facade.QuestionPoolFacadeQueriesAPI;
034: import org.sakaiproject.tool.assessment.facade.SectionFacadeQueriesAPI;
035: import org.sakaiproject.tool.assessment.facade.TypeFacadeQueriesAPI;
036: import org.sakaiproject.tool.assessment.facade.authz.AuthorizationFacadeQueriesAPI;
037: import org.sakaiproject.tool.assessment.facade.util.PagingUtilQueriesAPI;
038: import org.sakaiproject.tool.assessment.services.PersistenceService;
039: import org.sakaiproject.tool.assessment.shared.api.assessment.AssessmentServiceAPI;
040: import org.sakaiproject.tool.assessment.shared.api.assessment.ItemServiceAPI;
041: import org.sakaiproject.tool.assessment.shared.api.assessment.PublishedAssessmentServiceAPI;
042: import org.sakaiproject.tool.assessment.shared.api.assessment.SectionServiceAPI;
043: import org.sakaiproject.tool.assessment.shared.api.common.MediaServiceAPI;
044: import org.sakaiproject.tool.assessment.shared.api.common.TypeServiceAPI;
045: import org.sakaiproject.tool.assessment.shared.api.grading.GradebookServiceAPI;
046: import org.sakaiproject.tool.assessment.shared.api.grading.GradingServiceAPI;
047: import org.sakaiproject.tool.assessment.shared.api.qti.QTIServiceAPI;
048: import org.sakaiproject.tool.assessment.shared.api.questionpool.QuestionPoolServiceAPI;
049: import org.sakaiproject.tool.assessment.api.SamigoApiFactory;
050: import org.sakaiproject.tool.assessment.services.assessment.AssessmentEntityProducer;
051:
052: public class InitAction extends HttpServlet {
053:
054: /**
055: *
056: */
057: private static final long serialVersionUID = 8101462284850616249L;
058: private static Log log = LogFactory.getLog(InitAction.class);
059:
060: public void init() {
061: // store all types in memory
062: TypeFacadeQueriesAPI typeFacadeQueries = PersistenceService
063: .getInstance().getTypeFacadeQueries();
064: log.debug("*****#1 InitAction: "
065: + PersistenceService.getInstance());
066: log.debug("*****#2 InitAction: typeFacadeQueries ="
067: + typeFacadeQueries);
068: if (typeFacadeQueries != null) {
069: typeFacadeQueries.setTypeFacadeMap();
070: typeFacadeQueries.setFacadeItemTypes();
071: }
072:
073: // questionpool facade
074: QuestionPoolFacadeQueriesAPI questionpoolFacadeQueries = PersistenceService
075: .getInstance().getQuestionPoolFacadeQueries();
076: log.debug("*****#3 InitAction: questionpoolFacadeQueries ="
077: + questionpoolFacadeQueries);
078:
079: // assessment facade
080: AssessmentFacadeQueriesAPI assessmentFacadeQueries = PersistenceService
081: .getInstance().getAssessmentFacadeQueries();
082: log.debug("*****#4 InitAction: assessmentFacadeQueries ="
083: + assessmentFacadeQueries);
084:
085: // item facade
086: ItemFacadeQueriesAPI itemFacadeQueries = PersistenceService
087: .getInstance().getItemFacadeQueries();
088: log.debug("*****#5 InitAction: itemFacadeQueries ="
089: + itemFacadeQueries);
090:
091: // section facade
092: SectionFacadeQueriesAPI sectionFacadeQueries = PersistenceService
093: .getInstance().getSectionFacadeQueries();
094: log.debug("*****#6 InitAction: sectionFacadeQueries ="
095: + sectionFacadeQueries);
096:
097: // published assessment facade
098: PublishedAssessmentFacadeQueriesAPI publishedAssessmentFacadeQueries = PersistenceService
099: .getInstance().getPublishedAssessmentFacadeQueries();
100: log
101: .debug("*****#7 InitAction: publishedAssessmentFacadeQueries ="
102: + publishedAssessmentFacadeQueries);
103:
104: // assessment grading facade
105: AssessmentGradingFacadeQueriesAPI assessmentGradingFacadeQueries = PersistenceService
106: .getInstance().getAssessmentGradingFacadeQueries();
107: log
108: .debug("*****#8 InitAction: assessmentGradingFacadeQueries ="
109: + assessmentGradingFacadeQueries);
110:
111: // authorization facade
112: AuthorizationFacadeQueriesAPI authorizationFacadeQueries = PersistenceService
113: .getInstance().getAuthorizationFacadeQueries();
114: log.debug("*****#9 InitAction: authorizationFacadeQueries ="
115: + authorizationFacadeQueries);
116:
117: // PagingUtil
118: PagingUtilQueriesAPI pagingUtilQueries = PersistenceService
119: .getInstance().getPagingUtilQueries();
120: log.debug("*****#10 InitAction: pagingUtilQueries ="
121: + pagingUtilQueries);
122:
123: // authorization facade
124: AuthzQueriesFacadeAPI authzQueriesFacade = PersistenceService
125: .getInstance().getAuthzQueriesFacade();
126: log.debug("*****#11 InitAction: authzQueriesFacade ="
127: + authzQueriesFacade);
128:
129: log.debug("*** LOADING EXTERNAL API ***");
130: log
131: .debug("*****#12 InitAction: SamigoApiFactory.getInstance()="
132: + SamigoApiFactory.getInstance());
133:
134: AssessmentServiceAPI assessmentServiceAPI = SamigoApiFactory
135: .getInstance().getAssessmentServiceAPI();
136: log.debug("AssessmentServiceAPI: " + assessmentServiceAPI);
137:
138: GradebookServiceAPI gradebookServiceAPI = SamigoApiFactory
139: .getInstance().getGradebookServiceAPI();
140: log.debug("GradebookServiceAPI: " + gradebookServiceAPI);
141:
142: GradingServiceAPI gradingServiceAPI = SamigoApiFactory
143: .getInstance().getGradingServiceAPI();
144: log.debug("gradingServiceAPI: " + gradingServiceAPI);
145:
146: ItemServiceAPI itemServiceAPI = SamigoApiFactory.getInstance()
147: .getItemServiceAPI();
148: log.debug("ItemServiceAPI: " + itemServiceAPI);
149:
150: MediaServiceAPI mediaServiceAPI = SamigoApiFactory
151: .getInstance().getMediaServiceAPI();
152: log.debug("MediaServiceAPI: " + mediaServiceAPI);
153:
154: PublishedAssessmentServiceAPI publishedAssessmentServiceAPI = SamigoApiFactory
155: .getInstance().getPublishedAssessmentServiceAPI();
156: log.debug("PublishedAssessmentServiceAPI: "
157: + publishedAssessmentServiceAPI);
158:
159: QTIServiceAPI qtiServiceAPI = SamigoApiFactory.getInstance()
160: .getQtiServiceAPI();
161: log.debug("QtiServiceAPI: " + qtiServiceAPI);
162:
163: QuestionPoolServiceAPI questionPoolServiceAPI = SamigoApiFactory
164: .getInstance().getQuestionPoolServiceAPI();
165: log.debug("QuestionPoolServiceAPI: " + questionPoolServiceAPI);
166:
167: SectionServiceAPI sectionServiceAPI = SamigoApiFactory
168: .getInstance().getSectionServiceAPI();
169: log.debug("SectionServiceAPI: " + sectionServiceAPI);
170:
171: TypeServiceAPI typeServiceAPI = SamigoApiFactory.getInstance()
172: .getTypeServiceAPI();
173: log.debug("TypeServiceAPI: " + typeServiceAPI);
174:
175: AssessmentEntityProducer producer = (AssessmentEntityProducer) ComponentManager
176: .get("org.sakaiproject.tool.assessment.services.assessment.AssessmentEntityProducer");
177: log.debug("AssessmentEntityProducer: " + producer);
178: }
179: }
|