AnsweredAssumed Answered

Import groups on alfresco bootstrap !!

Question asked by g_rathod on Feb 21, 2011
Latest reply on Mar 18, 2011 by pcollardez
Hello Friends,

I want to import certain groups on bootstrap.
I am using alfresco 3.2.2.1 enterprise.

xxx-bootstrap-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="XXXGroupImportModule" class="org.alfresco.repo.module.ImporterModuleComponent" parent="module.baseComponent">
       <property name="moduleId" value="com.XXX.alfresco.xxx.repository.module" />
       <property name="name" value="XXXGroupImport" />
       <property name="description" value="xxxGroupImport" />
       <property name="sinceVersion" value="1.0" />
       <property name="appliesFromVersion" value="1.0" />
       <property name="importer" ref="userBootstrap"/>
       <property name="bootstrapViews">
           <list>
      <props>
                    <prop key="path">/${system.system_container.childname}</prop>
                    <prop key="location">bootstrap/XXX_groups.xml</prop>
                </props>
          </list>
       </property>
   </bean>   
</beans>


2. my group file XXX_groups.xml
============================
<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">

    <sys:container view:childName="${system.authorities_container.childname}">
        <view:acl>
            <view:ace view:access="ALLOWED">
                <view:authority>GROUP_EVERYONE</view:authority>
                <view:permission>Read</view:permission>
            </view:ace>
        </view:acl>
        <view:associations>
            <sys:children>
                <cm:authorityContainer view:childName="cm:GROUP_Head_of_Neuro_Medical_Affairs">
                    <view:aspects>
                        <sys:referenceable />
                    </view:aspects>
                    <view:properties>
                        <sys:node-uuid>GROUP_Head_of_Neuro_Medical_Affairs</sys:node-uuid>
                        <cm:name>GROUP_Head_of_Neuro_Medical_Affairs</cm:name>
                        <cm:authorityName>GROUP_Head_of_Neuro_Medical_Affairs</cm:authorityName>
                    </view:properties>
                </cm:authorityContainer>
               
            </sys:children>
        </view:associations>
    </sys:container>

    <sys:container view:childName="${system.zones_container.childname}">
        <view:acl>
            <view:ace view:access="ALLOWED">
                <view:authority>GROUP_EVERYONE</view:authority>
                <view:permission>Read</view:permission>
            </view:ace>
        </view:acl>
       <view:associations>
            <sys:children>
                <cm:zone view:childName="cm:AUTH.ALF">
                    <view:aspects>
                        <sys:referenceable />
                    </view:aspects>
                    <view:properties>
                        <sys:node-uuid>AUTH.ALF</sys:node-uuid>
                        <cm:name>AUTH.ALF</cm:name>
                    </view:properties>
                    <view:associations>
                  <cm:inZone>
                            <view:reference
                                view:pathref="${system.authorities_container.childname}/cm:GROUP_Head_of_Neuro_Medical_Affairs"
                                view:childName="cm:GROUP_Head_of_Neuro_Medical_Affairs" />
                        </cm:inZone>
                    </view:associations>
                </cm:zone>
                <cm:zone view:childName="cm:APP.DEFAULT">
                    <view:aspects>
                        <sys:referenceable />
                    </view:aspects>
                    <view:properties>
                        <sys:node-uuid>APP.DEFAULT</sys:node-uuid>
                        <cm:name>APP.DEFAULT</cm:name>
                    </view:properties>
                    <view:associations>
                  <cm:inZone>
                            <view:reference
                                view:pathref="${system.authorities_container.childname}/cm:GROUP_Head_of_Neuro_Medical_Affairs"
                                view:childName="cm:GROUP_Head_of_Neuro_Medical_Affairs" />
                        </cm:inZone>
                    </view:associations>
                </cm:zone>
            </sys:children>
        </view:associations>
    </sys:container>
          
</view:view>



Group file path : \WEB-INF\classes\bootstrap\XXX_groups.xml
bootstrap file path : \WEB-INF\classes\alfresco\extension


I am not able to create group while using above code.
it will give me error
caused by: org.alfresco.service.cmr.view.ImporterException: Failed to import package at line 15; column 27 due to error: Local name cannot be null or empty.


Please help me to correct this error.

Outcomes