Index: lams_tool_wookie/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/conf/language/lams/ApplicationResources.properties,v diff -u -r1.3 -r1.4 --- lams_tool_wookie/conf/language/lams/ApplicationResources.properties 31 Jul 2009 04:17:02 -0000 1.3 +++ lams_tool_wookie/conf/language/lams/ApplicationResources.properties 31 Jul 2009 04:37:21 -0000 1.4 @@ -103,5 +103,9 @@ admin.page.title =Wookie Admin admin.return =Return to Maintain LAMS admin.success =Configuration successfully saved. +error.wookie.not.configured =To use this tool, you need to have the Wookie API key and URL configured in the admin pages. Please contact your System Administrator. +error.initiating.widget =There was a problem communicating with the Wookie widget server, please contact your System Administrator. +error.wookie.server =Error communicating with Wookie server, please contact your System Administrator. + #======= End labels: Exported 114 labels for en AU ===== Index: lams_tool_wookie/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.3 -r1.4 --- lams_tool_wookie/conf/language/lams/ApplicationResources_en_AU.properties 31 Jul 2009 04:17:02 -0000 1.3 +++ lams_tool_wookie/conf/language/lams/ApplicationResources_en_AU.properties 31 Jul 2009 04:37:21 -0000 1.4 @@ -103,5 +103,8 @@ admin.page.title =Wookie Admin admin.return =Return to Maintain LAMS admin.success =Configuration successfully saved. +error.wookie.not.configured =To use this tool, you need to have the Wookie API key and URL configured in the admin pages. Please contact your System Administrator. +error.initiating.widget =There was a problem communicating with the Wookie widget server, please contact your System Administrator. +error.wookie.server =Error communicating with Wookie server, please contact your System Administrator. #======= End labels: Exported 114 labels for en AU ===== Index: lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/wookieApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/wookieApplicationContext.xml,v diff -u -r1.1 -r1.2 --- lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/wookieApplicationContext.xml 28 Jul 2009 05:30:11 -0000 1.1 +++ lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/wookieApplicationContext.xml 31 Jul 2009 04:37:20 -0000 1.2 @@ -39,6 +39,8 @@ + + Index: lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/IWookieService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/IWookieService.java,v diff -u -r1.2 -r1.3 --- lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/IWookieService.java 31 Jul 2009 02:05:29 -0000 1.2 +++ lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/IWookieService.java 31 Jul 2009 04:37:21 -0000 1.3 @@ -192,5 +192,12 @@ * @return */ public String getWookieAPIKey(); + + /** + * Get an I18n message by key + * @param key + * @return + */ + public String getMessage(String key); } Index: lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/WookieService.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/WookieService.java,v diff -u -r1.2 -r1.3 --- lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/WookieService.java 31 Jul 2009 02:05:29 -0000 1.2 +++ lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/service/WookieService.java 31 Jul 2009 04:37:20 -0000 1.3 @@ -82,6 +82,7 @@ import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.ConfigurationKeys; import org.lamsfoundation.lams.util.FileUtil; +import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.util.audit.IAuditService; @@ -122,6 +123,8 @@ private WookieOutputFactory wookieOutputFactory; private IWookieConfigItemDAO wookieConfigItemDAO; + + private MessageService messageService; public WookieService() { super(); @@ -564,6 +567,10 @@ } return url; } + + public String getMessage(String key) { + return messageService.getMessage(key); + } /* ===============Methods implemented from ToolContentImport102Manager =============== */ @@ -709,4 +716,14 @@ public void setRepositoryService(IRepositoryService repositoryService) { this.repositoryService = repositoryService; } + + public MessageService getMessageService() { + return messageService; + } + + public void setMessageService(MessageService messageService) { + this.messageService = messageService; + } + + } Index: lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/web/actions/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/web/actions/AuthoringAction.java,v diff -u -r1.3 -r1.4 --- lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/web/actions/AuthoringAction.java 31 Jul 2009 04:17:02 -0000 1.3 +++ lams_tool_wookie/src/java/org/lamsfoundation/lams/tool/wookie/web/actions/AuthoringAction.java 31 Jul 2009 04:37:20 -0000 1.4 @@ -119,8 +119,7 @@ String wookieUrl = wookieService.getWookieURL(); if (wookieUrl == null) { - // TODO: Forward to error, citing that wookie is not configured properly - + throw new WookieException(wookieService.getMessage("error.wookie.not.configured")); } // Get the widget count @@ -137,13 +136,8 @@ request.setAttribute(WookieConstants.ATTR_WIDGET_PAGES, pages); } } catch (Exception e) { - logger.error("Problem reading xml from wookie server.", e); - - - - // TODO: Handle failed call to wookie server - - throw new WookieException(e); + logger.error("Error initiating widget on wookie server", e); + throw new WookieException(wookieService.getMessage("error.initiating.widget"), e); } // retrieving Wookie with given toolContentID @@ -199,7 +193,7 @@ try { String wookieUrl = wookieService.getWookieURL(); if (wookieUrl == null) { - // TODO: Forward to error, citing that wookie is not configured properly + throw new WookieException(wookieService.getMessage("error.wookie.not.configured")); } List widgetDefinitions = WookieUtil.getWidgetDefinitions(wookieUrl); Index: lams_tool_wookie/web/pages/authoring/basic.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_wookie/web/pages/authoring/basic.jsp,v diff -u -r1.3 -r1.4 --- lams_tool_wookie/web/pages/authoring/basic.jsp 31 Jul 2009 02:57:03 -0000 1.3 +++ lams_tool_wookie/web/pages/authoring/basic.jsp 31 Jul 2009 04:37:20 -0000 1.4 @@ -52,6 +52,9 @@ url: "/authoring.do", data: {dispatch : "getWidgets", pageNumber : 1}, cache: false, + error: function (XMLHttpRequest, textStatus, errorThrown) { + alert(''); + }, success: function (html) { jQuery("#result").html(html); } @@ -81,9 +84,7 @@ data: {dispatch :"initiateWidget", widgetid:widgetid, toolContentID:"${sessionMap.toolContentID}" }, cache: false, error: function (XMLHttpRequest, textStatus, errorThrown) { - - // TODO: Good error message - alert(errorThrown); + alert(''); }, success: function (xml) {