cancel
Showing results for 
Search instead for 
Did you mean: 

Share site ACP import using AMP

jayesh_prajapat
Star Contributor
Star Contributor
Hello All,

I have created share site 'TEST' from Alfresco GUI. I created ACP file of share site from Alfresco DM using export option in ' Company Home > Sites > TEST> location. I selected "include this space" option during export process to include 'TEST' folder as well in ACP file.

I created AMP file to import ACP file in Alfresco instance. In-order to do that i provided below configuration in module content file.


<bean id="test.bootstrap"
      class="org.alfresco.repo.module.ImporterModuleComponent"
      parent="module.baseComponent">
  
   <!– Module Details –>
   <property name="moduleId" value="com_test" />
   <property name="name" value="test" />
   <property name="description" value="test" />
   <!–<property name="sinceVersion" value="1.0" />
   <property name="appliesFromVersion" value="1.0" />–>
  
   <!– Data properties –>
   <property name="importer" ref="spacesBootstrap"/>
   <property name="bootstrapViews">
      <list>
         <props>
            <prop key="path">/${spaces.company_home.childname}/${spaces.sites.childname}</prop>
            <prop key="location">alfresco/module/com_cignexdatamatics_clmsdm/bootstrap/test-folder.acp</prop>
         </props>
      </list>
   </property>
</bean>

I could import site acp file when i applied AMP file against fresh Alfresco instance (started only once), when i tried applying updated AMP file on same instance, it did not imported ACP file (I manually deleted earlier imported site before applying updated AMP package).

Note: I am using Alfresco version: Enterprise - v4.0.2 (.9 38)

Kindly suggest you idea to resolve this issue.

Thanks in advance.
1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator
Hello,

each module component (as identified by its ID) is only executed once by default. The execution is logged in the database and prevents any further execution, unless you configure the module to execute EACH TIME the repository is started.

Regards
Axel

View answer in original post

3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator
Hello,

each module component (as identified by its ID) is only executed once by default. The execution is logged in the database and prevents any further execution, unless you configure the module to execute EACH TIME the repository is started.

Regards
Axel

saket_saraf
Champ in-the-making
Champ in-the-making
Hi,

Continue with the same if i have new updates for the same module how will i update in the repository.
Where it stores the versions. Because i tried following settings but did not work
     

                       <property name="sinceVersion" value="2.0.0" />
                     <property name="appliesFromVersion" value="2.0.0" />
                       <property name="executeOnceOnly" value="false" />

           


Regards,
Saket S.

If you have a look at the code in
org.alfresco.repo.module.ModuleComponentHelper.executeComponent(String, VersionNumber, ModuleComponent, Set<ModuleComponent>)
I think you can conclude that the registry key is not using the version of the module at all. Thus, a module component once executed will never run again until you change it's name or you delete the appropriate key from the registry.

<java>RegistryKey executionDateKey = new RegistryKey(
                ModuleComponentHelper.URI_MODULES_1_0,
                REGISTRY_PATH_MODULES, moduleId, REGISTRY_PATH_COMPONENTS, name, REGISTRY_PROPERTY_EXECUTION_DATE);</java>

Furthermore, I see no use for <strong>sinceVersion</strong> and <strong>appliesFromVersion</strong> in solving this kind of problems.

However, I too am interested in what are the best options for implementing an upgrade path from one version of a module to a newer one?
Say I have this scenario:
<ul>
<li>Amp Version 1.0 : creates some users and groups</li>
<li>Amp Version 2.0 : needs to add some of the users to some of the groups (already created and imported by the previous version)</li>
<li>Amp Version 3.0 : needs to import some documents into the repository</li>
</ul>

How can I make sure that a client that has version 2.0 already installed, when upgrading to version 3.0 will get the extra documents into the repository and a client that has no version installed, when installing 3.0 will get everything properly imported in the repository ?

Any advice would be highly appreciated.

Best regards,
Dan.