cancel
Showing results for 
Search instead for 
Did you mean: 

Import users

cgonzalez
Champ on-the-rise
Champ on-the-rise
Hi!

I am trying to import a user to Alfresco by using bootstrap. Here are my files :

user.xml

<?xml version="1.0" encoding="UTF-8"?>
  <view:view xmlns:view="http://www.alfresco.org/view/repository/1.0"
          xmlns:cm="http://www.alfresco.org/model/content/1.0"
          xmlns:sys="http://www.alfresco.org/model/system/1.0"
          xmlns:usr="http://www.alfresco.org/model/user/1.0"
          xmlns:app="http://www.alfresco.org/model/application/1.0">    
       <usr:user view:childName="usr:user">
                      <view:aspects>
                        <sys:referenceable></sys:referenceable>
                      </view:aspects>
                      <view:properties>
                        <cm:name>USER_ADMINISTRATOR_2</cm:name>
                        <sys:store-identifier>alfrescoUserStore</sys:store-identifier>
                        <usr:enabled>true</usr:enabled>
                        <usr:username>administrator2</usr:username>
                        <usr:salt>
                          <view:value view:isNull="true"></view:value>
                        </usr:salt>
                        <usr:password>527c9c819b286efb8ec4ebb5b5ae71cf</usr:password>
                        <usr:accountExpires>false</usr:accountExpires>
                        <usr:credentialsExpire>false</usr:credentialsExpire>
                        <usr:accountLocked>false</usr:accountLocked>
                        <sys:store-protocol>user</sys:store-protocol>
                      </view:properties>
                      <view:associations></view:associations>
                    </usr:user>
  </view:view>
user-context.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="myModuleId.bootstrapUsers" class="org.alfresco.repo.module.ImporterModuleComponent"
                                        parent="module.baseComponent">
    <property name="moduleId" value="myModuleId" />
    <property name="name" value="myModuleId.bootstrapUsers" />
    <property name="description" value="Initial data requirements" />
    <property name="sinceVersion" value="0.0" />
    <property name="appliesFromVersion" value="0.0" />
    <property name="importer" ref="userBootstrap"/>
   <property name="bootstrapViews">
     <list>
      <props>
        <prop key="path">/${alfresco_user_store.system_container.childname}/sys:person</prop>
        <prop key="location">alfresco/module/com.ignos.scs.alfresco.extension/resources/users.xml</prop>
      </props>
     </list>
   </property>
  </bean>
 
>

</beans>

I don't get any error is just that the user is not importer.

Any Help?

Thank you.
3 REPLIES 3

zaizi
Champ in-the-making
Champ in-the-making
Unfortunately user information is stored in both the userStore (which your files will add users to) and also the SpacesStore, meaning your import won't work.

Checkout the LDAP user import code as this creates the required XML files to do user import.

cgonzalez
Champ on-the-rise
Champ on-the-rise
Where can i find this code??

ehasting
Champ in-the-making
Champ in-the-making
Any more help on this subject? i would like to create a scrip that imported users from ldap into the alfresco database, allowing me to use the build in alfresco auth, and then get CIFS to work.