Questions tagged [groovy-console]

The Groovy Console is a Java Swing based graphical user interface that is packaged with the Groovy distribution. It provides a simple but elegant way of executing interactive groovy scripts, with Groovy script entered in the top window, and the output of the script appearing in the lower window.

The Groovy Console is a Java Swing based graphical user interface that is packaged with the Groovy distribution. It provides a simple but elegant way of executing interactive groovy scripts, with Groovy script entered in the top window, and the output of the script appearing in the lower window.

The console is launched with one of a few variations of a command line call to groovyConsole. The variations comprise platform differences and executables that are compiled for some operating systems. It's location is:

<Groovy Home>\bin\groovyConsole[.*]

Variations include:

  • groovyConsole.bat (Windows)
  • groovyConsole.exe (Windows)
  • groovyConsole (Unix/Linux)

Groovy Console Snapshot

enter image description here

GroovyConsole Functions

Some of the useful functions provided in the UI are:

  • File Open / File Save / File New
  • New Window (multiple open windows supported)
  • Standard Edit Menu Functions (Copy/Paste/Undo/Redo/Search/Replace)
  • Various UI Property Toggles and Controls
  • Groovy AST Viewer
  • Groovy Variables Viewer
  • Compile Scripts
  • Run Scripts
  • Interrupt Running Script
  • Add JAR to Classpath
  • Add Directory to Classpath
162 questions
0
votes
0 answers

CliBuilder not getting entire list of arguments for an option

Problem I need to parse command like: groovy App.groovy --sourceFiles a.xlsx b.xlsx --destinationFolder ../legacy-data-migration What I have tried I write a CommandLineUtils, defined to be: package com.signaturemd.sposZohoMergeScript.utils import…
Mike Warren
  • 3,796
  • 5
  • 47
  • 99
0
votes
1 answer

I have multi lines in my code, I want to write certain lines in a new line, how can I do it in groovy body

body:""" Hi, how are you? Yes, I am doing good. what about you. How are things going? Nothing interesting, as usual. """ In the above lines, I want to print a sentence in new line in groovy (body), how can I accomplish that? Note: I am new to…
Yamuna S
  • 13
  • 4
0
votes
1 answer

Creating dynamic JSON objects using groovy

I am trying to convert a JSON array into a JSON object, keys of the JSON object are dynamic in nature, please find the example below. "Section" field in the source array is getting converted to key of object in target JSON Source: [ { …
p_nair
  • 57
  • 1
  • 1
  • 5
0
votes
1 answer

Groovy: how to reference a variable?

How to reference the variable inside the map . When I do this I only get literal string dcihub_sonar_binaries, while I expect the else rule to result to value of dcihub_sonar_binaries. dcihub_sonar_binaries =…
WhoAmI
  • 1,013
  • 2
  • 9
  • 19
0
votes
1 answer

AEM cloud, how do you install groovy console?

There is a groovy console for AEM: https://github.com/CID15/aem-groovy-console However, I dont know how to install it for AEM cloud. The instructions say to download it and run a local installer, which will install groovy console some how on the…
John Little
  • 10,707
  • 19
  • 86
  • 158
0
votes
1 answer

Groovy - String created from UTF8 bytes has wrong characters

The problem came up when getting the result of a web service returning json with Greek characters in it. Actually it is the city of Mykonos. The challenge is whatever encoding or conversion I'm using it is always displayed as:ΜΎΚΟxCE?ΟΣ . But it…
Andreas
  • 3
  • 3
0
votes
1 answer

not able to install Groovy in windows 10

I am trying to install Groovy on windows 10. I have Java 17.0.4.1 installed and trying to install groovy 4.0.5 & here is the link (https://groovy.jfrog.io/ui/native/dist-release-local/groovy-windows-installer/groovy-4.0.5/) after installation I…
santosh
  • 192
  • 9
0
votes
1 answer

How to check all files in a directory except one file in Groovy language

I am trying to search a word in every file in a directory but I want to exclude my logfile. My code is something like this user input: search test C:\Users\Desktop\test\Groovy My code import static groovy.io.FileType.FILES import…
bjhayeyy
  • 79
  • 12
0
votes
0 answers

Issue with Groovy language converting Integers to Roman numerals

Here is the output that I get, It should be converting to Roman Numerals - the following - 3569 and 1234 Number: 3569 1000: III 100: V 10: VI 1: IX Number: 1234 1000: I 100: II 10: III 1: IV Here is the code: def emitRNValue(int quotient, int…
Nicky
  • 1
0
votes
1 answer

How to get data from xml file using groovy?

Following groovy script is not working as expected. def…
GameBuilder
  • 1,169
  • 4
  • 31
  • 62
0
votes
1 answer

How to find parent node with specific name?

def query = SQLQuery() <- my sql query def result = query.execute() result.nodes.each{node -> node.setProperty(JcrConstants.JCR_TITLE, "new3") I found all components with a certain resource type using groovy consoly, and I need to replace…
alex
  • 1
  • 2
0
votes
1 answer

Facing issue while executing the Groovy code

def hawkClient = new com.wealdtech.hawk.HawkClient. Builder() .credentials(new com.wealdtech.hawk.HawkCredentials.Builder() .keyId("your-hawk-hey-id") .key("your-hawk-key") .algorithm(Algorithm.SHA256) …
Pratik Dey
  • 11
  • 3
0
votes
1 answer

How to get property of parent node's parent node

I am using Groovy console and need to update title components on pages by values from page title getNode('/content/').recurse { resourceNode -> if (resourceNode.hasProperty('sling:resourceType')) { final def resourceType =…
alex
  • 1
  • 2
0
votes
1 answer

Groovy Script AEM Asset Reference Update

So I'm working with AEM and am attempting to create a script that grabs all pages under a specific path and updates the image reference on the page from a list of assets under a curtain path. Both of my select query's aren't returning the specific…
Blank
  • 1
0
votes
2 answers

Groovy: Class fields default conditional values

I have below sample classes in my application: class A { Integer a String b Integer c = (a < 5) ? a+5 : a+10 } class B { void method1() { A a = new A(a:4, b:"test") log.print("c: ", a.c) } } When my code is calling…
Phoebe
  • 1
  • 1