Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
ahmad abuoun
Import users
February 29, 2012 2:06 AM
Answer

ahmad abuoun

Rank: Junior Member

Posts: 31

Join Date: June 16, 2011

Recent Posts

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
Hitoshi Ozawa
RE: Import users
February 29, 2012 8:18 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

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
RE: Import users
March 1, 2012 12:08 AM
Answer

ahmad abuoun

Rank: Junior Member

Posts: 31

Join Date: June 16, 2011

Recent Posts

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
Hitoshi Ozawa
RE: Import users
March 1, 2012 2:17 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

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.
Elijah "Ellie" Mangason
RE: Import users
May 22, 2012 2:40 PM
Answer

Elijah "Ellie" Mangason

Rank: Junior Member

Posts: 67

Join Date: May 14, 2012

Recent Posts

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.
Hitoshi Ozawa
RE: Import users
May 22, 2012 3:01 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

LIferay's user model changed so you'll have to modify the code to take on additional attributes that were added.
Elijah "Ellie" Mangason
RE: Import users
May 22, 2012 3:40 PM
Answer

Elijah "Ellie" Mangason

Rank: Junior Member

Posts: 67

Join Date: May 14, 2012

Recent Posts

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!
Hitoshi Ozawa
RE: Import users
May 22, 2012 6:38 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

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.
Elijah "Ellie" Mangason
RE: Import users
May 23, 2012 8:26 AM
Answer

Elijah "Ellie" Mangason

Rank: Junior Member

Posts: 67

Join Date: May 14, 2012

Recent Posts

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!!
Hitoshi Ozawa
RE: Import users
May 23, 2012 2:52 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

Done. I just tested the export and not the import.
Elijah "Ellie" Mangason
RE: Import users
May 25, 2012 1:55 PM
Answer

Elijah "Ellie" Mangason

Rank: Junior Member

Posts: 67

Join Date: May 14, 2012

Recent Posts

Thanks much. I'd like to try it out. Where did you post the new code?
Hitoshi Ozawa
RE: Import users
May 26, 2012 4:59 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

As an attachment to the wiki page I posted earlier.
Elijah "Ellie" Mangason
RE: Import users
June 7, 2012 4:03 PM
Answer

Elijah "Ellie" Mangason

Rank: Junior Member

Posts: 67

Join Date: May 14, 2012

Recent Posts

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.
Hitoshi Ozawa
RE: Import users
June 7, 2012 4:40 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

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.
Elijah "Ellie" Mangason
RE: Import users
June 8, 2012 8:24 AM
Answer

Elijah "Ellie" Mangason

Rank: Junior Member

Posts: 67

Join Date: May 14, 2012

Recent Posts

Ok, all understood. Thanks much. Your tool is a very big help.
Elijah "Ellie" Mangason
RE: Import users
June 18, 2012 9:26 AM
Answer

Elijah "Ellie" Mangason

Rank: Junior Member

Posts: 67

Join Date: May 14, 2012

Recent Posts

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