cancel
Showing results for 
Search instead for 
Did you mean: 

Extending Alfresco with AMP

Not applicable
Hi to everybody,

I try to extend my repository with an AMP. So I created a new project with maven using the archetype "maven-alfresco-extension-archetype". In the first step I added a new model and some entries in the "share-config-custom.xml" in order to display the new types of the model. I put the new files (model and config) in "<modulId>\src\main\config\model" and "<modulId>\src\main\config\ui". After that I edited the "bootstrap-context.xml" and added these lines:

  <bean id="ppi.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
    <property name="models">
      <list>
          <value>alfresco/module/myalfresco2/model/ppiModel.xml</value>
      </list>
    </property>      
  </bean>

  <bean id="ppi.ConfigBootstrap" class="org.alfresco.web.config.WebClientConfigBootstrap" init-method="init">
    <property name="configs">
      <list>
        <value>classpath:alfresco/module/myalfresco2/ui/share-config-custom.xml</value>
      </list>
    </property>
  </bean>

Accordingly I added an import-statement in the module-context.xml file. After creating the amp file without errors I applied this to the alfresco war file. Looking in the log file I found the message: Installed module found in distribution: myalfresco2
So everything seems to be ok. But unfortunately I could not change the type of any document to my new type. I could not see the new aspects. In the db could not find the new namespace. So I assume that I made something wrong. Before I tested the model and the share-config-custom.xml by putting them to the shared-folder in the tomcat dir. Could anybody help me with that problem?
4 REPLIES 4

billerby
Champ on-the-rise
Champ on-the-rise
The Alfresco extension archetype is used to create an Alfresco WAR. That is the Alfresco Repository and the old Explorer client.

To create an AMP you have to use an AMP archetype. An AMP can be installed onto the Alfresco war with the mmt-tool or as a maven dependency in the extension archetype.

For Alfresco Share to work you need to use the Alfresco Share extension. In this you can put your "share-config-custom.xml".

However, after reading your post I suspect you actually have created an Alfresco AMP with the amp archetype in maven. The problem is that you will need to create a Share Extension as well and in this you will put your share-config-custom.xml.

It a djungle, I know Smiley Happy

/Erik

Not applicable
Thanks for the reply,

now I created two maven-amp-plugins with the maven-alfresco-amp-archetype. One plugin injects my model into alfresco.war and the other one does the share customization. I applied both amps to the war files and it works.

edman193
Champ in-the-making
Champ in-the-making
Hi, I'm new in Alfresco, and I want know: in the AMP folder structure where should be the share-config-custom.xml file.

thanks

fliot
Champ in-the-making
Champ in-the-making
Hi,

Checkout my tiny addons : https://github.com/fliot/alfresco-geo-ext

It provides an .amp with new model content to alfresco, and a .jar for share customization.

Embed the additional share-config-custom.xml customization portions you want into the .jar share, and it makes a full answer to your need.

Regards,

Francois