Index: lams_central/conf/language/applicationResources.properties =================================================================== diff -u --- lams_central/conf/language/applicationResources.properties (revision 0) +++ lams_central/conf/language/applicationResources.properties (revision 25ca503e49d83e167cf7661d8b67b4547ee0cb87) @@ -0,0 +1,58 @@ +# CVS ID: $Id$ +# Language strings for the Authoring and Workspace classes. Mostly error messages. + +#=========================Error Messages===========================# +error.authorisation=You are not authorised to do this. +error.newpassword.mismatch=Your new passwords don't match each other. +error.oldpassword.mismatch=Your old password is not correct. + +# Flash related messages + +flash.validation.error.other=Other Error +flash.validation.error.transitionNoActivityBeforeOrAfter=A Transition must have an activity before or after the transition +flash.validation.error.activityWithNoTransition=An activity must have an input or output transition +flash.validation.error.inputTransitionType1=There is more than one activity with no input transition +flash.validation.error.inputTransitionType2=No activities are missing their input transition. +flash.validation.error.outputTransitionType1=There is more than one activity with no output transition +flash.validation.error.outputTransitionType2=No activities are missing their output transition. +flash.validation.error.GroupingRequired=Grouping is required +flash.validation.error.GroupingNotRequired=Grouping is not supported +flash.validation.error.GroupingSelected=Grouping is selected but does not exist +flash.validation.error.OptionalActivity=An Optional Activity must have one or more activities +flash.validation.error.OptionalActivityOrderId=This Optional Activity has invalid order ids +flash.validation.error.illegalScheduleGateOffsetsType1=A Schedule Gate cannot have equal start and end time offsets. +flash.validation.error.illegalScheduleGateOffsetsType2=A Schedule Gate cannot have the start time offset greater than end time offset +# +invalid.wddx.packet=Invalid Object in WDDX packet. Error was {0}. +no.such.learningdesign.exist=No Learning Design with learning_design_id of:{0} exists. +no.such.user.exist=No such User with a user_id of: {0} exists. +no.such.workspace.exist=No such WorkspaceFolder with workspace_folder_id of:{0} exists. +#====================================================================# +#=========================WorkingSpace labels===========================# +#====================================================================# +delete.resource.error=Cannot delete the resource: {0} +delete.resource.error.value.miss=deleteResource(Long resourceID, String resourceType, Integer userID) requires a value for resourceID, resourceType and userID. +delete.lesson.error=LAMS does not support deleting a lesson via the workspace interface. +delete.folder.error=Cannot delete this folder as it is the Root folder. +delete.learningdesign.error=Cannot delete design with learning_design_id of : {0} as it is READ ONLY. +folder.delete=Folder deleted:{0} +copy.resource.error=Cannot copy the resource:{0} +copy.resource.error.value.miss=copyResource(Long resourceID,Integer targetFolderID, String resourceType, Integer userID) requires a value for resourceID, targetFolderID, resourceType and userID +copy.no.support=LAMS does not support copying a file via the workspace interface. +unable.copy=Unable to copy learning design due to an error{0}. +no.such.user=No such user with a userID of {0} exists. +no.such.workspace=No such workspaceFolder with a workspace_folder_id of {0} exists. +learningdesign.delete=Learning Design deleted:{0} +learningdesign.readonly=Cannot delete design with learning_design_id of:{0} as it is READ ONLY. +move.resource.error=Cannot move the resource:{0} +move.resrouce.error.value.miss=moveResource(Long resourceID,Integer targetFolderID, String resourceType, Integer userID) requires a value for resourceID, targetFolderID, resourceType and userID +unsupport.move=LAMS does not support moving a file via the workspace interface. +creating.workspace.folder.error= Exception occured while creating workspaceFolderContent:{0}. +resource.already.exist="The resource {0} already exists in the repository: {1}. +no.such.content="No such content with versionID of {0} found in repository {1}. +content.delete.success=Content Successfully deleted. +rename.resource.error=Cannot rename the resource: {0} +rename.resource.error.miss.vaue=renameResource(Long resourceID,Integer newName, String resourceType, Integer userID) requires a value for resourceID, targetFolderID, resourceType and userID. +rename.resource.unspport=LAMS does not support renaming a file via the workspace interface. +folder.already.exist=A folder with given name '{0}' already exists. +can.not.rename.root.folder=Cannot rename the ROOT folder. \ No newline at end of file Index: lams_central/conf/war/META-INF/MANIFEST.MF =================================================================== diff -u -r31bb64847befe2f009de312f08d2f34dafcd424f -r25ca503e49d83e167cf7661d8b67b4547ee0cb87 --- lams_central/conf/war/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision 31bb64847befe2f009de312f08d2f34dafcd424f) +++ lams_central/conf/war/META-INF/MANIFEST.MF (.../MANIFEST.MF) (revision 25ca503e49d83e167cf7661d8b67b4547ee0cb87) @@ -1 +1 @@ -Class-Path: ./lams.jar ./lams-contentrepository.jar \ No newline at end of file +Class-Path: ./lams.jar ./lams-contentrepository.jar ./lams-tool-lafrum11.jar ./lams-tool-laicp10.jar ./lams-tool-lamc11.jar ./lams-tool-lanb11.jar ./lams-tool-laqa11.jar ./lams-tool-lasbmt11.jar ./lams-tool-lasr10.jar \ No newline at end of file Index: lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml =================================================================== diff -u -rda6cbb5f4783fb429592a0010961e8666c90ffb0 -r25ca503e49d83e167cf7661d8b67b4547ee0cb87 --- lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml (.../authoringApplicationContext.xml) (revision da6cbb5f4783fb429592a0010961e8666c90ffb0) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/authoringApplicationContext.xml (.../authoringApplicationContext.xml) (revision 25ca503e49d83e167cf7661d8b67b4547ee0cb87) @@ -18,7 +18,8 @@ - + + @@ -34,6 +35,7 @@ + Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java =================================================================== diff -u -rda6cbb5f4783fb429592a0010961e8666c90ffb0 -r25ca503e49d83e167cf7661d8b67b4547ee0cb87 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision da6cbb5f4783fb429592a0010961e8666c90ffb0) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision 25ca503e49d83e167cf7661d8b67b4547ee0cb87) @@ -24,6 +24,7 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.Collection; import java.util.HashSet; import java.util.Hashtable; import java.util.Iterator; @@ -54,12 +55,10 @@ import org.lamsfoundation.lams.learningdesign.dao.hibernate.TransitionDAO; import org.lamsfoundation.lams.learningdesign.dto.DesignDetailDTO; import org.lamsfoundation.lams.learningdesign.dto.LearningDesignDTO; +import org.lamsfoundation.lams.learningdesign.dto.LearningLibraryDTO; +import org.lamsfoundation.lams.learningdesign.dto.LibraryActivityDTO; import org.lamsfoundation.lams.learningdesign.exception.LearningDesignException; import org.lamsfoundation.lams.learningdesign.service.ILearningDesignService; -import org.lamsfoundation.lams.themes.CSSThemeVisualElement; -import org.lamsfoundation.lams.themes.dao.ICSSThemeDAO; -import org.lamsfoundation.lams.themes.dto.CSSThemeBriefDTO; -import org.lamsfoundation.lams.themes.dto.CSSThemeDTO; import org.lamsfoundation.lams.tool.Tool; import org.lamsfoundation.lams.tool.ToolContentIDGenerator; import org.lamsfoundation.lams.tool.dao.hibernate.ToolDAO; @@ -73,13 +72,14 @@ import org.lamsfoundation.lams.usermanagement.exception.WorkspaceFolderException; import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.ConfigurationKeys; +import org.lamsfoundation.lams.util.ILoadedMessageSourceService; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.wddx.FlashMessage; import org.lamsfoundation.lams.util.wddx.WDDXProcessor; +import org.springframework.context.MessageSource; +import org.springframework.context.i18n.LocaleContextHolder; -import com.allaire.wddx.WddxDeserializationException; - /** * @author Manpreet Minhas */ @@ -101,6 +101,7 @@ protected ILamsCoreToolService lamsCoreToolService; protected ILearningDesignService learningDesignService; protected MessageService messageService; + protected ILoadedMessageSourceService toolActMessageService; protected ToolContentIDGenerator contentIDGenerator; @@ -187,6 +188,18 @@ this.lamsCoreToolService = lamsCoreToolService; } + /** Access a message service related to a programatically loaded message file. + * Authoring uses this to access the message files for tools and activities. + */ + public ILoadedMessageSourceService getToolActMessageService() { + return toolActMessageService; + } + + public void setToolActMessageService(ILoadedMessageSourceService toolActMessageService) { + this.toolActMessageService = toolActMessageService; + } + + public ILearningDesignService getLearningDesignService() { return learningDesignService; @@ -242,6 +255,7 @@ return learningLibraryDAO.getAllLearningLibraries(); } + /********************************************** * Utility/Service Methods * *******************************************/ @@ -503,7 +517,7 @@ */ public String getAllLearningLibraryDetails()throws IOException{ Iterator iterator= getAllLearningLibraries().iterator(); - ArrayList libraries = new ArrayList(); + ArrayList libraries = new ArrayList(); while(iterator.hasNext()){ LearningLibrary learningLibrary = (LearningLibrary)iterator.next(); List templateActivities = activityDAO.getActivitiesByLibraryID(learningLibrary.getLearningLibraryId()); @@ -512,12 +526,48 @@ { log.error("Learning Library with ID " + learningLibrary.getLearningLibraryId() + " does not have a template activity"); } - libraries.add(learningLibrary.getLearningLibraryDTO(templateActivities)); - //libraries.add(learningLibrary.getLearningLibraryDTO()); + // convert library to DTO format + LearningLibraryDTO libraryDTO = learningLibrary.getLearningLibraryDTO(templateActivities); + internationaliseActivities(libraryDTO.getTemplateActivities()); + libraries.add(libraryDTO); } flashMessage = new FlashMessage("getAllLearningLibraryDetails",libraries); return flashMessage.serializeMessage(); } + + private void internationaliseActivities(Collection activities) { + Iterator iter = activities.iterator(); + while (iter.hasNext()) { + LibraryActivityDTO activity = (LibraryActivityDTO) iter.next(); + // update the activity fields + String languageFilename = activity.getLanguageFile(); + if ( languageFilename != null ) { + MessageSource toolMessageSource = toolActMessageService.getMessageService(languageFilename); + if ( toolMessageSource != null ) { + activity.setTitle(toolMessageSource.getMessage(Activity.I8N_TITLE,null,activity.getTitle(),LocaleContextHolder.getLocale())); + activity.setDescription(toolMessageSource.getMessage(Activity.I8N_DESCRIPTION,null,activity.getDescription(),LocaleContextHolder.getLocale())); + activity.setHelpText(toolMessageSource.getMessage(Activity.I8N_HELP_TEXT,null,activity.getHelpText(),LocaleContextHolder.getLocale())); + } else { + log.warn("Unable to internationalise the library activity "+activity.getActivityID()+" "+activity.getTitle() + +" message file "+activity.getLanguageFile()+". Activity Message source not available"); + } + + // update the tool field + languageFilename = activity.getToolLanguageFile(); + toolMessageSource = toolActMessageService.getMessageService(languageFilename); + if ( toolMessageSource != null ) { + activity.setToolDisplayName(toolMessageSource.getMessage(Tool.I8N_DISPLAY_NAME,null,activity.getToolDisplayName(),LocaleContextHolder.getLocale())); + } else { + log.warn("Unable to internationalise the library activity "+activity.getActivityID()+" "+activity.getTitle() + +" message file "+activity.getLanguageFile()+". Tool Message source not available"); + } + + } else { + log.warn("Unable to internationalise the library activity "+activity.getActivityID()+" "+activity.getTitle() + +". No message file supplied."); + } + } + } /** @see org.lamsfoundation.lams.authoring.service.IAuthoringService#getToolContentID(java.lang.Long) */ @@ -577,5 +627,4 @@ learningDesignDAO.delete(design); } - } \ No newline at end of file Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java =================================================================== diff -u -r7ca446fc98c88feddc9b199d8326bd18c3e1426b -r25ca503e49d83e167cf7661d8b67b4547ee0cb87 --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision 7ca446fc98c88feddc9b199d8326bd18c3e1426b) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision 25ca503e49d83e167cf7661d8b67b4547ee0cb87) @@ -120,6 +120,7 @@ HttpServletResponse response)throws ServletException, IOException{ IAuthoringService authoringService = getAuthoringService(); String wddxPacket = authoringService.getAllLearningDesignDetails(); + log.debug("getAllLearningDesignDetails: returning "+wddxPacket); return outputPacket(mapping, request, response, wddxPacket, "details"); } @@ -129,6 +130,7 @@ HttpServletResponse response)throws ServletException, IOException{ IAuthoringService authoringService = getAuthoringService(); String wddxPacket = authoringService.getAllLearningLibraryDetails(); + log.debug("getAllLearningLibraryDetails: returning "+wddxPacket); return outputPacket(mapping, request, response, wddxPacket, "details"); } Fisheye: Tag 25ca503e49d83e167cf7661d8b67b4547ee0cb87 refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/central/applicationResources.properties'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/web/WEB-INF/struts/struts-config.xml =================================================================== diff -u -r62ffc2985a40f544eb48a69f2ad7f124b19a43fa -r25ca503e49d83e167cf7661d8b67b4547ee0cb87 --- lams_central/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 62ffc2985a40f544eb48a69f2ad7f124b19a43fa) +++ lams_central/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 25ca503e49d83e167cf7661d8b67b4547ee0cb87) @@ -106,6 +106,16 @@ /> + + storeTheme - org.lamsfoundation.lams.authoring.web.StoreThemeServlet + org.lamsfoundation.lams.themes.web.StoreThemeServlet @@ -256,7 +256,7 @@ storeTheme - /authoring/storeTheme + /themes/storeTheme