Developer forum

Forum » Integration » User provider in DW8.2

User provider in DW8.2

Per Søgaard
Reply

I welcome the user provider for easy import of users - very nice.

I have a few comments:

- Will existing users that are also in the import be deleted and imported or updated with new and updated fields?

- It would be nice to have an example import file with all the standard fields and example custom fields, columns named with the database field names for auto mapping (like shown in the ecom demo video)

- A video tutorial like the one for importing products


Replies

 
Kristian Knudsen
Reply

Hi Per

Have you read the description about the User Provider here: http://developer.dynamicweb-cms.com/documentation/for-developers/data-integration/providers/user-provider.aspx. I believe this answers most of your questions. Here you'll also find sample import files.

I believe a video tutorial is on its way as well. 

 
Per Søgaard
Reply

Hi Kristian

Yes I have read the description so the above are questions not answered in what can be found in what you have provided so far.

I have to make an import for a customer well before christmas so I hope for an answer soon.

BR Per

 
Kristian Knudsen
Reply
Ok, I'll make sure you get an answer to your question.
 
Dmitriy Benyuk
Reply

Hi Per,
"Will existing users that are also in the import be deleted and imported or updated with new and updated fields?"
The existing users will be updated with new/updated fields if the check-box "Remove Missing Users" is not enabled.
(This check-box is located under the User Provider settings)
If it is enabled, then the existing users which are not in the import will be deleted(except user "Angel" and user "Administrator").

The matching of the users whether it is existing or not is made by the option selected in the drop-down called "User key field".
By default is is "AccessUserUserName" - this filed is used for storing user log-in, so it is unique for each user.
 

BR, Dmitrij
 

 
Per Søgaard
Reply

Ho Dimitri

Thankyou for your answer.

What about the user Admin (default customer login) which should never be deleted.

I had some other questions - maybe not for you to answer:

- It would be nice to have an example import file with all the standard fields and example custom fields, columns named with the database field names for auto mapping (like shown in the ecom demo video)

- A video tutorial like the one for importing products

 
Dmitriy Benyuk
Reply

Hi Per,

Yes, the Admin is never deleted too.

I have attached simple xml file with some Users in it.

Also for the relation between User->Groups and User->UserAdresses you can see this sample xml file.
 

 
Per Søgaard
Reply

Thankyou.

Your examples are all xml files.

So having an Excel file or a csv file as source what should i do then?

 
Dmitriy Benyuk
Reply

Hi Per,

If you have a csv file/files as a source you need to make an activity(job) with: CSV Provider as a Source and User Provider as a Destination. At the mapping dialog (source columns to destination) you should map columns you want to import from your source csv files to destination columns.
Here you can download a sample csv files.

Also you can see a sample mapping for the tables on this page: http://developer.dynamicweb-cms.com/documentation/for-developers/data-integration/providers/user-provider.aspx

 

You can also do an export of your Users to csv file by creating the activity: Dynamicweb Provider as a Source and CSV Provider as a destination. At the tables selection choose "AccessUser" table to export, and the mapping dialog you can select which columns you want to export(all or only some of them). At the exported csv file you can see the columns and their data.

 

 
Per Søgaard
Reply

Thanks for the quick reply.

I have to do the import today so I am in a bit of a hurry.

Your guide lists three different imports.

If I have made the groups all ready in user management, can I then just import users (step 3) and write the groups in a AccessUserGroups  coloumn in my file,  or should I import names of users first and user details after that.

 
Per Søgaard
Reply

Cannot find the checkbox:

See post above:

The existing users will be updated with new/updated fields if the check-box "Remove Missing Users" is not enabled

This check-box is located under the User Provider settings

 

 
Dmitriy Benyuk
Reply

Hi Per,
Yes, you can just import users if you already have a groups. You need to write the Group names to the AccessUserGroups column of your source file. Here is a format of the source "Groups" column, if you have one user to be imported to several existing groups:
"Group A,Group B"

 
Dmitriy Benyuk
Reply

If you already have a job with User Provider as a Destination, you can find this check box when clicking Edit Destination Settings. See attached screen.
If you are creating the new job, you will see this check box right after selecting the User Provider at destination providers drop-down list.

user_provider_settings.png
 
Per Søgaard
Reply

Seems that all imported users will get a notification mail by default. 

Is this correct and can I avoid it?

 
Dmitriy Benyuk
Reply

No, the e-mails are only send when the checkbox "Generate passwords for users" is checked and if at the import there were the new users without a password. The e-mail is send with the login name and the generated password.

 
Per Søgaard
Reply

When running the import I get an error that the import failed: No active mappings

When choosing destination a have choosen Defined in mapping.

In the file a have written the following in the first row:

AccesUserUserName ...etc.

 

This is the site: sifdw8.net.dynamicweb.dk

 

 
Dmitriy Benyuk
Reply

I suppose you are running the job "Import brugere 3", but there is no mappings in this job, so you need to create them as it is shown on the attached screen.

It is better to use "manual" mapping then using automatical, in this case you are knowing what is importing and where.

user_provider_settings1.png
 
Per Søgaard
Reply

So i had partial success importing with UTF-8 but no Groups were attached (contains ø) and danish characters æøå are not shown in names of imported users.

Changing encoding on saved job gives error:

Source directory does not exist

Importing again gives this error:

Job Failed with the following message: failed to move data from temporary table [dbo.AccessUserTempTableForBulkImport] to main table [dbo.AccessUser]. Reason: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

 
Dmitriy Benyuk
Reply

I have investigated your imput csv file: brugere_import.csv
It looks like corrupted. Could you re-export it using Unicode encoding?(Take the original source machine, where the user names looks correctly and export it to Unicode file)


One more question: Are you making import-export on the machines with DK locale?

 
Per Søgaard
Reply

It looks ok here. It was made from excel on a Mac.

Also the first import was ok. But the next one gave an error.

I will make a new one and upload it.

 
Per Søgaard
Reply
New file uploadet. Opens ok with edit.
 
Dmitriy Benyuk
Reply

Are you making this source csv file by using DW CMS for export or you have some another source?

 
Per Søgaard
Reply

Ran Import users 3 and got this error:

Job Failed with the following message: failed to move data from temporary table [dbo.AccessUserTempTableForBulkImport] to main table [dbo.AccessUser]. Reason: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

 

 
Dmitriy Benyuk
Reply

The file you have just uploaded for import is not Unicode encoded.

 

Are you making this source csv file by using DW CMS for export or you have some another source?

 
Per Søgaard
Reply
I open xls file in Excel om Mac and does Save as with format Windows-seminkolonsepareted.csv
 
Dmitriy Benyuk
Reply

Could you send your original excel file?
Thx)

 
Per Søgaard
Reply
Please send me your e-mail to mail@soegaard-co.dk
 
Per Søgaard
Reply
Did you get my mail?
 
Morten Bengtson
Reply

"Excel for Mac does not currently support UTF-8"
- http://answers.microsoft.com/en-us/mac/forum/macoffice2011-macexcel/mac-excel-converts-utf-8-characters-to-underlines/7c4cdaa7-bfa3-41a2-8482-554ae235227b

 

You can either import the Excel file to Google Docs and then export it to CSV in UTF-8 from there or you can use Apple Numbers which does support UTF-8.

 

/Morten

 

 
Dmitriy Benyuk
Reply

I have tried to export the data from your original excel file to CSV file, but there is no Unicode encoding(or any other Encoding selection ability) at saving the CSV file.
Seems the problem is like here:
http://www.excelforum.com/excel-general/400043-csv-and-unicode-or-utf-8-problem.html

http://stackoverflow.com/questions/4221176/excel-to-csv-with-utf8-encoding

 
Per Søgaard
Reply

I have mailed you the file again directly from the customer mail...

What about the other errors - are they related to the encoding?

 
Per Søgaard
Reply
Shouldnt importing with Encoding for source: Windows 1252 be ok?
 
Dmitriy Benyuk
Reply

The problem is with csv file that is received from Excel file, it is not in UTF 8 encoding.

 

I suggest you to follow Morten Bengston approach for making the UTF 8 csv file:
"You can either import the Excel file to Google Docs and then export it to CSV in UTF-8 from there or you can use Apple Numbers which does support UTF-8."

 

Then try to import it with UTF 8 encoding selected in source csv provider settings.

 
Per Søgaard
Reply

But how is it that I could import it the first time?

There were no errors then..

 
Per Søgaard
Reply

I have now made a utf file from Numbers and made a new job.

I get the same error:

Job Failed with the following message: failed to move data from temporary table [dbo.AccessUserTempTableForBulkImport] to main table [dbo.AccessUser]. Reason: Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

 
Dmitriy Benyuk
Reply

You have duplicated users in your csv import file, that is caused the error. Users should be unique, it's impossible to have 2 users with the same login name.

 

You must be logged in to post in the forum