留言板

Import users

ahmad abuoun,修改在12 年前。

Import users

Junior Member 帖子: 31 加入日期: 11-6-16 最近的帖子
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,修改在12 年前。

RE: Import users

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
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,修改在12 年前。

RE: Import users

Junior Member 帖子: 31 加入日期: 11-6-16 最近的帖子
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,修改在12 年前。

RE: Import users

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
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,修改在11 年前。

RE: Import users

Junior Member 帖子: 65 加入日期: 12-5-14 最近的帖子
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,修改在11 年前。

RE: Import users

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
LIferay's user model changed so you'll have to modify the code to take on additional attributes that were added.
thumbnail
Elijah Mangason,修改在11 年前。

RE: Import users

Junior Member 帖子: 65 加入日期: 12-5-14 最近的帖子
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,修改在11 年前。

RE: Import users

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
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,修改在11 年前。

RE: Import users

Junior Member 帖子: 65 加入日期: 12-5-14 最近的帖子
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,修改在11 年前。

RE: Import users

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
Done. I just tested the export and not the import.
thumbnail
Elijah Mangason,修改在11 年前。

RE: Import users

Junior Member 帖子: 65 加入日期: 12-5-14 最近的帖子
Thanks much. I'd like to try it out. Where did you post the new code?
thumbnail
Hitoshi Ozawa,修改在11 年前。

RE: Import users

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
As an attachment to the wiki page I posted earlier.
thumbnail
Elijah Mangason,修改在11 年前。

RE: Import users

Junior Member 帖子: 65 加入日期: 12-5-14 最近的帖子
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,修改在11 年前。

RE: Import users

Liferay Legend 帖子: 7942 加入日期: 10-3-24 最近的帖子
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,修改在11 年前。

RE: Import users

Junior Member 帖子: 65 加入日期: 12-5-14 最近的帖子
Ok, all understood. Thanks much. Your tool is a very big help.
thumbnail
Elijah Mangason,修改在11 年前。

RE: Import users

Junior Member 帖子: 65 加入日期: 12-5-14 最近的帖子
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