[MGNLGROOVY-122] Sample script to register app dynamically Created: 29/Sep/14  Updated: 23/Oct/14  Resolved: 21/Oct/14

Status: Closed
Project: Magnolia Groovy Module
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3.1

Type: Improvement Priority: Neutral
Reporter: Jan Haderka Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: quickwin
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File createAppScript.groovy     XML File scripts.CreateAppScript.xml    
Issue Links:
dependency
depends upon MAGNOLIA-5934 API to dynamically register workspace Closed
depends upon MAGNOLIA-5935 Extra Ops for NodeBuilder Closed
Template:
Patch included:
Yes
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)
Date of First Response:

 Description   

Simple sample script to register content app from just a name. Extra parameters such as parent app, app group, repository, icon, folder availability, etc. can be configured.



 Comments   
Comment by Philip Mundt [ 08/Oct/14 ]

Adding adjusted groovy script

Comment by Jan Haderka [ 20/Oct/14 ]

Maybe it's not too late - here's version of the script that also adds image provider by default. Something that ppl usually want for their app and not everyone knows how to do it.

Comment by Christopher Zimmermann [ 21/Oct/14 ]

The script works fine, but causes a warning with a stack trace in the console:

2014-10-21 14:49:03,461 WARN org.apache.jackrabbit.core.SessionImpl : Unclosed session detected. The session was opened here:
java.lang.Exception: Stack Trace
at org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:222)
at org.apache.jackrabbit.core.SessionImpl.<init>(SessionImpl.java:239)

http://pastie.org/9665011

Comment by Christopher Zimmermann [ 21/Oct/14 ]

Also I commited some minor language fixes on the branch.

Comment by Jan Haderka [ 21/Oct/14 ]

If we are fixing language, shouldn't the second sentence end with dot as well?

As for the ugly stack trace - I think it's not issue of the script or groovy, but rather that of DefaultRepositoryManager and could be possibly fixed with https://gist.github.com/721a77c949af087539b3

Comment by Federico Grilli [ 21/Oct/14 ]

Thanks Jan for the input re the stack trace.

Generated at Mon Feb 12 05:55:48 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.