OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Easy way to upload 100 users?

Are you a Director, Presenter, Reviewer or Conference Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael

Forum rules
This forum is meant for general questions about the usability of OCS from an everyday user's perspective: conference managers, presenters, and directors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OCS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OCS:

1. Read the documentation. We've written documentation to cover from OCS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OCS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OCS Technical Support subforum; if you have a development question, try the OCS Development subforum.

Easy way to upload 100 users?

Postby tlove » Wed Apr 22, 2009 8:19 am

Hello,

I'm trying to find a way to easily upload 100 users.

Currently, I have their details in the form of firstname, lastname, email address (which I'll also use as username) and a randomly generated password in a csv file.

Is there an easy way to convert this data into a users.xml file for upload. Wondering how others do it?

I haven't managed to find anything in the forums on user upload by xml. Do people do it a different way?- perhaps by SQL into the database?

Best regards and thanks in advance,

Terry
tlove
 
Posts: 30
Joined: Mon Oct 01, 2007 8:47 am
Location: Australia

Re: Easy way to upload 100 users?

Postby kstranac » Wed Apr 22, 2009 5:25 pm

Hi Terry,

I've had good luck using this utility:
http://www.creativyst.com/cgi-bin/Prod/15/eg/csv2xml.pl

Kevin
kstranac
Site Admin
 
Posts: 73
Joined: Wed Sep 21, 2005 3:31 pm

Re: Easy way to upload 100 users?

Postby tlove » Thu Apr 23, 2009 12:10 am

Hi Kevin,

Many thanks. Useful! It removes most of the work.

Can I simply leave blank element rows out of the xml file? I realise this is probably XML 101 but its not something I've done before and I'm guessing it depends on the import php more than the XML spec. I just read Harold Baur's comeonts on this (http://knowledge.ciber.nl/weblog/?p=168) and it left me even more confused.

I welcome your advice.

I'm having problems with the lines (from the sample.xml file):

<biography locale="de_DE">My biography (German) - TestUser1.</biography>
<biography locale="en_US">My biography (English) - TestUser1.</biography>
<biography locale="es_ES">My biography (Spanish) - TestUser1.</biography>

Somehow the converter parses the = in the biographies row title and then this confuses the xml file as in

<biography>biography locale=&quot;de_DE&quot;</biography >
<locale=>biography locale=&quot;en_US&quot;</locale= >
<de_DE>biography locale=&quot;es_ES&quot;</de_DE >

Best wishes and thanks again,

Terry
tlove
 
Posts: 30
Joined: Mon Oct 01, 2007 8:47 am
Location: Australia

Re: Easy way to upload 100 users?

Postby kstranac » Thu Apr 23, 2009 7:54 am

Hi Terry,

It is a somewhat blunt instrument for accomplishing this, and no doubt others have found a better way.

Here is what I enter into the CSV box:

username,salutation,first_name,middle_name,last_name,initials,gender,affiliation,email,url,phone,fax,mailing_address,country,interests,"biography locale="en_US"","biography locale="es_ES"",role
smith,Dr., Robert,C.,Smith,RDS,M,University of Nowhere,smith@mailinator.com,,413-443-2136,,"25 Main St. Pittsfield, MA. 01201",USA,health sciences,This is a biographical statement that goes on and on.,This is a spanish biographical statement that goes on and on.,"<role type=""reviewer""/>"

And it results in this:

<users>
<user>
<username>smith</username >
<salutation>Dr.</salutation >
<first_name>Robert</first_name >
<middle_name>C.</middle_name >
<last_name>Smith</last_name >
<initials>RDS</initials >
<gender>M</gender >
<affiliation>University of Nowhere</affiliation >
<email>smith@mailinator.com</email >
<url></url >
<phone>413-443-2136</phone >
<fax></fax >
<mailing_address>25 Main St. Pittsfield, MA. 01201</mailing_address >
<country>USA</country >
<interests>health sciences</interests >
<biography_locale=en_US>This is a biographical statement that goes on and on.</biography_locale=en_US >
<biography_locale=es_ES>This is a spanish biographical statement that goes on and on.</biography_locale=es_ES >
<role>&lt;role type=&quot;reviewer&quot;/&gt;</role >
</user>
</users>

You then need to do a little cleanup in a text editor. For example, do a "Find and Replace" to change these:

<biography_locale=en_US>
</biography_locale=en_US >
<role>&lt;role type=&quot;reviewer&quot;/&gt;</role >

To these:

<biography locale="en_US">
</biography>
<role type="reviewer"/>

That should give you an xml file suitable for importing.

Kevin
kstranac
Site Admin
 
Posts: 73
Joined: Wed Sep 21, 2005 3:31 pm

Re: Easy way to upload 100 users?

Postby tlove » Thu Apr 23, 2009 8:16 am

Hi Kevin,
Many thanks.
That makes good sense. I can see that I can do them that way ok. The idea of using find and replace to dodge the problem is neat. Thanks!
Best wishes,
Terry
tlove
 
Posts: 30
Joined: Mon Oct 01, 2007 8:47 am
Location: Australia

Re: Easy way to upload 100 users?

Postby yaliang » Thu Dec 23, 2010 9:57 am

Dear friends,

I was wondering if there is a quick way to update the user's role with the SQL scripts. This is because that when the editor create the accounts for the reviewers, the system will not apply the author's role. I would like to know how to apply the author's role to those reviewers. Could you give me some ideas and suggestions? Our OJS version is 2.1.1.0. Thank you very much.
yaliang
 
Posts: 82
Joined: Tue Jul 11, 2006 1:11 am

Re: Easy way to upload 100 users?

Postby mcrider » Mon Jan 03, 2011 1:36 pm

Hi yaliang,

Its possible, but I don't have an installation of OJS 2.1.1.0 around to look at the database and recommend some SQL to do that modification (I'm hesitant to give you SQL based on the DB structure of a more recent OJS installation because the tables have probably changed around a bit and I don't want to give you advice that might screw up your journal). For more current installs (and possibly your install), you would just add entries to the roles table with the journal_id of your journal, the user_id of the user you want to add a role for, and the role_id of '65536' (the value for the author role).

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC


Return to OCS Conference Support and Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron