Index: lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/LdTemplateController.java =================================================================== diff -u -r48cee0960880d01325c05aeb93dfa28896f8a36a -r10407509921c1b1233270863d7549ce68cc38c5c --- lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/LdTemplateController.java (.../LdTemplateController.java) (revision 48cee0960880d01325c05aeb93dfa28896f8a36a) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/template/web/LdTemplateController.java (.../LdTemplateController.java) (revision 10407509921c1b1233270863d7549ce68cc38c5c) @@ -36,8 +36,6 @@ import javax.servlet.http.HttpSession; import org.apache.http.HttpException; -import org.apache.http.client.HttpClient; -import org.apache.http.impl.client.DefaultHttpClient; import org.apache.log4j.Logger; import org.lamsfoundation.lams.authoring.service.IAuthoringFullService; import org.lamsfoundation.lams.authoring.template.Option; @@ -58,7 +56,6 @@ import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -87,19 +84,13 @@ public static final String PARENT_ACTIVITY_TYPE = "parentActivityType"; // used to work out transitions - not used by the authoring module - private final HttpClient httpClient = new DefaultHttpClient(); - @Autowired - @Qualifier("lamsCoreToolService") protected ILamsCoreToolService lamsCoreToolService; @Autowired - @Qualifier("workspaceManagementService") protected IWorkspaceManagementService workspaceManagementService; @Autowired - @Qualifier("authoringService") - protected IAuthoringFullService authoringFullService; + protected IAuthoringFullService authoringService; @Autowired - @Qualifier("toolDAO") protected IToolDAO toolDAO; protected static final String CONTENT_TYPE_JSON = "application/json;charset=utf-8"; @@ -316,7 +307,7 @@ private String createTitle(String templateCode, String userEnteredString, Integer workspaceFolderID) { String title = WebUtil.removeHTMLtags(userEnteredString); title = title.replaceAll("[@%<>/^/*/$]", ""); - title = authoringFullService.getUniqueNameForLearningDesign(title, workspaceFolderID); + title = authoringService.getUniqueNameForLearningDesign(title, workspaceFolderID); if (title.length() > 220) { title.substring(0, 220); } @@ -356,7 +347,7 @@ LearningDesign learningDesign = null; try { - learningDesign = authoringFullService.saveLearningDesignDetails(ldJSON); + learningDesign = authoringService.saveLearningDesignDetails(ldJSON); } catch (Exception e) { LdTemplateController.log.error("Unable to learning design with details " + ldJSON, e); throw new HttpException("Unable to learning design with details " + ldJSON); @@ -631,7 +622,7 @@ try { Tool tool = getTool(toolSignature); - Long toolContentID = authoringFullService.insertToolContentID(tool.getToolId()); + Long toolContentID = authoringService.insertToolContentID(tool.getToolId()); // Tools' services implement an interface for processing REST requests ToolRestManager toolRestService = (ToolRestManager) lamsCoreToolService.findToolService(tool); Index: lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceController.java =================================================================== diff -u -r48cee0960880d01325c05aeb93dfa28896f8a36a -r10407509921c1b1233270863d7549ce68cc38c5c --- lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceController.java (.../WorkspaceController.java) (revision 48cee0960880d01325c05aeb93dfa28896f8a36a) +++ lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceController.java (.../WorkspaceController.java) (revision 10407509921c1b1233270863d7549ce68cc38c5c) @@ -49,19 +49,13 @@ /** * @author Manpreet Minhas - * - * */ @Controller @RequestMapping("/workspace") public class WorkspaceController { protected Logger log = Logger.getLogger(WorkspaceController.class.getName()); - @Autowired - @Qualifier("workspaceManagementService") - private IWorkspaceManagementService workspaceManagementService; - public static final String RESOURCE_ID = "resourceID"; public static final String RESOURCE_TYPE = "resourceType"; public static final String ROLE_DELIMITER = ","; @@ -70,15 +64,16 @@ * ORG_FOLDER_ID) and the user's private folder. See the method for more details. */ public static final Integer BOOTSTRAP_FOLDER_ID = new Integer(-1); - /** * Special value for folderID on getFolderContents(). Triggers getting the organisation folders that are available * to a user. See the method for more details. */ public static final Integer ORG_FOLDER_ID = new Integer(-2); - public static final Integer ROOT_ORG_FOLDER_ID = new Integer(1); + @Autowired + private IWorkspaceManagementService workspaceManagementService; + private Integer getUserId() { // return new Integer(WebUtil.readIntParam(request,AttributeNames.PARAM_USER_ID)); HttpSession ss = SessionManager.getSession();