AnsweredAssumed Answered

Extend spacesbootstrap

Question asked by thaneshk on Apr 6, 2006
Latest reply on Nov 16, 2006 by lnagra
Hi,

I wanted to be able to create a couple of default spaces during the initalization of my custom application. Therefore i did the following. I already have a custom model in place and working.

I created custom-context.xml and placed it in alfresco/extension and added the following lines



<bean id="spacesBootstrap" parent="spacesStoreImporter">
            <property name="bootstrapViews">
                <list>
                    <props>
                        <prop key="path">/</prop>
                        <prop key="location">alfresco/extension/bootstrap/spaces.xml</prop>
                        <prop key="messages">alfresco/extension/messages/bootstrap-spaces</prop>
                    </props>
                    <props>
                        <prop key="path">/</prop>
                        <prop key="location">alfresco/bootstrap/system.xml</prop>
                    </props>
                    <props>
                        <prop key="path">/</prop>
                        <prop key="location">alfresco/bootstrap/categories.xml</prop>
                    </props>
                    <props>
                        <prop key="path">/${spaces.company_home.childname}/${spaces.guest_home.childname}</prop>
                        <prop key="location">alfresco/bootstrap/tutorial.xml</prop>
                        <prop key="messages">alfresco/messages/bootstrap-tutorial</prop>
                    </props>
                    <props>
                        <prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.childname}</prop>
                        <prop key="location">alfresco/templates/software_engineering_project.xml</prop>
                        <prop key="messages">alfresco/messages/bootstrap-templates</prop>
                    </props>
                    <props>
                        <prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.templates.content.childname}</prop>
                        <prop key="location">alfresco/templates/content_template_examples.xml</prop>
                    </props>
                </list>
            </property>
    </bean>
   

I also added spaces.xml from alfresco/bootstrap to alfresco/extension/bootstrap and did the same for bootstrap-spaces.properties

The following is 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.dictionary.childname}">
            <app:uifacets />
            <cm:name>${spaces.dictionary.name}</cm:name>
            <app:icon>space-icon-default</app:icon>
            <cm:title>${spaces.dictionary.name}</cm:title>
            <cm:description>${spaces.dictionary.description}</cm:description>
            <cm:contains>
               <cm:folder view:childName="${spaces.templates.childname}">
                  <app:uifacets />
                  <cm:name>${spaces.templates.name}</cm:name>
                  <app:icon>space-icon-default</app:icon>
                  <cm:title>${spaces.templates.name}</cm:title>
                  <cm:description>${spaces.templates.description}</cm:description>
               </cm:folder>
               <cm:folder view:childName="${spaces.templates.content.childname}">
                  <app:uifacets />
                  <cm:name>${spaces.templates.content.name}</cm:name>
                  <app:icon>space-icon-default</app:icon>
                  <cm:title>${spaces.templates.content.name}</cm:title>
                  <cm:description>${spaces.templates.content.description}</cm:description>
               </cm:folder>
               <cm:folder view:childName="${spaces.savedsearches.childname}">
                        <view:acl view:inherit="false">
                            <view:ace view:access="ALLOWED">
                                <view:authority>GROUP_EVERYONE</view:authority>
                                <view:permission>Contributor</view:permission>
                            </view:ace>
                        </view:acl>
                  <app:uifacets />
                  <cm:name>${spaces.savedsearches.name}</cm:name>
                  <app:icon>space-icon-default</app:icon>
                  <cm:title>${spaces.savedsearches.name}</cm:title>
                  <cm:description>${spaces.savedsearches.description}</cm:description>
               </cm:folder>
            </cm:contains>
         </cm:folder>
            <cm:folder view:childName="${spaces.guest_home.childname}">
                <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.guest_home.name}</cm:name>
            <app:icon>space-icon-default</app:icon>
            <cm:title>${spaces.guest_home.name}</cm:title>
            <cm:description>${spaces.guest_home.description}</cm:description>

<!– PART I ADDED –>

            </cm:folder>
              <cm:folder view:childName="cm:digital_assets">
                <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.xpflow_dam.name}</cm:name>
            <app:icon>space-icon-default</app:icon>
            <cm:title>${spaces.xpflowdam.name}</cm:title>
            <cm:description>${spaces.xpflowdam.description}</cm:description>
            <cm:contains>
               <cm:folder view:childName="cm:thumbnails">
                        <view:acl view:inherit="false">
                            <view:ace view:access="ALLOWED">
                                <view:authority>GROUP_EVERYONE</view:authority>
                                <view:permission>Contributor</view:permission>
                            </view:ace>
                        </view:acl>
                  <app:uifacets />
                  <cm:name>${spaces.xpflowthumbnail.name}</cm:name>
                  <app:icon>space-icon-default</app:icon>
                  <cm:title>${spaces.xpflowthumbnail.name}</cm:title>
                  <cm:description>${spaces.xpflowthumbnail.description}</cm:description>
               </cm:folder>
            </cm:contains>
            </cm:folder>
      </cm:contains>
   </cm:folder>

</view:view>


boostrap-spaces.xml



# Labels used in bootstrap Space definitions

spaces.company_home.name=XP
spaces.company_home.description=The XP root space

spaces.dictionary.name=Data Dictionary
spaces.dictionary.description=User managed definitions

spaces.templates.name=Space Templates
spaces.templates.description=Space templates

spaces.templates.content.name=Presentation Templates
spaces.templates.content.description=Presentation templates

spaces.savedsearches.name=Saved Searches
spaces.savedsearches.description=Saved Searches

spaces.guest_home.name=Guest Home
spaces.guest_home.description=The guest root space

spaces.xpflowdam.name=Digital Asset Storage
spaces.xpflowdam.description=Area to store Digital Assets

spaces.xpflowthumbnail.name=Thumbnail Storage
spaces.xpflowthumbnail.description=Area to Store Digital Assets' Thumbnails


Now custom.properties





# Spaces Configuration

spaces.store=workspace://SpacesStore
spaces.company_home.childname=app:xpflow
spaces.guest_home.childname=app:guest_home
spaces.dictionary.childname=app:dictionary
spaces.templates.childname=app:space_templates
spaces.templates.content.childname=app:content_templates
spaces.savedsearches.childname=app:saved_searches
spaces.xpflowdam.childname=cm:xpflowdam
spaces.xpflowthumbnail.childname=cm:xpthumbnail



the solution works fine if i put the child name of the space in the spaces.xml.

so instead of putting ${spaces.xpflowdam.childname} if i put cm:xpflow, everything works fine. But when i put "${spaces.xpflowdam.childname}" and expect it to get the value from custom.properties it doesnt and i cant load the application after refreshing the db.

Why is this happening. Any ideas?

Cheers

-Thanesh

Outcomes