[MGNLGROOVY-137] RemoteClientConsole doesn't work on M5 Created: 11/May/15 Updated: 25/Mar/22 |
|
| Status: | Open |
| Project: | Magnolia Groovy Module |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Federico Grilli | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| 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)
|
||||||||||||
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
||||||||||||
| Date of First Response: | |||||||||||||
| Description |
|
Remote client console no longer works with M5. Goal How To *java -jar magnolia-module-groovy-1.2.jar *info.magnolia.module.groovy.remote.RemoteClientConsoleMain -user superuser -pass superuser ....
usage: RemoteClientConsoleMain [-cmd <arg>] [-file <arg>] [-help] [-pass
<arg>] [-uri <arg>] [-user <arg>]
-cmd,--cmd <arg> Groovy command line to be executed. Can have one
to n cmd arguments like
"name='World1'; println \"Hello $name!\"; println \"Hello $name1!\" ;"
-file,--file <arg> Groovy File to execute. Can have one to n file
arguments
-help,--help Print this usage information
-pass,--password <arg> Enter password
-uri,--uri <arg> Enter Magnolia Uri like
http://localhost:8080/contextpath
-user,--user <arg> Enter user
or write your own Main class: Create a java project. ... import info.magnolia.module.groovy.util.MgnlGroovyRemoteClientConsole; import java.io.File; /** * ... public class MainGroovyClient { /** * @param args */ public static void main(String[] args) throws Exception { //Get incomming parameter from the args[] String userName = args[0]; ... //Connect to Magnolia app MgnlGroovyRemoteClientConsole groovyClient = new MgnlGroovyRemoteClientConsole(magnoliaUri, userName, password); if(groovyClient.isConnected()){ for(int i=3;i<args.length;i++) { ..... String groovyScriptInArg = args[i]; Object toExecute = null; //Check if the groovyScriptInArg is a File or a command line ... System.out.println(" "+groovyClient.execute(toExecute)); ... groovyClient.disconnect(); Notes Variable/context defined in a script will not be accessible to the other scripts. |
| Comments |
| Comment by Vitor Costa [ 10/Oct/17 ] |
|
This issue seems to be open still... What are the plans to fix this up? I'm running Magnolia 5.5, and I am unable to remotely start my groovy scripts... Is there some kind of workaround for this? The problem seems to be the POST request to "/.magnolia/pages/groovyInteractiveConsole.html", which seems to be returning HTTP 400 (Bad Request) |
| Comment by Federico Grilli [ 10/Oct/17 ] |
|
Hi Vitor, thanks for pointing this issue out again and sorry about the inconvenience. So far it's been very low priority. I will ask PM about plans to fix this. At the moment, as far as I know, there's no workaround. As of Magnolia 5 the groovyInteractiveConsole.html page no longer exists, as the UI implementation underwent a complete rewrite. Hope this helps, Federico |
| Comment by Vitor Costa [ 10/Oct/17 ] |
|
Hi Frederico, thank you for your feedback. That was my suspicion. It seems I'll have to see another way to go with this. I'm quite new to Magnolia, and I'm trying to find a way to automate an export and import process. My first thought was to use groovy scripts for this, hence this need for the remote client. However, I just found that there is a scheduler module, which seems to fit my needs. I know this is beyond the scope of this ticket, but do you know where can I have a look into some examples of scheduled jobs? If there is an example for export / import pages and assets, it would be perfect. Thank you! |
| Comment by Federico Grilli [ 10/Oct/17 ] |
|
Nice that you found a solution to your problem Hope this helps! |
| Comment by Vitor Costa [ 11/Oct/17 ] |
|
Federico, thank you very much for that documentation! That was exactly what I was looking for, and it's working like a charm! Best regards! |