Alfresco content services - Extentions/AMP/customization - How does it work?

159 Views Asked by At

I have recently started learning about Alfresco Content Service.

I have some questions:

My understanding is that the standard way to add customization is to create AMP's.

  1. Why create an amps for each customization instead of adding it directly to the configurations of ACS? Are there some benefits like not having to restart the service or something?
  2. If apply_amps adds all custom amps to the alfresco server (.war files), won't there be a risk of customizations writing over each other? E.g if two different amps change the same standard button in the share service.

I have found that there are 2 ways to add these customizations as well:

  1. Add dependency to the pom file. (works only for .jar)
  2. Actually compile the .amp and move it to the correct folder and run apply_amps.sh.

From the documentation it seems to my like AMP-files used to be the standard way of adding customization but that there have now been a move away from this in favor of using regular jar files and eventually in 7.1 and forward use JSON instead.

Yet other tutorials I find mentions things like "always use .amp". Which then seems strange if it contradicts the information on the official documentation.

Also I found something about adding amps through the share interface? Or must they always be added when building the server (.war)?

Could someone provide me with a thorough explanation of the best practice for applying customizations to the alfresco content service? Preferably with details regarding a live production setting.

Thanks for helping me make some of this clearer.

1

There are 1 best solutions below

2
David Dejmal On

I'll try to give you helpful answers:

  1. Making app packages (APMs or JARs) is much better than changing config manually. It's good for versioning, portability (TEST vs PROD or between projects), composition (you can add some addons witch are often very useful)... It is standard and good way how to build a web app.

  2. About conflict of customizations, I'm not sure how it works. Is good practise always use own namespace for every AMP. If AMPs write to the same file, result is always append (share-config-custom.xml can get be very big).

  3. Problem about JARs and AMPs is simple. Old version of Alfresco supports more AMPs than JARs. Now it does not matter with way you use. Try to look inside these packages they look very similarly.

  4. I never heard about adding AMPs through the share interface. Have you some source? Only thing which is similar is creating content model through Model manager (https://docs.alfresco.com/content-services/latest/tutorial/model/)

  5. I use for PROD combination of AMPs and JARs. I have a lot of legacy code and addons in AMPs and new things in JARs. Alfresco work with them same...