0

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.

Eyzic
  • 60
  • 4

1 Answers1

0

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...

David Dejmal
  • 359
  • 1
  • 8
  • Thanks for a very structured answer! About 4. I think I was mistaken, I was only able to list which jar were installed through share and not add .jars/.amps. Another question then: If you develop a customization and host it publicly (for example github) it seems like an option to adding .amp/.jar is to include a dependency in the pom-file. Is it advisable to do this instead of moving .jar-files to the correct folders? An example customization that does this is: https://github.com/OrderOfTheBee/ootbee-support-tools – Eyzic Jul 08 '22 at 13:39
  • I seen dependency in POM files only in some kind of officials addons. It's because packages must be visible for maven. It's not wrong way but most of the time you can find public github repo with packages in release. Then it's very easy download AMPs or JARs and install then. Look at this list of addons. It's old but lot of thing works still good https://github.com/bhagyas/awesome-alfresco. – David Dejmal Jul 08 '22 at 14:41