Index: lams_admin/conf/language/ApplicationResources.properties
===================================================================
diff -u -r4d7c3f5641fd7081af1ed74a2d265242ad69551c -rf8ae5239ffcb6ac62937458e9750b3780528dc9f
--- lams_admin/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 4d7c3f5641fd7081af1ed74a2d265242ad69551c)
+++ lams_admin/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision f8ae5239ffcb6ac62937458e9750b3780528dc9f)
@@ -216,11 +216,12 @@
sysadmin.library.createtim =Create time
sysadmin.function =Function
admin.importv1.title = Import LAMS 1 Users
-msg.importv1.1 = Download
+msg.importv1.1 = Download the LAMS 1 export script.
msg.importv1.2 = On the command line of your LAMS 1 database server, run the following command
msg.importv1.3a = Submit
msg.importv1.3b = using the form below.
msg.importv1.4 = You will be presented with a list of organisations and session classes to import.
+msg.importv1.5 = Note that the passwords of the imported users will be reset, since LAMS 2 does not accept md5 passwords. They will be reset to the user's login.
label.importv1.integrated = Include integration users and organisations
label.continue = Continue
msg.importv1.found.users = Found {0} LAMS 1 users.
Index: lams_admin/conf/language/ApplicationResources_en_AU.properties
===================================================================
diff -u -r4d7c3f5641fd7081af1ed74a2d265242ad69551c -rf8ae5239ffcb6ac62937458e9750b3780528dc9f
--- lams_admin/conf/language/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 4d7c3f5641fd7081af1ed74a2d265242ad69551c)
+++ lams_admin/conf/language/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision f8ae5239ffcb6ac62937458e9750b3780528dc9f)
@@ -216,11 +216,12 @@
sysadmin.library.createtim =Create time
sysadmin.function =Function
admin.importv1.title = Import LAMS 1 Users
-msg.importv1.1 = Download
+msg.importv1.1 = Download the LAMS 1 export script.
msg.importv1.2 = On the command line of your LAMS 1 database server, run the following command
msg.importv1.3a = Submit
msg.importv1.3b = using the form below.
msg.importv1.4 = You will be presented with a list of organisations and session classes to import.
+msg.importv1.5 = Note that the passwords of the imported users will be reset, since LAMS 2 does not accept md5 passwords. They will be reset to the user's login.
label.importv1.integrated = Include integration users and organisations
label.continue = Continue
msg.importv1.found.users = Found {0} LAMS 1 users.
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/adminApplicationContext.xml
===================================================================
diff -u -r35da7c79459d1e4ecc8a599e72abef1f5f8a69bf -rf8ae5239ffcb6ac62937458e9750b3780528dc9f
--- lams_admin/src/java/org/lamsfoundation/lams/admin/adminApplicationContext.xml (.../adminApplicationContext.xml) (revision 35da7c79459d1e4ecc8a599e72abef1f5f8a69bf)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/adminApplicationContext.xml (.../adminApplicationContext.xml) (revision f8ae5239ffcb6ac62937458e9750b3780528dc9f)
@@ -8,7 +8,7 @@
-
+
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/service/AdminServiceProxy.java
===================================================================
diff -u -r35da7c79459d1e4ecc8a599e72abef1f5f8a69bf -rf8ae5239ffcb6ac62937458e9750b3780528dc9f
--- lams_admin/src/java/org/lamsfoundation/lams/admin/service/AdminServiceProxy.java (.../AdminServiceProxy.java) (revision 35da7c79459d1e4ecc8a599e72abef1f5f8a69bf)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/service/AdminServiceProxy.java (.../AdminServiceProxy.java) (revision f8ae5239ffcb6ac62937458e9750b3780528dc9f)
@@ -43,7 +43,7 @@
private static MessageService messageService;
private static IIntegrationService integrationService;
private static IAuditService auditService;
- private static ISpreadsheetService spreadsheetService;
+ private static IImportService importService;
public static final IUserManagementService getService(ServletContext servletContext){
if (manageService == null) {
@@ -79,11 +79,11 @@
return auditService;
}
- public static final ISpreadsheetService getSpreadsheetService(ServletContext servletContext){
- if(spreadsheetService==null){
+ public static final IImportService getImportService(ServletContext servletContext){
+ if(importService==null){
WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
- spreadsheetService = (ISpreadsheetService)ctx.getBean("spreadsheetService");
+ importService = (IImportService)ctx.getBean("importService");
}
- return spreadsheetService;
+ return importService;
}
}
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/service/IImportService.java
===================================================================
diff -u
--- lams_admin/src/java/org/lamsfoundation/lams/admin/service/IImportService.java (revision 0)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/service/IImportService.java (revision f8ae5239ffcb6ac62937458e9750b3780528dc9f)
@@ -0,0 +1,93 @@
+/****************************************************************
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+/* $$Id$$ */
+package org.lamsfoundation.lams.admin.service;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.struts.upload.FormFile;
+
+/**
+ *
+ *
+ * @author Fei Yang
+ * @author Jun-Dir Liew
+ */
+public interface IImportService {
+
+ public static final String SEPARATOR = "|";
+ public static final String IMPORT_HELP_PAGE = "Import+Users";
+ public static final String IMPORTV1_HELP_PAGE = "Import+LAMS+1+Users";
+
+ /**
+ * Returns true if spreadsheet contains user data.
+ * @param fileItem
+ * @return
+ * @throws IOException
+ */
+ public boolean isUserSpreadsheet(FormFile fileItem) throws IOException;
+
+ /**
+ * Returns true if spreadsheet contains userorgrole data.
+ * @param fileItem
+ * @return
+ * @throws IOException
+ */
+ public boolean isRolesSpreadsheet(FormFile fileItem) throws IOException;
+
+ /**
+ * Checks first row of spreadsheet and determines whether to parse as
+ * a user or orgrole spreadsheet.
+ * @param fileItem
+ * @throws IOException
+ */
+ public List parseSpreadsheet(FormFile fileItem) throws IOException;
+
+ /**
+ * Returns list of V1 users and orgs after parsing the output of a mysql dump.
+ * @param fileItem
+ * @return
+ * @throws IOException
+ */
+ public List parseV1UsersFile(FormFile fileItem, boolean includeIntegrated) throws IOException;
+
+ /**
+ * Returns message results from parsing list of users in spreadsheet.
+ * @param file
+ * @return
+ * @throws IOException
+ */
+ public List parseUserSpreadsheet(FormFile file) throws IOException;
+
+ /**
+ * Returns message results from parsing list of organisation memberships
+ * in spreadsheet.
+ * @param file
+ * @return
+ * @throws IOException
+ */
+ public List parseRolesSpreadsheet(FormFile file) throws IOException;
+}
Fisheye: Tag f8ae5239ffcb6ac62937458e9750b3780528dc9f refers to a dead (removed) revision in file `lams_admin/src/java/org/lamsfoundation/lams/admin/service/ISpreadsheetService.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_admin/src/java/org/lamsfoundation/lams/admin/service/ImportService.java
===================================================================
diff -u
--- lams_admin/src/java/org/lamsfoundation/lams/admin/service/ImportService.java (revision 0)
+++ lams_admin/src/java/org/lamsfoundation/lams/admin/service/ImportService.java (revision f8ae5239ffcb6ac62937458e9750b3780528dc9f)
@@ -0,0 +1,699 @@
+/****************************************************************
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.admin.service;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+import org.apache.struts.upload.FormFile;
+import org.lamsfoundation.lams.admin.AdminConstants;
+import org.lamsfoundation.lams.admin.web.dto.V1OrgRightDTO;
+import org.lamsfoundation.lams.admin.web.dto.V1OrganisationDTO;
+import org.lamsfoundation.lams.admin.web.dto.V1UserDTO;
+import org.lamsfoundation.lams.themes.CSSThemeVisualElement;
+import org.lamsfoundation.lams.usermanagement.AuthenticationMethod;
+import org.lamsfoundation.lams.usermanagement.Organisation;
+import org.lamsfoundation.lams.usermanagement.OrganisationType;
+import org.lamsfoundation.lams.usermanagement.Role;
+import org.lamsfoundation.lams.usermanagement.SupportedLocale;
+import org.lamsfoundation.lams.usermanagement.User;
+import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
+import org.lamsfoundation.lams.util.Configuration;
+import org.lamsfoundation.lams.util.ConfigurationKeys;
+import org.lamsfoundation.lams.util.HashUtil;
+import org.lamsfoundation.lams.util.MessageService;
+import org.lamsfoundation.lams.util.audit.IAuditService;
+
+/**
+ *