Index: lams_admin/src/java/org/lamsfoundation/lams/admin/web/RegisterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_admin/src/java/org/lamsfoundation/lams/admin/web/RegisterAction.java,v diff -u -r1.9.4.1 -r1.9.4.2 --- lams_admin/src/java/org/lamsfoundation/lams/admin/web/RegisterAction.java 23 Apr 2009 06:41:18 -0000 1.9.4.1 +++ lams_admin/src/java/org/lamsfoundation/lams/admin/web/RegisterAction.java 11 May 2009 06:53:36 -0000 1.9.4.2 @@ -135,41 +135,6 @@ request.setAttribute("registerDTO", registerDTO); - /* - DynaActionForm registerForm = (DynaActionForm) form; - - // Set Server Configuration details in dyna form - registerForm.set("serverurl", Configuration.get(ConfigurationKeys.SERVER_URL)); - registerForm.set("serverversion", Configuration.get(ConfigurationKeys.VERSION)); - registerForm.set("serverbuild", Configuration.get(ConfigurationKeys.SERVER_VERSION_NUMBER)); - registerForm.set("serverlocale", Configuration.get(ConfigurationKeys.SERVER_LANGUAGE)); - registerForm.set("langdate", Configuration.get(ConfigurationKeys.DICTIONARY_DATE_CREATED)); - - // Set user details for registration - UserDTO sysadmin = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); - - registerForm.set("rname", sysadmin.getFirstName() + " " + sysadmin.getLastName()); - registerForm.set("remail", sysadmin.getEmail()); - - // Get Server statistics for registration - List groups = service.findByProperty(Organisation.class, "organisationType.organisationTypeId", - OrganisationType.COURSE_TYPE); - List subgroups = service.findByProperty(Organisation.class, "organisationType.organisationTypeId", - OrganisationType.CLASS_TYPE); - - //Set statistics in dyna form - registerForm.set("groupno", Integer.valueOf(groups.size())); - registerForm.set("subgroupno", Integer.valueOf(subgroups.size())); - registerForm.set("sysadminno", service.getCountRoleForSystem(Role.ROLE_SYSADMIN)); - registerForm.set("adminno", service.getCountRoleForSystem(Role.ROLE_GROUP_ADMIN)); - registerForm.set("authorno", service.getCountRoleForSystem(Role.ROLE_AUTHOR)); - registerForm.set("monitorno", service.getCountRoleForSystem(Role.ROLE_MONITOR)); - registerForm.set("managerno", service.getCountRoleForSystem(Role.ROLE_GROUP_MANAGER)); - registerForm.set("learnerno", service.getCountRoleForSystem(Role.ROLE_LEARNER)); - registerForm.set("authoradminno", service.getCountRoleForSystem(Role.ROLE_AUTHOR_ADMIN)); - registerForm.set("userno", Integer.valueOf(service.findAll(User.class).size())); - */ - return mapping.findForward("register"); } @@ -196,30 +161,6 @@ registerForm.setPublicDirectory(reg.isPublicDirectory()); registerForm.setEnableLamsCommunityIntegration(reg.isEnableLamsCommunityIntegration()); - - // setting the config values -// registerForm.setServerUrl(Configuration.get(ConfigurationKeys.SERVER_URL)); -// registerForm.setServerVersion(Configuration.get(ConfigurationKeys.VERSION)); -// registerForm.setServerBuild(Configuration.get(ConfigurationKeys.SERVER_VERSION_NUMBER)); -// registerForm.setServerLocale(Configuration.get(ConfigurationKeys.SERVER_LANGUAGE)); -// registerForm.setServerLanguageDate(Configuration.get(ConfigurationKeys.DICTIONARY_DATE_CREATED)); - - // Get Server statistics for registration -// List groups = userManagementService.findByProperty(Organisation.class, "organisationType.organisationTypeId", -// OrganisationType.COURSE_TYPE); -// List subgroups = userManagementService.findByProperty(Organisation.class, -// "organisationType.organisationTypeId", OrganisationType.CLASS_TYPE); -// -// registerForm.setGroupNumber(Integer.valueOf(groups.size())); -// registerForm.setSubgroupNumber(Integer.valueOf(subgroups.size())); -// registerForm.setSysadminNumber(userManagementService.getCountRoleForSystem(Role.ROLE_SYSADMIN)); -// registerForm.setAdminNumber(userManagementService.getCountRoleForSystem(Role.ROLE_GROUP_ADMIN)); -// registerForm.setAuthorNumber(userManagementService.getCountRoleForSystem(Role.ROLE_AUTHOR)); -// registerForm.setMonitorNumber(userManagementService.getCountRoleForSystem(Role.ROLE_MONITOR)); -// registerForm.setManagerNumber(userManagementService.getCountRoleForSystem(Role.ROLE_GROUP_MANAGER)); -// registerForm.setLearnerNumber(userManagementService.getCountRoleForSystem(Role.ROLE_LEARNER)); -// registerForm.setAuthorAdminNumber(userManagementService.getCountRoleForSystem(Role.ROLE_AUTHOR_ADMIN)); -// registerForm.setUserNumber(Integer.valueOf(userManagementService.findAll(User.class).size())); } public void updateRegistration(RegisterForm registerForm, Registration reg) { @@ -245,10 +186,10 @@ if (reg == null) { reg = new Registration(); } - + updateRegistration(registerForm, reg); + if (reg.getServerKey() == null) { - updateRegistration(registerForm, reg); - + String url = LAMS_COMMUNITY_REGISTER_URL; HashMap params = new HashMap(); Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v diff -u -r1.71.2.10 -r1.71.2.11 --- lams_central/conf/language/lams/ApplicationResources.properties 9 May 2009 06:54:13 -0000 1.71.2.10 +++ lams_central/conf/language/lams/ApplicationResources.properties 11 May 2009 06:53:37 -0000 1.71.2.11 @@ -357,6 +357,8 @@ label.required =Required title.import.lamscommunity =Import from lamscommunity.org +label.lamscommunity.notRegistered.1 =Your server is not registered with the LAMS Community so you can not seamlessly import sequences directly into your LAMS server from the community. Ask your system administrator to enable this feature. +label.lamscommunity.notRegistered.2 =However, you can download and import the sequences from the LAMS Community manually. +label.lamscommunity.info =The LAMS Community is a global online community for all teachers, administrators and developers that use LAMS. Within the various sub-communities, you can access the latest news about LAMS, many different discussion forums, and a repository of shared LAMS sequences. - #======= End labels: Exported 262 labels for en AU ===== Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.67.2.10 -r1.67.2.11 --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties 9 May 2009 06:54:14 -0000 1.67.2.10 +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties 11 May 2009 06:53:37 -0000 1.67.2.11 @@ -357,6 +357,9 @@ label.required =Required title.import.lamscommunity =Import from lamscommunity.org +label.lamscommunity.notRegistered.1 =Your server is not registered with the LAMS Community so you can not seamlessly import sequences directly into your LAMS server from the community. Ask your system administrator to enable this feature. +label.lamscommunity.notRegistered.2 =However, you can download and import the sequences from the LAMS Community manually. +label.lamscommunity.info =The LAMS Community is a global online community for all teachers, administrators and developers that use LAMS. Within the various sub-communities, you can access the latest news about LAMS, many different discussion forums, and a repository of shared LAMS sequences. #======= End labels: Exported 262 labels for en AU ===== Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java,v diff -u -r1.11.4.5 -r1.11.4.6 --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java 11 May 2009 05:42:20 -0000 1.11.4.5 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/ImportToolContentAction.java 11 May 2009 06:53:37 -0000 1.11.4.6 @@ -47,10 +47,12 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.lamsfoundation.lams.config.Registration; import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.Configuration; import org.lamsfoundation.lams.util.FileUtil; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; @@ -67,7 +69,8 @@ * @struts.action path = "/authoring/importToolContent" validate = "false" * @struts.action-forward name="upload" path="/toolcontent/import.jsp" * @struts.action-forward name="success" path="/toolcontent/importresult.jsp" - * @struts.action-forward name="successLC" path="/toolcontent/importresultLC.jsp" + * @struts.action-forward name="successLC" + * path="/toolcontent/importresultLC.jsp" * @struts.action-forward name="importLC" path="/toolcontent/importLC.jsp" * * Import tool content servlet. It needs an uploaded learning design zip file. @@ -103,19 +106,26 @@ //display initial page for upload return mapping.findForward("upload"); } else if (StringUtils.equals(param, "importLC")) { - + // Checking the server is registered + Registration reg = Configuration.getRegistration(); + if (reg == null || reg.isEnableLamsCommunityIntegration() == false) { + request.setAttribute("registered", Boolean.FALSE); + } else { + request.setAttribute("registered", Boolean.TRUE); + } + // import from lams community, redirect to sso page if (customCSV != null) { request.setAttribute(AttributeNames.PARAM_CUSTOM_CSV, customCSV); } //display initial lamscommunity import return mapping.findForward("importLC"); } else if (StringUtils.equals(param, "importLCFinish")) { - + // uploading the file from lams commmunity, have to feed the // location from the request - String learningDesignLocation = WebUtil.readStrParam(request, PARAM_LEARNING_DESIGN_LOCATION); - + String learningDesignLocation = WebUtil.readStrParam(request, PARAM_LEARNING_DESIGN_LOCATION); + importLDFromURL(request, learningDesignLocation, customCSV); return mapping.findForward("successLC"); } else { @@ -231,7 +241,7 @@ //get back login user DTO UserDTO userDto = (UserDTO) ss.getAttribute(AttributeNames.USER); User user = (User) getUserService().findById(User.class, userDto.getUserID()); - + // append the lams community auth info learningDesignLocation = LamsCommunityUtil.appendAuthInfoToURL(learningDesignLocation, user); @@ -244,7 +254,6 @@ // get the ld input stream form the location InputStream is = WebUtil.getResponseInputStreamFromExternalServer(learningDesignLocation, new HashMap()); - // Get the output stream to write the file for export OutputStream out = new BufferedOutputStream(new FileOutputStream(uploadPath)); Index: lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginAction.java,v diff -u -r1.2.4.3 -r1.2.4.4 --- lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginAction.java 11 May 2009 05:36:38 -0000 1.2.4.3 +++ lams_central/src/java/org/lamsfoundation/lams/web/lamscommunity/LamsCommunityLoginAction.java 11 May 2009 06:53:38 -0000 1.2.4.4 @@ -96,12 +96,20 @@ HttpServletResponse response) throws Exception { User user = getUser(request); + + // Getting the destination of the lamscommunity call String dest = WebUtil.readStrParam(request, LamsCommunityUtil.PARAM_DEST, true); - if (dest == null) { dest = LC_METHOD_NEWS; } + // Checking the server is registered + Registration reg = Configuration.getRegistration(); + if (reg == null || reg.isEnableLamsCommunityIntegration() == false) { + request.setAttribute("registered", Boolean.FALSE); + } else { + request.setAttribute("registered", Boolean.TRUE); + } if (user.getLamsCommunityToken() == null || user.getLamsCommunityToken().equals("")) { // Authenticate the user manually Index: lams_central/web/lamscommunity/lamscommunityLogin.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/lamscommunity/lamscommunityLogin.jsp,v diff -u -r1.2.4.2 -r1.2.4.3 --- lams_central/web/lamscommunity/lamscommunityLogin.jsp 11 May 2009 05:36:38 -0000 1.2.4.2 +++ lams_central/web/lamscommunity/lamscommunityLogin.jsp 11 May 2009 06:53:38 -0000 1.2.4.3 @@ -56,18 +56,26 @@ - - -

- -

-
- -

- -

-
-
+ + +

+ +

+
+ +

+ +

+
+
+ +
+

+ +

+
+ + Index: lams_central/web/toolcontent/importLC.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/toolcontent/importLC.jsp,v diff -u -r1.1 -r1.1.4.1 --- lams_central/web/toolcontent/importLC.jsp 30 Jan 2009 05:11:02 -0000 1.1 +++ lams_central/web/toolcontent/importLC.jsp 11 May 2009 06:53:38 -0000 1.1.4.1 @@ -28,20 +28,27 @@
- - + + + + + + +

+ +

+ +

+ +

+ +
+