SlideShare a Scribd company logo
1 of 30
Download to read offline
Axel Faust, Acosix GmbH
Patch Handling Patterns
Disclaimer(s)
●
●
8 years ACS vs. 1 year APS
●
ACS / APS = complex beasts ; 30 min = short
●
Naturally: patching / “messing around“ rarely appreciated
(my skills)∩(graphical slide wizardry)=∅
Necessity of Patching
●
Personal Alfresco JIRA statistics
– Not including customer support issues
– Two issues rejected due to age (2+ years)
JIRA issues since 2014
0
5
10
15
20
25
30
35
40
45
Open
Resolved
Rejected
Avg. days
0 50 100 150 200 250 300 350 400
Resolved
Open
Necessity of Patching
●
Statistics from collaboration update @ BeeCon 2017
●
11.75 % fixed
●
64.46 % rejected
Necessity of Patching
●
Alfresco issue priorities
– Triage: make issues actionable or close
– Resources: only if high profile or aligned with roadmap
– Support: continuation of operation / work-around
●
„Something is broken? Help yourself, hack the source“
(BeeCon 2016 t-shirt)
Pattern Overview
●
Source Patching
●
Defined Override Paths
●
Spring Overrides
●
Spring Post-Processing
●
Augmentation / Extension (JS)
●
I18n Patching
Pattern: Source Patching
●
Modify original Alfresco code and re-build artefacts
a) Full source clone + build
b) Track only changed files + repackage
●
Baselines
– ACS: SVN / GitHub
– APS: sources ZIP (no build routine)
–
Patched JARs: ¯_( ツ )_/¯ (only Greenmail / Tika @ GitHub)
Pattern: Source Patching
●
Various Challenges
– Comparing / tracking changes
– Build correctness
– Unsuited for addon providers
●
Last resort, unless
– Given no choice (APS UI / „private“ monoliths in Java)
– Providing PR / patch for Alfresco
– Collaboration on „soft“ forks, i.e. LXCommunity
Pattern: Defined Override Paths
●
Explicit ACS file overrides via lookup
– Repo / Share web scripts
– Surf models / templates
●
Surf DependencyHandler => „implicit“ override
1. Remote resource
2. classpath*:path
3. classpath*:/META-INF/path
4. webapp:path
Pattern: Defined Override Paths
●
„First found wins“ problems
– Explicit + implicit „hiding“ via classloader
– Conflict detection / info?
●
Reserved for end-user / customer
– Grey-ish: override to add extension points
Pattern: Spring Override
<bean id="SiteService_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor">
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
<property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property>
<property name="afterInvocationManager"><ref bean="afterInvocationManager"/></property>
<property name="objectDefinitionSource">
<value>
org.alfresco.service.cmr.site.SiteService.cleanSitePermissions=ACL_NODE.0.sys:base.ReadProperties
org.alfresco.service.cmr.site.SiteService.createContainer=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties
org.alfresco.service.cmr.site.SiteService.createSite=ACL_METHOD.GROUP_SITE_CREATORS
org.alfresco.service.cmr.site.SiteService.deleteSite=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.findSites=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties
org.alfresco.service.cmr.site.SiteService.getContainer=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties
org.alfresco.service.cmr.site.SiteService.listContainers=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties
<!-- …. -->
org.alfresco.service.cmr.site.SiteService.hasSite=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.isMember=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.listMembers=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.listMembersInfo=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.listMembersPaged=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.listSiteMemberships=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.listSites=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties
org.alfresco.service.cmr.site.SiteService.listSitesPaged=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties
org.alfresco.service.cmr.site.SiteService.removeMembership=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.canAddMember=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.setMembership=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.updateSite=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.countAuthoritiesWithRole=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.isSiteAdmin=ACL_ALLOW
org.alfresco.service.cmr.site.SiteService.*=ACL_DENY
</value>
</property>
</bean>
Pattern: Spring Override
●
Virtually impossible in APS
– @Component / @Service disallow „override by ID“
– Beans referenced by type: @Primary
●
Issues
– Adapting to changes on release
– Import order tug-of-war
– Conflicts with vendor modules („bad boy“ RM)
– Unsuitable for addon providers
Pattern: Spring Post-Processing
●
Run-time augmentation
– Definitions: BeanDefinitionRegistryPostProcessor /
BeanFactoryPostProcessor
– Beans: BeanPostProcessor
●
APS-specific
– @Component
– @Configuration in com.activiti.conf + @ComponentScan/@PropertySources
Pattern: Spring Post-Processing
Pattern: Spring Post-Processing
●
Smart(er) post-processing
– Configurable enablement, conditional applications
– Dependencies + respect for other changes (merge)
YYYY-MM-DD HH:mm:ss,sss INFO [...] [localhost-startStop-1] [...] patch will not be applied - class of bean webscripts.container does not match expected
implementation org.alfresco.repo.web.scripts.RepositoryContainer
Pattern: Spring Post-Processing
Pattern: Spring Post-Processing
Extremely simple
example implemenation
Pattern: Spring Post-Processing
●
Benefits
– Usable in ACS + APS
– Dis-/enableable without rebuild
– Potentially adaptive to environment
– Suitable for addon providers
●
Issues
– Conflicts with uncoordinated / naive post-processors (again, RM)
– Order dependant on classpath / scanning order
– No out-of-the-box „share-global.properties“ for consolidated enablement config
Pattern: Augmentation / Extension (JS)
●
ACS/YUI: custom JS loaded via config / Surf extension module
Pattern: Augmentation / Extension (JS)
●
Aikau or APS: Extend + switch
Pattern: Augmentation / Extension (JS)
Pattern: Augmentation / Extension (JS)
●
ACS/Aikau: Replace / augment module fragments
Pattern: Augmentation / Extension (JS)
●
ACS/Aikau: Replace / augment module fragments
Pattern: Augmentation / Extension (JS)
●
Aikau „global patching“: loading via service / root module
●
Ideally no change to source JS
=> APS: no need to split/re-aggregate file
●
Complexity of transitive call chain
●
Monolithic modules with inaccessible internals
(i.e. callback/promise/listener-hell in APS)
●
Limited ability to check base versions + adapt
Pattern: Augmentation / Extension (JS)
Pattern: I18n Patching
●
ACS: web script customisation (Surf extension module)
●
ACS/YUI: custom resource bundle
●
ACS/Aikau: patcher + custom i18n scope
Pattern: I18n Patching
●
APS: source patch only
– ./i18n/locale.json per sub-app (editor / workflow / idm…)
– Potential: JSON diff + merge via build
●
ACS i18n priorities: most specific + last loaded
– global < argument scope (Alfresco.util.message)
– global < page < default < module-static < configured scope(s)
(module:alfresco/core/Core#message)
– Share global < web script local < web script customisation
Time‘s (Almost/Already?) Up
●
No „one size fits all“ pattern(s)
●
Recommendation summary
– Prefer runtime-/extension-based patching
– Override/source patching as last resort
– Alfresco: need better extension / patching points
Thanks
Axel Faust
Twitter: @ReluctantBird83
IRC #alfresco: AFaust

More Related Content

Similar to Patch handling patterns for ACS and APS

Multi modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.jsMulti modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.js
David Amend
 
High performance website
High performance websiteHigh performance website
High performance website
Chamnap Chhorn
 
SiriusCon2016 - Modelling Spacecraft On-board Software with Sirius
SiriusCon2016 - Modelling Spacecraft On-board Software with SiriusSiriusCon2016 - Modelling Spacecraft On-board Software with Sirius
SiriusCon2016 - Modelling Spacecraft On-board Software with Sirius
Obeo
 
01 apache camel-intro
01 apache camel-intro01 apache camel-intro
01 apache camel-intro
RedpillLinpro
 

Similar to Patch handling patterns for ACS and APS (20)

IBM Connect 2016 - AD1548 - Building Responsive XPages Applications
IBM Connect 2016 - AD1548 - Building Responsive XPages ApplicationsIBM Connect 2016 - AD1548 - Building Responsive XPages Applications
IBM Connect 2016 - AD1548 - Building Responsive XPages Applications
 
Evolve18 | Ameeth Palla | Optimizing Your Assets Implementation
Evolve18 | Ameeth Palla | Optimizing Your Assets ImplementationEvolve18 | Ameeth Palla | Optimizing Your Assets Implementation
Evolve18 | Ameeth Palla | Optimizing Your Assets Implementation
 
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
Chris OBrien - Pitfalls when developing with the SharePoint Framework (SPFx)
 
Scaling 101 test
Scaling 101 testScaling 101 test
Scaling 101 test
 
Scaling 101
Scaling 101Scaling 101
Scaling 101
 
Sprint 71
Sprint 71Sprint 71
Sprint 71
 
Sprint 33
Sprint 33Sprint 33
Sprint 33
 
Using the PostgreSQL Extension Ecosystem for Advanced Analytics
Using the PostgreSQL Extension Ecosystem for Advanced AnalyticsUsing the PostgreSQL Extension Ecosystem for Advanced Analytics
Using the PostgreSQL Extension Ecosystem for Advanced Analytics
 
Hot tutorials
Hot tutorialsHot tutorials
Hot tutorials
 
The new static resources framework
The new static resources frameworkThe new static resources framework
The new static resources framework
 
Multi modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.jsMulti modularized project setup with gulp, typescript and angular.js
Multi modularized project setup with gulp, typescript and angular.js
 
Testable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascriptTestable client side_mvc_apps_in_javascript
Testable client side_mvc_apps_in_javascript
 
High performance website
High performance websiteHigh performance website
High performance website
 
SiriusCon2016 - Modelling Spacecraft On-board Software with Sirius
SiriusCon2016 - Modelling Spacecraft On-board Software with SiriusSiriusCon2016 - Modelling Spacecraft On-board Software with Sirius
SiriusCon2016 - Modelling Spacecraft On-board Software with Sirius
 
Azure Nights August2017
Azure Nights August2017Azure Nights August2017
Azure Nights August2017
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
 
Sprint 68
Sprint 68Sprint 68
Sprint 68
 
01 apache camel-intro
01 apache camel-intro01 apache camel-intro
01 apache camel-intro
 
Bn 1016 demo postgre sql-online-training
Bn 1016 demo  postgre sql-online-trainingBn 1016 demo  postgre sql-online-training
Bn 1016 demo postgre sql-online-training
 
Git migration - Lessons learned
Git migration - Lessons learnedGit migration - Lessons learned
Git migration - Lessons learned
 

Recently uploaded

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Recently uploaded (20)

%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 

Patch handling patterns for ACS and APS

  • 3. Disclaimer(s) ● ● 8 years ACS vs. 1 year APS ● ACS / APS = complex beasts ; 30 min = short ● Naturally: patching / “messing around“ rarely appreciated (my skills)∩(graphical slide wizardry)=∅
  • 4. Necessity of Patching ● Personal Alfresco JIRA statistics – Not including customer support issues – Two issues rejected due to age (2+ years) JIRA issues since 2014 0 5 10 15 20 25 30 35 40 45 Open Resolved Rejected Avg. days 0 50 100 150 200 250 300 350 400 Resolved Open
  • 5. Necessity of Patching ● Statistics from collaboration update @ BeeCon 2017 ● 11.75 % fixed ● 64.46 % rejected
  • 6. Necessity of Patching ● Alfresco issue priorities – Triage: make issues actionable or close – Resources: only if high profile or aligned with roadmap – Support: continuation of operation / work-around ● „Something is broken? Help yourself, hack the source“ (BeeCon 2016 t-shirt)
  • 7. Pattern Overview ● Source Patching ● Defined Override Paths ● Spring Overrides ● Spring Post-Processing ● Augmentation / Extension (JS) ● I18n Patching
  • 8. Pattern: Source Patching ● Modify original Alfresco code and re-build artefacts a) Full source clone + build b) Track only changed files + repackage ● Baselines – ACS: SVN / GitHub – APS: sources ZIP (no build routine) – Patched JARs: ¯_( ツ )_/¯ (only Greenmail / Tika @ GitHub)
  • 9. Pattern: Source Patching ● Various Challenges – Comparing / tracking changes – Build correctness – Unsuited for addon providers ● Last resort, unless – Given no choice (APS UI / „private“ monoliths in Java) – Providing PR / patch for Alfresco – Collaboration on „soft“ forks, i.e. LXCommunity
  • 10. Pattern: Defined Override Paths ● Explicit ACS file overrides via lookup – Repo / Share web scripts – Surf models / templates ● Surf DependencyHandler => „implicit“ override 1. Remote resource 2. classpath*:path 3. classpath*:/META-INF/path 4. webapp:path
  • 11. Pattern: Defined Override Paths ● „First found wins“ problems – Explicit + implicit „hiding“ via classloader – Conflict detection / info? ● Reserved for end-user / customer – Grey-ish: override to add extension points
  • 12. Pattern: Spring Override <bean id="SiteService_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor"> <property name="authenticationManager"><ref bean="authenticationManager"/></property> <property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property> <property name="afterInvocationManager"><ref bean="afterInvocationManager"/></property> <property name="objectDefinitionSource"> <value> org.alfresco.service.cmr.site.SiteService.cleanSitePermissions=ACL_NODE.0.sys:base.ReadProperties org.alfresco.service.cmr.site.SiteService.createContainer=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties org.alfresco.service.cmr.site.SiteService.createSite=ACL_METHOD.GROUP_SITE_CREATORS org.alfresco.service.cmr.site.SiteService.deleteSite=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.findSites=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties org.alfresco.service.cmr.site.SiteService.getContainer=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties org.alfresco.service.cmr.site.SiteService.listContainers=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties <!-- …. --> org.alfresco.service.cmr.site.SiteService.hasSite=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.isMember=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.listMembers=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.listMembersInfo=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.listMembersPaged=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.listSiteMemberships=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.listSites=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties org.alfresco.service.cmr.site.SiteService.listSitesPaged=ACL_ALLOW,AFTER_ACL_NODE.sys:base.ReadProperties org.alfresco.service.cmr.site.SiteService.removeMembership=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.canAddMember=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.setMembership=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.updateSite=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.countAuthoritiesWithRole=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.isSiteAdmin=ACL_ALLOW org.alfresco.service.cmr.site.SiteService.*=ACL_DENY </value> </property> </bean>
  • 13. Pattern: Spring Override ● Virtually impossible in APS – @Component / @Service disallow „override by ID“ – Beans referenced by type: @Primary ● Issues – Adapting to changes on release – Import order tug-of-war – Conflicts with vendor modules („bad boy“ RM) – Unsuitable for addon providers
  • 14. Pattern: Spring Post-Processing ● Run-time augmentation – Definitions: BeanDefinitionRegistryPostProcessor / BeanFactoryPostProcessor – Beans: BeanPostProcessor ● APS-specific – @Component – @Configuration in com.activiti.conf + @ComponentScan/@PropertySources
  • 16. Pattern: Spring Post-Processing ● Smart(er) post-processing – Configurable enablement, conditional applications – Dependencies + respect for other changes (merge) YYYY-MM-DD HH:mm:ss,sss INFO [...] [localhost-startStop-1] [...] patch will not be applied - class of bean webscripts.container does not match expected implementation org.alfresco.repo.web.scripts.RepositoryContainer
  • 18. Pattern: Spring Post-Processing Extremely simple example implemenation
  • 19. Pattern: Spring Post-Processing ● Benefits – Usable in ACS + APS – Dis-/enableable without rebuild – Potentially adaptive to environment – Suitable for addon providers ● Issues – Conflicts with uncoordinated / naive post-processors (again, RM) – Order dependant on classpath / scanning order – No out-of-the-box „share-global.properties“ for consolidated enablement config
  • 20. Pattern: Augmentation / Extension (JS) ● ACS/YUI: custom JS loaded via config / Surf extension module
  • 21. Pattern: Augmentation / Extension (JS) ● Aikau or APS: Extend + switch
  • 22. Pattern: Augmentation / Extension (JS)
  • 23. Pattern: Augmentation / Extension (JS) ● ACS/Aikau: Replace / augment module fragments
  • 24. Pattern: Augmentation / Extension (JS) ● ACS/Aikau: Replace / augment module fragments
  • 25. Pattern: Augmentation / Extension (JS) ● Aikau „global patching“: loading via service / root module
  • 26. ● Ideally no change to source JS => APS: no need to split/re-aggregate file ● Complexity of transitive call chain ● Monolithic modules with inaccessible internals (i.e. callback/promise/listener-hell in APS) ● Limited ability to check base versions + adapt Pattern: Augmentation / Extension (JS)
  • 27. Pattern: I18n Patching ● ACS: web script customisation (Surf extension module) ● ACS/YUI: custom resource bundle ● ACS/Aikau: patcher + custom i18n scope
  • 28. Pattern: I18n Patching ● APS: source patch only – ./i18n/locale.json per sub-app (editor / workflow / idm…) – Potential: JSON diff + merge via build ● ACS i18n priorities: most specific + last loaded – global < argument scope (Alfresco.util.message) – global < page < default < module-static < configured scope(s) (module:alfresco/core/Core#message) – Share global < web script local < web script customisation
  • 29. Time‘s (Almost/Already?) Up ● No „one size fits all“ pattern(s) ● Recommendation summary – Prefer runtime-/extension-based patching – Override/source patching as last resort – Alfresco: need better extension / patching points