Fórumok

Import users

ahmad abuoun, módosítva 12 év-val korábban

Import users

Junior Member Bejegyzések: 31 Csatlakozás dátuma: 2011.06.16. Legújabb bejegyzések
Hi

when I run usersImport to import users to portal it generate an error said:Insert error. Skipping row 1
Insert error. Skipping row 2
thumbnail
Hitoshi Ozawa, módosítva 12 év-val korábban

RE: Import users

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
Can you give us a concrete steps you're doing?
Which version of Liferay you're using and where and how you're trying to import users and if you're trying to import what's you've exported or trying to import something else.
ahmad abuoun, módosítva 12 év-val korábban

RE: Import users

Junior Member Bejegyzések: 31 Csatlakozás dátuma: 2011.06.16. Legújabb bejegyzések
Hi

I used http://www.liferay.com/community/wiki/-/wiki/Main/Web+Service+samples , as you said in other Thread
I use 6.1 version

I modified ws-settings :
username=test@liferay.com
password=123
host=http://localhost
port=8080

and run usersImport batch file

I try to import users in sample to my portal (database of portal) as a test
thumbnail
Hitoshi Ozawa, módosítva 12 év-val korábban

RE: Import users

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
That's because the web service sample is just a sample written for Liferay 6.0.5.
To use it with Liferay 6.1.0, you'll have to recompile using Liferay SDK 6.1.0.
thumbnail
Elijah Mangason, módosítva 11 év-val korábban

RE: Import users

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2012.05.14. Legújabb bejegyzések
Help! It's not working on my 6.1 installation. Per the post, I followed this procedure:

1. Recompiled under 6.1 SDK using usersImportCompile.bat. This updated the SoapUtil, UserInfo, UsersImport, and WSSettings class files.

2. Created comma separated list, myNewUser.csv:
"companyId"," autoPassword","password","autoScreenName","screenName","emailAddress","facebookId","openId","locale","firstName","middleName","lastName","prefixId","suffixId"," male","birthdayMonth","birthdayDay","birthdayYear"," jobTitle"," groupIds","organizationIds","roleIds","userGroupIds"," sendEmail","serviceContext"
"10154","FALSE","password","FALSE","User1","user1@liferay.com","0","0","en_US","User1","","One","0","0","TRUE","1","11","1981","","","","","","FALSE",""
"10154","FALSE","password","FALSE","User2","user2@liferay.com","0","0","en_US","User2","","Two","0","0","FALSE","2","22","1982","","","","","","FALSE",""
"10154","FALSE","password","FALSE","User3","user3@liferay.com","0","0","en_US","User3","","Three","0","0","TRUE","3","31","1983","","","","","","FALSE",""
"10154","FALSE","password","FALSE","User4","user4@liferay.com","0","0","en_US","User4","","Four","0","0","FALSE","4","14","1984","","","","","","FALSE",""
"10154","FALSE","password","FALSE","User5","user5@liferay.com","0","0","en_US","User5","","Five","0","0","TRUE","5","15","1985","","","","","","FALSE",""
"10154","FALSE","password","FALSE","User6","user6@liferay.com","0","0","en_US","User6","","Six","0","0","FALSE","6","26","1986","","","","","","FALSE",""

3. Ran usersImport.bat pointed to myNewUser.csv with this output:
C:\Liferay\6.1.0\Tools\liferay-wstools_20110119>java jp.co.ogis.liferay.util.UsersImport data\myNewU
ser.csv
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
INFO: Opening file 'data\myNewUser.csv'
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
INFO: File 'data\myNewUser.csv' opened.
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: Data format error in row: 1
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: java.lang.NumberFormatException: For input string: "companyId"
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: (301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: Insert error. Skipping row 1.
(301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: (301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: Insert error. Skipping row 2.
(301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: (301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: Insert error. Skipping row 3.
(301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: (301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: Insert error. Skipping row 4.
(301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: (301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: Insert error. Skipping row 5.
(301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: (301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: Insert error. Skipping row 6.
(301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: (301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
SEVERE: Insert error. Skipping row 7.
(301)Moved Permanently
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
INFO: Closing file 'data\myNewUser.csv'.
May 22, 2012 2:38:21 PM jp.co.ogis.liferay.util.UsersImport <init>
INFO: Finished importing user data.

Any help and/or suggestions are appreciated.
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: Import users

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
LIferay's user model changed so you'll have to modify the code to take on additional attributes that were added.
thumbnail
Elijah Mangason, módosítva 11 év-val korábban

RE: Import users

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2012.05.14. Legújabb bejegyzések
Would the fix involve changing the code in usersImport.java, specifically, this line:

UserSoap usoap= soap.addUser(userInfo.getCompanyId(), userInfo.getAutoPassword(),userInfo.getPassword(),userInfo.getPassword(),userInfo.getAutoScreenName(),userInfo.getScreenName(),userInfo.getEmailAddress(),userInfo.getFacebookId(),userInfo.getOpenId(),userInfo.getLocale(),userInfo.getFirstName(),userInfo.getMiddleName(),userInfo.getLastName(),userInfo.getPrefixId(),userInfo.getSuffixId(),userInfo.getMale(),userInfo.getBirthdayMonth(),userInfo.getBirthdayDay(),userInfo.getBirthdayYear(),userInfo.getJobTitle(),userInfo.getGroupIds(),userInfo.getOrganizationIds(),userInfo.getRoleIds(),userInfo.getUserGroupIds(),userInfo.getSendEmail(),serviceContext);

... or is this post also relevant regarding Consuming Liferay Web Services:
http://www.liferay.com/web/antonio.junior/blog/-/blogs/12168124

Thanks for your help!
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: Import users

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
301 error implies authentication error. I've modified the part of the codes for liferay 6.1.0 and will upload it by the end of this week.
thumbnail
Elijah Mangason, módosítva 11 év-val korábban

RE: Import users

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2012.05.14. Legújabb bejegyzések
Thank you very much. I can't tell you enough how much that will help. I'll look for your update in a couple days. Thanks again!!
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: Import users

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
Done. I just tested the export and not the import.
thumbnail
Elijah Mangason, módosítva 11 év-val korábban

RE: Import users

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2012.05.14. Legújabb bejegyzések
Thanks much. I'd like to try it out. Where did you post the new code?
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: Import users

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
As an attachment to the wiki page I posted earlier.
thumbnail
Elijah Mangason, módosítva 11 év-val korábban

RE: Import users

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2012.05.14. Legújabb bejegyzések
Hello, Ozawa-san,
I'm using your import/export service and it's adding users to the database. THANKS!! Just wondering - why did you give imported users a status of 2 (ACTION_SAVE_DRAFT) instead of 6 (STATUS_INCOMPLETE). Also, I tried the first time login experience with a clean installation of Liferay 6.1 for some of the imported users, and authentication fails even when using the imported password. I know I'm doing something wrong here... any thoughts or ideas you care to pass along would be appreciated.
E.
thumbnail
Hitoshi Ozawa, módosítva 11 év-val korábban

RE: Import users

Liferay Legend Bejegyzések: 7942 Csatlakozás dátuma: 2010.03.24. Legújabb bejegyzések
We're not actually using the tool as is. I've made the code easier to comprehend by not using StringBuffer and Spring. It's really a code sample on how to program web service which uses liferay. Feel free to modify it as needed.
thumbnail
Elijah Mangason, módosítva 11 év-val korábban

RE: Import users

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2012.05.14. Legújabb bejegyzések
Ok, all understood. Thanks much. Your tool is a very big help.
thumbnail
Elijah Mangason, módosítva 11 év-val korábban

RE: Import users

Junior Member Bejegyzések: 65 Csatlakozás dátuma: 2012.05.14. Legújabb bejegyzések
Ozawa-san,
I've got your import procedure running and it's working great from the command prompt (THANKS AGAIN!). I now need to incorporate it into an "upload portlet" which will run from within the portal. In this case, SOAP will not be necessary, right? Sorry if this question is obvious; I'm new to LIferay and web development. Thanks for any advice you have to share.
-Elijah