Index: lams_central/src/java/org/lamsfoundation/lams/rest/RestTags.java =================================================================== diff -u --- lams_central/src/java/org/lamsfoundation/lams/rest/RestTags.java (revision 0) +++ lams_central/src/java/org/lamsfoundation/lams/rest/RestTags.java (revision cc603dd74ff178c24fb743f0dc61d6a4b8389946) @@ -0,0 +1,65 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.rest; + +/** Commonly used JSON tags for the calling the REST servlets */ +public class RestTags { + + public static String AUTH = "auth"; + public static String LEARNING_DESIGN = "ld"; + + /* Learning Design Related */ + public static String WORKSPACE_ID = "workspaceFolderID"; + public static String COPY_TYPE_ID = "copyTypeID"; + public static String TITLE = "title"; + public static String DESCRIPTION = "description"; + public static String MAX_ID = "maxID"; + public static String READ_ONLY = "readOnly"; + public static String EDIT_OVERRIDE_LOCK = "editOverrideLock"; + public static String CONTENT_FOLDER_ID = "contentFolderID"; + public static String SAVE_MODE = "saveMode"; + public static String VALID_DESIGN = "validDesign"; + public static String ACTIVITIES = "activities"; + public static String TRANSITIONS = "transitions"; + public static String GROUPINGS = "groupings"; + + /* Tool related - also TITLE but that is defined above. */ + public static String INSTRUCTIONS = "instructions"; + public static String LOCK_WHEN_FINISHED = "lockWhenFinished"; + public static String REFLECT_ON_ACTIVITY = "reflectOnActivity"; + public static String REFLECT_INSTRUCTIONS = "reflectInstructions"; + public static String SUBMISSION_DEADLINE = "submissionDeadline"; + public static String ALLOW_RICH_TEXT_EDITOR = "allowRichEditor"; + public static String USE_SELECT_LEADER_TOOL_OUTPUT = "useSelectLeaderToolOuput"; + + public static String QUESTIONS = "questions"; + public static String QUESTION_TEXT = "questionText"; + public static String QUESTION_TITLE = "questionTitle"; + public static String ANSWERS = "answers"; + public static String ANSWER_TEXT = "answerText"; + public static String DISPLAY_ORDER = "displayOrder"; + public static String CORRECT = "correct"; + + +} Index: lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java =================================================================== diff -u -r61c706419c438d5ef52d93bda3de1f7c415380ae -rcc603dd74ff178c24fb743f0dc61d6a4b8389946 --- lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java (.../LessonManagerServlet.java) (revision 61c706419c438d5ef52d93bda3de1f7c415380ae) +++ lams_central/src/java/org/lamsfoundation/lams/webservice/xml/LessonManagerServlet.java (.../LessonManagerServlet.java) (revision cc603dd74ff178c24fb743f0dc61d6a4b8389946) @@ -114,20 +114,23 @@ String datetime = request.getParameter(CentralConstants.PARAM_DATE_TIME); String hashValue = request.getParameter(CentralConstants.PARAM_HASH_VALUE); String username = request.getParameter(CentralConstants.PARAM_USERNAME); - String courseId = request.getParameter(CentralConstants.PARAM_COURSE_ID); String ldIdStr = request.getParameter(CentralConstants.PARAM_LEARNING_DESIGN_ID); String lsIdStr = request.getParameter(CentralConstants.PARAM_LESSON_ID); String country = request.getParameter(CentralConstants.PARAM_COUNTRY); String title = request.getParameter(CentralConstants.PARAM_TITLE); String desc = request.getParameter(CentralConstants.PARAM_DESC); String startDate = request.getParameter(CentralConstants.PARAM_STARTDATE); String lang = request.getParameter(CentralConstants.PARAM_LANG); - String method = request.getParameter(CentralConstants.PARAM_METHOD); String filePath = request.getParameter(CentralConstants.PARAM_FILEPATH); String outputsUser = request.getParameter("outputsUser"); String learnerIds = request.getParameter(CentralConstants.PARAM_LEARNER_IDS); String monitorIds = request.getParameter(CentralConstants.PARAM_MONITOR_IDS); + String method = request.getParameter(CentralConstants.PARAM_METHOD); + + /** CourseId isn't needed for a preview, but it is needed for the other calls */ + String courseId = WebUtil.readStrParam(request, CentralConstants.PARAM_COURSE_ID, method.equals(CentralConstants.METHOD_PREVIEW)); + // Custom CSV string to be used for tool adapters String customCSV = request.getParameter(CentralConstants.PARAM_CUSTOM_CSV); @@ -532,8 +535,6 @@ ExtServerOrgMap serverMap = LessonManagerServlet.integrationService.getExtServerOrgMap(serverId); Authenticator.authenticate(serverMap, datetime, username, hashValue); ExtUserUseridMap userMap = LessonManagerServlet.integrationService.getExtUserUseridMap(serverMap, username); - ExtCourseClassMap orgMap = LessonManagerServlet.integrationService.getExtCourseClassMap(serverMap, userMap, - courseId, countryIsoCode, langIsoCode, null, LoginRequestDispatcher.METHOD_MONITOR); Integer userId = userMap.getUser().getUserId(); // 1. init lesson