Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -rc21c3386cec2ee819ba267d84d532676d2f4990d -rfa5eb10796d2b7d6bf2f15b0a96abac6b2fe47f1 Binary files differ Index: lams_common/src/java/org/lamsfoundation/lams/commonContext.xml =================================================================== diff -u -rd3652e3ff709d9aadb114b14107ec24e1f385b1f -rfa5eb10796d2b7d6bf2f15b0a96abac6b2fe47f1 --- lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision d3652e3ff709d9aadb114b14107ec24e1f385b1f) +++ lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision fa5eb10796d2b7d6bf2f15b0a96abac6b2fe47f1) @@ -175,6 +175,21 @@ + + + + + + + + + + + + + + + Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java =================================================================== diff -u -r28143b7c8f1bf58ef463c6ddc7ab2c41c6df030f -rfa5eb10796d2b7d6bf2f15b0a96abac6b2fe47f1 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision 28143b7c8f1bf58ef463c6ddc7ab2c41c6df030f) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision fa5eb10796d2b7d6bf2f15b0a96abac6b2fe47f1) @@ -102,7 +102,6 @@ import org.lamsfoundation.lams.usermanagement.WorkspaceFolder; import org.lamsfoundation.lams.util.FileUtil; import org.lamsfoundation.lams.util.FileUtilException; -import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.zipfile.ZipFileUtil; import org.lamsfoundation.lams.util.zipfile.ZipFileUtilException; import org.springframework.beans.BeansException; @@ -120,7 +119,7 @@ */ public class ExportToolContentService implements IExportToolContentService, ApplicationContextAware { public static final String LEARNING_DESIGN_SERVICE_BEAN_NAME = "learningDesignService"; - public static final String MESSAGE_SERVICE_BEAN_NAME = "commonMessageService"; + public static final String LD102IMPORTER_BEAN_NAME = "ld102Importer"; //export tool content zip file prefix public static final String EXPORT_TOOLCONTNET_ZIP_PREFIX = "lams_toolcontent_"; @@ -457,10 +456,8 @@ public Long importLearningDesign102(String ldWddxPacket, User importer, Integer workspaceFolderUid , List toolsErrorMsgs) throws ImportToolContentException { WorkspaceFolder folder = getWorkspaceFolderForDesign(importer, workspaceFolderUid); - LD102Importer oldImporter = new LD102Importer(getLearningDesignService(), getMessageService(), - baseDAO, learningDesignDAO, learningLibraryDAO, activityDAO, toolDAO, - toolImportSupportDAO, toolContentDAO, systemToolDAO, toolsErrorMsgs); - return oldImporter.storeLDDataWDDX(ldWddxPacket, importer, folder); + LD102Importer oldImporter = getLD102Importer(); + return oldImporter.storeLDDataWDDX(ldWddxPacket, importer, folder, toolsErrorMsgs); } @@ -696,10 +693,11 @@ private ILearningDesignService getLearningDesignService(){ return (ILearningDesignService) applicationContext.getBean(LEARNING_DESIGN_SERVICE_BEAN_NAME); } - private MessageService getMessageService(){ - return (MessageService) applicationContext.getBean(MESSAGE_SERVICE_BEAN_NAME); + private LD102Importer getLD102Importer(){ + return (LD102Importer) applicationContext.getBean(LD102IMPORTER_BEAN_NAME); } + private Object findToolService(Tool tool) throws NoSuchBeanDefinitionException { return applicationContext.getBean(tool.getServiceName()); Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LD102Importer.java =================================================================== diff -u -r28143b7c8f1bf58ef463c6ddc7ab2c41c6df030f -rfa5eb10796d2b7d6bf2f15b0a96abac6b2fe47f1 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LD102Importer.java (.../LD102Importer.java) (revision 28143b7c8f1bf58ef463c6ddc7ab2c41c6df030f) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LD102Importer.java (.../LD102Importer.java) (revision fa5eb10796d2b7d6bf2f15b0a96abac6b2fe47f1) @@ -57,6 +57,7 @@ import org.lamsfoundation.lams.tool.SystemTool; import org.lamsfoundation.lams.tool.Tool; import org.lamsfoundation.lams.tool.ToolContent; +import org.lamsfoundation.lams.tool.ToolContentImport102Manager; import org.lamsfoundation.lams.tool.ToolImportSupport; import org.lamsfoundation.lams.tool.dao.ISystemToolDAO; import org.lamsfoundation.lams.tool.dao.IToolContentDAO; @@ -67,14 +68,24 @@ import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.wddx.WDDXProcessor; import org.lamsfoundation.lams.util.wddx.WDDXProcessorConversionException; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; -/** Create a learning design from the LAMS 1.0.x WDDX packet. Used by the Import action. */ -public class LD102Importer { +/** + * Create a learning design from the LAMS 1.0.x WDDX packet. Used by the Import action. + * + * To be created using Spring, but it must not be a singleton as it has instance data. + * Requires a Spring context so that it can communicate with the tools to create the + * tool data. + */ +public class LD102Importer implements ApplicationContextAware{ private static final String MSG_KEY_PERM_GATE = "imported.permission.gate.title"; private static final String MSG_KEY_SYNC_GATE = "imported.synchronise.gate.title"; private Logger log = Logger.getLogger(LD102Importer.class); + private ApplicationContext context; private ILearningDesignService learningDesignService = null; private MessageService messageService = null; private IBaseDAO baseDAO = null; @@ -131,49 +142,14 @@ private static final String OPTIONAL_OBJECT_TYPE = "optionalactivity"; private static final String CONTENT_OBJECT_TYPE = "content"; - private static final String TOOLDATA_TAGS_TYPE_AUTHORING = "authoring"; - private static final String TOOLDATA_TAGS_JOURNAL = "journal"; - private static final String TOOLDATA_TAGS_NOTICEBOARD = "noticeboard"; - private static final String TOOLDATA_TAGS_MESSAGEBOARD = "messageboard"; - private static final String TOOLDATA_TAGS_LOMS = "loms"; - private static final String TOOLDATA_TAGS_CHAT = "chat"; - private static final String TOOLDATA_TAGS_RPT_SUBMIT= "reportsubmission"; - private static final String TOOLDATA_TAGS_RPT_MARK= "reportmarking"; - private static final String TOOLDATA_TAGS_GROUPING = "group"; - private static final String TOOLDATA_TAGS_GROUPREPORTING = "groupreporting"; - private static final String TOOLDATA_TAGS_RANKING = "ranking"; - private static final String TOOLDATA_TAGS_QUESTIONANSWER = "qa"; - private static final String TOOLDATA_TAGS_SIMPLE_ASSESSMENT = "simpleassessment"; - private static final String TOOLDATA_TAGS_URLCONTENT = "urlcontent"; - private static final String TOOLDATA_TAGS_FILECONTENT = "filecontent"; - private static final String TOOLDATA_TAGS_HTMLNOTICBOARD = "htmlnb"; - private static final String TOOLDATA_TAGS_SINGLE_RESOURCE = "singleresource"; - private static final String TOOLDATA_TAGS_IMAGEGALLERY = "imagegallery"; - private static final String TOOLDATA_TAGS_IMAGERANKING = "imageranking"; - - public LD102Importer(ILearningDesignService learningDesignService, MessageService messageService,IBaseDAO baseDAO, - ILearningDesignDAO learningDesignDAO, ILearningLibraryDAO learningLibraryDAO, IActivityDAO activityDAO, IToolDAO toolDAO, - IToolImportSupportDAO toolImportSupportDAO, IToolContentDAO toolContentDAO, ISystemToolDAO systemToolDAO, List toolsErrorMsgs) { - this.learningDesignService = learningDesignService; - this.messageService = messageService; - this.baseDAO = baseDAO; - this.learningLibraryDAO = learningLibraryDAO; - this.learningDesignDAO = learningDesignDAO; - this.activityDAO = activityDAO; - this.toolDAO = toolDAO; - this.systemToolDAO = systemToolDAO; - this.toolImportSupportDAO = toolImportSupportDAO; - this.toolContentDAO = toolContentDAO; - this.toolsErrorMsgs = toolsErrorMsgs; - if ( toolsErrorMsgs == null ) { - log.warn("The list toolsErrorMsgs supplied is null so any warnings will be logged but won't appear in the user's screen."); - toolsErrorMsgs = new ArrayList(); - } - - this.libraryActivityUiImages = getLibraryActivityUiImages(); - this.toolImportSupport = getToolImportSupport(); - } - + /** + * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext) + */ + public void setApplicationContext(ApplicationContext context) throws BeansException + { + this.context = context; + } + public void setLearningDesignService(ILearningDesignService learningDesignService) { this.learningDesignService = learningDesignService; } @@ -236,7 +212,7 @@ protected static boolean isSimpleTask(String objectType, String toolType) { if ( objectType!=null && toolType!=null && objectType.equalsIgnoreCase(ABSTRACT_TASK_OBJECT_TYPE) - && ! toolType.equalsIgnoreCase(TOOLDATA_TAGS_GROUPING) ) + && ! toolType.equalsIgnoreCase(ToolContentImport102Manager.TAGS_GROUPING) ) return true; else return false; @@ -249,7 +225,7 @@ protected static boolean isGroupingToolTask(String objectType, String toolType) { if ( objectType!=null && toolType!=null && objectType.equalsIgnoreCase(ABSTRACT_TASK_OBJECT_TYPE) - && toolType.equalsIgnoreCase(TOOLDATA_TAGS_GROUPING) ) + && toolType.equalsIgnoreCase(ToolContentImport102Manager.TAGS_GROUPING) ) return true; else return false; @@ -336,8 +312,16 @@ } - public Long storeLDDataWDDX(String ldWddxPacket, User importer, WorkspaceFolder folder) throws ImportToolContentException + public Long storeLDDataWDDX(String ldWddxPacket, User importer, WorkspaceFolder folder, List toolsErrorMsgs) throws ImportToolContentException { + this.libraryActivityUiImages = getLibraryActivityUiImages(); + this.toolImportSupport = getToolImportSupport(); + this.toolsErrorMsgs = toolsErrorMsgs; + if ( toolsErrorMsgs == null ) { + log.warn("The list toolsErrorMsgs supplied is null so any warnings will be logged but won't appear in the user's screen."); + toolsErrorMsgs = new ArrayList(); + } + originalPacket = ldWddxPacket; if (importer == null) @@ -457,9 +441,7 @@ // now set up the activity -> grouping defn links. Can't be done earlier as there // are the groupings are set up as the activities are processed. assignGroupings(); - - // finally set all the dummy output tasks to be replaced with dynamic content -// setOutputTasksAsReplaceWithDynamic(); + baseDAO.update(ldInProgress); } @@ -676,7 +658,7 @@ Iterator subTaskIterator = subTasks.iterator(); while (subTaskIterator.hasNext()) { Hashtable subTask = (Hashtable) subTaskIterator.next(); - if ( TOOLDATA_TAGS_JOURNAL.equals(subTask.get(WDDXTAGS102.TASK_TOOLTYPE)) ) { + if ( ToolContentImport102Manager.TAGS_JOURNAL.equals(subTask.get(WDDXTAGS102.TASK_TOOLTYPE)) ) { journalTaskInputContentId = WDDXProcessor.convertToInteger(subTask, WDDXTAGS102.TASK_INPUT_CONTENT); } } @@ -775,7 +757,6 @@ activity.setOrderId(null); // if needed, will be set when the parent activity is created. - activity.setDefineLater(Boolean.FALSE); activity.setLearningDesign(ldInProgress); activity.setCreateDateTime(createDate); activity.setRunOffline(Boolean.FALSE); @@ -871,7 +852,7 @@ return groupingActivity; } - private ToolActivity setupToolActivity(Hashtable taskDetails, Integer contentId, Integer taskUIID) { + private ToolActivity setupToolActivity(Hashtable taskDetails, Integer wddxContentId, Integer taskUIID) { ToolActivity activity = new ToolActivity(); activity.setActivityUIID(taskUIID); @@ -880,26 +861,50 @@ // first, find the matching new tool and set up the tool, tool content details. String toolType = (String) taskDetails.get(WDDXTAGS102.TASK_TOOLTYPE); + String title = (String) taskDetails.get(WDDXTAGS102.TITLE); Tool tool = toolType != null ? toolImportSupport.get(toolType) : null; if ( tool == null ) { - String message = "Unable to find a tool that supports the activity "+taskDetails.get(WDDXTAGS102.TITLE)+". This activity will be skipped. Activity is "+taskDetails; + String message = "Unable to find a tool that supports the activity "+title+". This activity will be skipped. Activity is "+taskDetails; log.warn(message); toolsErrorMsgs.add(message); return null; } ToolContent newContent = new ToolContent(tool); toolContentDAO.saveToolContent(newContent); - + Long toolContentId = newContent.getToolContentId(); + activity.setTool(tool); - activity.setToolContentId(newContent.getToolContentId()); + activity.setToolContentId(toolContentId); + + // Get the tool to create the "real" content */ + Hashtable content = contentMap.get(wddxContentId); + if ( content != null ) { + try { + Boolean defineLater = WDDXProcessor.convertToBoolean(content, ToolContentImport102Manager.CONTENT_DEFINE_LATER); + defineLater = defineLater != null ? defineLater : Boolean.FALSE; + activity.setDefineLater(defineLater); + + ToolContentImport102Manager toolService = (ToolContentImport102Manager) context.getBean(tool.getServiceName()); + toolService.import102ToolContent(toolContentId, ldInProgress.getUser().getUserId(), content); + } catch ( Exception e ) { + String message = "Tool content for activity "+title+" cannot be set up due to an error. Activity will be use the default content. Activity is "+taskDetails; + log.warn(message,e); + toolsErrorMsgs.add(message); + } + } else { + String message = "Tool content for activity "+title+" is missing. Activity will be set up with default content. Activity is "+taskDetails; + log.warn(message); + toolsErrorMsgs.add(message); + } // Now find an icon for the activity. The icon is in the activity tables so look for a library activity that matches this tool. // It may not always find the right icon if there is more than one possible match but its a start! activity.setLibraryActivityUiImage(libraryActivityUiImages.get(tool.getToolId())); return activity; } + /** * Get the grouping value for a particular task. Could be "c" for class or a number * which is the ui id of the related grouping task. Signify class in database as not grouped. @@ -987,14 +992,7 @@ } contentMap.put(objId, clientObj); - // TODO convert the content object to something we can use. - /* ContentConverter converter = new ContentConverter(); - aContent = converter.createNewContentObject((String) clientObj.get(WDDXTAGS102.CONTENT_TYPE)); - // create the content object in the database, get updated version - aContent = m_contentUtil.insertContent(aContent); - converter.convertToDBData(clientObj, aContent, objId); - m_contentUtil.updateContent(aContent); - */ + } catch ( WDDXProcessorConversionException e) { handleWDDXProcessorConversionException(e); } Index: lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentImport102Manager.java =================================================================== diff -u --- lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentImport102Manager.java (revision 0) +++ lams_common/src/java/org/lamsfoundation/lams/tool/ToolContentImport102Manager.java (revision fa5eb10796d2b7d6bf2f15b0a96abac6b2fe47f1) @@ -0,0 +1,188 @@ +/**************************************************************** + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id$ */ +package org.lamsfoundation.lams.tool; + +/** + * Tools that support this interface can import data from a LAMS 1.0.2. + * + * Tool do *not* need to implement this interface as part of the tool contract however + * many of the initial tools build for LAMS 2.0 do support this interface to + * allow 1.0.2 designs to be imported into 2.0. + * + * Any tool implementing a signature listed in the lams_tool_import_support table + * as supporting one of the 1.0.2 tool must implement this interface otherwise + * an exception will be thrown. + */ +import java.util.Map; + +import org.lamsfoundation.lams.tool.exception.ToolException; + +public interface ToolContentImport102Manager { + + public static final String TAGS_TYPE_AUTHORING = "authoring"; + public static final String TAGS_JOURNAL = "journal"; + public static final String TAGS_NOTICEBOARD = "noticeboard"; + public static final String TAGS_MESSAGEBOARD = "messageboard"; + public static final String TAGS_LOMS = "loms"; + public static final String TAGS_CHAT = "chat"; + public static final String TAGS_RPT_SUBMIT= "reportsubmission"; + public static final String TAGS_RPT_MARK= "reportmarking"; + public static final String TAGS_GROUPING = "group"; + public static final String TAGS_GROUPREPORTING = "groupreporting"; + public static final String TAGS_RANKING = "ranking"; + public static final String TAGS_QUESTIONANSWER = "qa"; + public static final String TAGS_SIMPLE_ASSESSMENT = "simpleassessment"; + public static final String TAGS_URLCONTENT = "urlcontent"; + public static final String TAGS_FILECONTENT = "filecontent"; + public static final String TAGS_HTMLNOTICBOARD = "htmlnb"; + public static final String TAGS_SINGLE_RESOURCE = "singleresource"; + public static final String TAGS_IMAGEGALLERY = "imagegallery"; + public static final String TAGS_IMAGERANKING = "imageranking"; + + public static final String CONTENT_BODY = "body"; // used + public static final String CONTENT_SHOW_USER = "contentShowUser"; // boolean + public static final String CONTENT_DEFINE_LATER = "contentDefineLater"; // boolean // used + public static final String CONTENT_TITLE = "title"; // used + public static final String CONTENT_ID = "id"; // used + + // contentType is based on the content class used - doesn't persist + public static final String CONTENT_TYPE = "contentType"; + public static final String CONTENT_NUMGROUPS = "number_groups"; + public static final String CONTENT_MINNUM_GROUP = "min_number_in_group"; + public static final String CONTENT_MAXNUM_GROUP = "max_number_in_group"; + + // Ranking tool tags + public static final String CONTENT_VOTE_MAXCHOOSE = "maxChoose"; + public static final String CONTENT_VOTE_METHOD = "voteMethod"; // equal vote or preferential + public static final String CONTENT_VOTE_NOMINATIONS = "nominations"; + public static final String CONTENT_VOTE_ALLOW_POLL_NOMINATIONS = "nominatePollTime"; // allow nomination or not (Boolean) + public static final String CONTENT_VOTE_PROGRESSIVE_DISPLAY = "progressive_display"; + + // url content + public static final String CONTENT_URL_MIN_NUMBER_COMPLETE = "minNumberComplete"; + public static final String CONTENT_URL_RUNTIME_STAFF_SUBMIT_URL = "runtimeSubmissionStaffURL"; + public static final String CONTENT_URL_RUNTIME_LEARNER_SUBMIT_URL = "runtimeSubmissionLearnerURL"; + public static final String CONTENT_URL_RUNTIME_STAFF_SUBMIT_FILE = "runtimeSubmissionStaffFile"; + public static final String CONTENT_URL_RUNTIME_LEARNER_SUBMIT_FILE = "runtimeSubmissionLearnerFile"; + public static final String CONTENT_URL_URLS = "urls"; + + public static final String CONTENT_URL_URL_SHOWBUTTONS = "showbuttons"; + public static final String CONTENT_URL_URL_VIEW_ORDER = "order"; + public static final String CONTENT_URL_URL_URL = "url"; + public static final String CONTENT_URL_URL_DOWNLOAD = "download"; // boolean: Author prefers that the content is downloaded. Only applicable to file content. + public static final String CONTENT_URL_URL_TYPE= "resourcetype"; // see URLContent TYPE_* fields + public static final String CONTENT_URL_URL_INSTRUCTION_ARRAY = "instructions"; + public static final String CONTENT_URL_INSTRUCTION = "instruction"; + + // message content + public static final String CONTENT_MB_TERMINATION_TYPE = "terminationType"; // type string + public static final String CONTENT_MB_DURATION_DAYS = "durationInDays"; // type string + public static final String CONTENT_MB_POSTING_NOTIFIED = "isPostingNotified"; // type boolean + public static final String CONTENT_MB_POSTING_MODERATED = "isPostingModerated"; // type boolean + public static final String CONTENT_MB_NEW_TOPIC_ALLOWED = "isNewTopicAllowed"; //type boolean + public static final String CONTENT_MB_REUSABLE = "isReusable"; //type boolean + public static final String CONTENT_MB_TOPICS = "topics"; // array + + public static final String CONTENT_MB_TOPIC_SUBJECT = "subject"; // string + public static final String CONTENT_MB_TOPIC_MESSAGE = "message"; // string + public static final String CONTENT_MB_TOPIC_NUMBER = "number"; // number + + // Simple Questions content + public static final String CONTENT_Q_SHOW_FEEDBACK = "showfeedback"; // boolean + public static final String CONTENT_Q_ALLOW_REDO = "allowredo"; // integer + public static final String CONTENT_Q_MIN_PASSMARK = "minpassmark"; // integer + public static final String CONTENT_Q_SHOW_TOP_USERNAMES= "showtopusernames"; // boolean + public static final String CONTENT_Q_ORDER = "order"; // integer + public static final String CONTENT_Q_QUESTION_INFO = "questionanswers"; // string + public static final String CONTENT_Q_QUESTION = "question"; // string + public static final String CONTENT_Q_FEEDBACK = "feedback"; // string + public static final String CONTENT_Q_CANDIDATES = "candidates"; // array of string + public static final String CONTENT_Q_ANSWER = "answer"; // string + + // for file upload - SingleResource, HTMLNoticeboard, Image tools + public static final String DIRECTORY_NAME = "directoryName"; + + // ImageGallery task tags (extended from Content.java) + public static final String CONTENT_IMGG_DIRECTORY = DIRECTORY_NAME; + public static final String CONTENT_IMGG_BODY = CONTENT_BODY; + public static final String CONTENT_IMGG_DEFINE_LATER = CONTENT_DEFINE_LATER; //Bolean + public static final String CONTENT_IMGG_GROUPING = "grouping"; + public static final String CONTENT_IMGG_SHOW_USER = CONTENT_SHOW_USER; + public static final String CONTENT_IMGG_MAX_IMAGES = "maxImages"; + public static final String CONTENT_IMGG_ALLOW_SEARCH = "allowSearch"; // Boolean + public static final String CONTENT_IMGG_SEARCH_URL = "searchURL"; + public static final String CONTENT_IMGG_ALLOW_URL = "allowURL"; // Boolean + public static final String CONTENT_IMGG_ALLOW_UPLOAD = "allowUpload"; + public static final String CONTENT_IMGG_IMAGES = CONTENT_URL_URLS; + + // ImageGallery images array (also used by ImageRanking) + public static final String CONTENT_IMGG_IMAGE_SID = "sid"; + public static final String CONTENT_IMGG_IMAGE_COMMENTS = "comments"; + public static final String CONTENT_IMGG_IMAGE_VIEW_ORDER = "order"; + public static final String CONTENT_IMGG_IMAGE_DATECREATED = "dateCreated"; + public static final String CONTENT_IMGG_IMAGE_DATEUPDATED = "dateUpdated"; + public static final String CONTENT_IMGG_IMAGE_TYPE = "type"; // "resourceType", values are "externalurl" or "file" + public static final String CONTENT_IMGG_IMAGE_URL = "url"; + public static final String CONTENT_IMGG_IMAGE_FILENAME = "filename"; + public static final String CONTENT_IMGG_IMAGE_PATH = "path"; + public static final String CONTENT_IMGG_IMAGE_OWNERID = "ownerId"; + public static final String CONTENT_IMGG_IMAGE_OWNERNAME = "owerName"; + // Additional field to use the image array for ImageRanking (runtime only) + public static final String CONTENT_IMGR_IMAGE_IS_SELECTED = "isSelected"; + + // ImageRanking task tags (extended from Content.java) + public static final String CONTENT_IMGR_DIRECTORY = DIRECTORY_NAME; + public static final String CONTENT_IMGR_BODY = CONTENT_BODY; // this is the description + public static final String CONTENT_IMGR_DEFINE_LATER = CONTENT_DEFINE_LATER; //Bolean + public static final String CONTENT_IMGR_GROUPING = "grouping"; + public static final String CONTENT_IMGR_SHOW_USER = CONTENT_SHOW_USER; + public static final String CONTENT_IMGR_MAX_VOTE = CONTENT_VOTE_MAXCHOOSE; + public static final String CONTENT_IMGR_PROGRESSIVE_DISPLAY = CONTENT_VOTE_PROGRESSIVE_DISPLAY; // Boolean + public static final String CONTENT_IMGR_IMAGES = CONTENT_URL_URLS; + // ImageRanking images array - same as the ImageGallery images array + + /** + * Import some 1.0.2 data, where the importValues is a map of the fields from the + * 1.0.2 content record. The keys are WDDX tags, values are the WDDX values as strings. + * The tools should call WDDXProcessor.convertToInteger(identifier, value) and similar + * methods to convert the values to a valid type. + * + * Tools should always set defineLater to false, even if the content indicates + * that defineLater is true. In 2.0, define later in the tool content is set up + * by the LAMS engine when the design is copied for a lesson, not during authoring. + * So setting it in the tool data now will wreck preview as the workflow engine doesn't + * set define later on the tools for preview. + * + * @param toolContentId new tool content id + * @param newUserId user id of the person importing the data + * @param importValues map of values to import. + * @throws ToolException if any other error occurs + */ + public void import102ToolContent(Long toolContentId, Integer newUserId, Map importValues) + throws ToolException; + + + +}