Developer forum

Forum » Development » Importing users.

Importing users.


Reply
We need to import users through an XML-file.

Our XML file is currently like this (with 1 test user):

<?xml version="1.0" encoding="utf-8" ?>
<Users> 
  <User>
    <AccessUserID></AccessUserID>
    <AccessUserParentID>0</AccessUserParentID>
    <AccessUserUserName>dt</AccessUserUserName>
    <AccessUserPassword>dt</AccessUserPassword>
    <AccessUserType>0</AccessUserType>
    <AccessUserValidFrom>2010-06-23T14:53:49</AccessUserValidFrom>
    <AccessUserValidTo>2999-12-31T00:00:00</AccessUserValidTo>
    <AccessUserRead>0</AccessUserRead>
    <AccessUserActive>1</AccessUserActive>
    <AccessUserLevel>0</AccessUserLevel>
    <AccessUserInheritAddress>1</AccessUserInheritAddress>
    <AccessUserSort>0</AccessUserSort>
    <AccessUserStatus>0</AccessUserStatus>
    <AccessUserHideStat>0</AccessUserHideStat>
    <AccessUserAllowBackend>0</AccessUserAllowBackend>
  </User>
</Users>

We are trying to import it through the extended import/export module, using the "Local Source File --> User destination"-pipeline. It isn't working. We need help.

Can anyone describe how it should be done? A working XML-file would be appreciated.




Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
Hi,

First off, I'll assume you're importing users to the new Users and Intranet/Extranet modules (the ones shipped with DW7).
Second, did you have a look at the XSD schema available in the "User destination" activity?
Thirdly, you need to use the "XML file source" instead of the "Local file source" and set Root to "Users" and XPath to "/Users/User" in your example.

I've included a revised example of you XML. I've removed the nodes that didn't match the schema and added some that were required by the schema.


<?xml version="1.0" encoding="utf-8" ?>
<Users> 
  <User>
    <AccessUserID></AccessUserID>
    <AccessUserParentID>0</AccessUserParentID>
    <AccessUserUserName>dt</AccessUserUserName>
    <AccessUserPassword>dt</AccessUserPassword>
    <AccessUserName>dt</AccessUserName>
    <AccessUserEmail>dt@dt.dk</AccessUserEmail>
    <AccessUserType>5</AccessUserType>
    <AccessUserValidFrom>2010-06-23T14:53:49</AccessUserValidFrom>
    <AccessUserValidTo>2999-12-31T00:00:00</AccessUserValidTo>
    <AccessUserModules></AccessUserModules>
    <AccessUserInformation></AccessUserInformation>
    <AccessUserCustomerNumber></AccessUserCustomerNumber>
    <AccessUserRead>0</AccessUserRead>
    <AccessUserPasswordDate></AccessUserPasswordDate>
    <AccessUserActive>1</AccessUserActive>
    <AccessUserLevel>0</AccessUserLevel>
    <AccessUserInheritAddress>1</AccessUserInheritAddress>
    <AccessUserSort>0</AccessUserSort>
    <AccessUserStatus>0</AccessUserStatus>
    <AccessUserHideStat>0</AccessUserHideStat>s
  </User>
</Users>

Please note the "AccessUserType" node. In order for the user to appear in the User Management, this needs to be set to "5".

- Jeppe
 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
Oops. Disregard the floating "s" character after the "AccessUserHideStat" node :-)
 
Reply
Excellent! Thank you for the "walk-through".

It is working perfectly.

Oh happy day.

 

You must be logged in to post in the forum