AnsweredAssumed Answered

Extending the bootstrap process - follow on from post: 1516

Question asked by lnagra on Nov 16, 2006
Latest reply on Nov 16, 2006 by lnagra
Follow on from: http://forums.alfresco.com/viewtopic.php?t=1516

Hi,

I would be interested to know if either felipe or thaneshk got this to work successfully.

I am trying to create spaces and categories at bootstrap in Alfresco ECMS 1.4. We had this working successfully by modifying /alfresco/bootstrap/categories.xml and /alfresco/bootstrap/spaces.xml in Alfresco 1.2.

However, this approach doesn't work very well for upgrading at a later date and it would be nice to try keeping our code seperate from Alfresco's.

I have created a JAR that contains:

alfresco.extension.custom-bootstrap-context.xml
alfresco.extension.bootstrap.custom-categories.xml
alfresco.extension.bootstrap.custom-spaces.xml
alfresco.extension.messages.custom-bootstrap-spaces

The idea is to have the -context.xml read automatically and refer to the custom-categories.xml and custom-spaces.xml

e.g.

alfresco.extension.custom-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="spacesBootstrap" parent="spacesStoreImporter">
               <property name="bootstrapViews">
                   <list>
                       <props>
                           <prop key="path">/</prop>
                           <prop key="location">alfresco/extension/bootstrap/custom-spaces.xml</prop>
                           <prop key="messages">alfresco/extension/messages/custom-bootstrap-spaces</prop>
                       </props>
                       <props>
                           <prop key="path">/</prop>
                           <prop key="location">alfresco/extension/bootstrap/custom-categories.xml</prop>
                       </props>
                   </list>
               </property>
   </bean>
  
</beans>

e.g.

alfresco.extension.bootstrap.custom-spaces.xml




<view:view xmlns:view="http://www.alfresco.org/view/repository/1.0"
           xmlns:cm="http://www.alfresco.org/model/content/1.0"
           xmlns:app="http://www.alfresco.org/model/application/1.0">

    <!– NOTE: all replaced properties referenced from repository.properties file must also be
              mapped in the bootstrap-context.xml spacesBootstrap/configuration section –>
   <cm:folder view:childName="${spaces.company_home.childname}">
        <view:acl view:inherit="false">
            <view:ace view:access="ALLOWED">
                <view:authority>GROUP_EVERYONE</view:authority>
                <view:permission>Consumer</view:permission>
            </view:ace>
        </view:acl>
      <app:uifacets />
      <cm:name>${spaces.company_home.name}</cm:name>
      <app:icon>space-icon-default</app:icon>
      <cm:title>${spaces.company_home.name}</cm:title>
      <cm:description>${spaces.company_home.description}</cm:description>
      <cm:contains>
           <cm:folder view:childName="${spaces.published.name}">
                <view:acl view:inherit="false">
                    <view:ace view:access="ALLOWED">
                        <view:authority>guest</view:authority>
                        <view:permission>Consumer</view:permission>
                    </view:ace>
                    <view:ace view:access="ALLOWED">
                        <view:authority>GROUP_EVERYONE</view:authority>
                        <view:permission>Consumer</view:permission>
                    </view:ace>
                </view:acl>
                <app:uifacets />
            <cm:name>${spaces.published.name}</cm:name>
            <app:icon>space-icon-default</app:icon>
            <cm:title>${spaces.published.name}</cm:title>
            <cm:description>${spaces.published.description}</cm:description>
            </cm:folder>
      </cm:contains>
   </cm:folder>

</view:view>

I've dropped the packaged JAR into a clean Alfresco exploded tomcat install in WEB-INF/lib

They don't appear to show. Is this because the bootstrap has already happened?

Is this approach the recommended method for seperating bootstrap configuration from Alfresco code?

Is there a way to force the bootstrap to occur?

Many thanks,

Lakhdip

Outcomes