[MAGNOLIA-1483] Scriptable paragraph actions Created: 25/Apr/07  Updated: 04/Dec/13  Resolved: 04/Dec/13

Status: Closed
Project: Magnolia
Component/s: templating
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Magnolia International Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)

 Description   

Since we added the possibility to execute actions with paragraphs (currently only with freemarker paragraphs, see MAGNOLIA-1462 and MAGNOLIA-1383), it would seem useful and nice if those actions would be scriptable. We could store these scripts in the repository, and like for storing templates in the repository, and like for MAGNOLIA-1482, this would allow their edition within Magnolia and their activation too.

Using JSR-223 seems like the most reasonable approach since that would give us pluggable scripting engines, thus leaving the langage choice to the script author.
http://jcp.org/en/jsr/detail?id=223
https://scripting.dev.java.net/



 Comments   
Comment by Magnolia International [ 20/Jan/09 ]

The script-console-shell module could potentially help, as well as the templating improvements in 4.0 - the model could be a script.

Comment by Magnolia International [ 12/Feb/10 ]

This is possible with the new magnolia-groovy-module. Only Groovy tho, no general javax.script support for now.

Comment by Magnolia International [ 22/Mar/10 ]

Using magnolia-module-groovy, templating models can now be Groovy classes (which can be stored and edited in the repository); this is transparent, i.e still configured with a modelClass property, and is achieved via the GroovyClassFactory.

Comment by Magnolia International [ 04/Dec/13 ]

This was indeed made possible with the introduction of the Groovy Module.
If a generic, javax.script-backed solution was needed, we'd need another improvement, but it doesn't to have any priority at the moment. Voice your opinion if it is to the contrary !

Generated at Mon Feb 12 03:27:21 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.