Re: [proposal][scripting console] http API for terminal usage
gave it a try and i get something like g! pipe:run echo /content/blah/us/en / children cq:Page {"items":["/content/blah/us/en/new_test_page","/content/blah/us/en/name"],"size":2} i had to switch from "|" to "/" as "|" is a "real" pipe and ironically it will be difficult to pass sling resource through that one. sending this now a few days before i push it in case someone has opinions (you never know) Le mer. 23 mai 2018 à 12:46, Robert Munteanu a écrit : > On Wed, 2018-05-23 at 11:46 +0200, Nicolas Peltier wrote: > > What i'm unclear now is wether we should go the route of a provider > > for > > scripting in general, or "just" pipe (which is my direct interest), > > so > > something like a command where first argument specify a context, > > second is > > the actual script > > g! sling:script groovy println 'Hello World' > > g! sling:script groovy-pipe > > p.echo("/content/site").$("sling:resourceType='bar'").mv("/archives") > > > > or direct > > g! pipe:run > > echo("/content/site").$("sling:resourceType='bar'").mv("/archives") > > I would go with the second approach, unless there is a short-term plan > to add more commands. > > If we get more gogo shell commands we can always refactor later. > > Robert >
Re: [proposal][scripting console] http API for terminal usage
On Wed, 2018-05-23 at 11:46 +0200, Nicolas Peltier wrote: > What i'm unclear now is wether we should go the route of a provider > for > scripting in general, or "just" pipe (which is my direct interest), > so > something like a command where first argument specify a context, > second is > the actual script > g! sling:script groovy println 'Hello World' > g! sling:script groovy-pipe > p.echo("/content/site").$("sling:resourceType='bar'").mv("/archives") > > or direct > g! pipe:run > echo("/content/site").$("sling:resourceType='bar'").mv("/archives") I would go with the second approach, unless there is a short-term plan to add more commands. If we get more gogo shell commands we can always refactor later. Robert
Re: [proposal][scripting console] http API for terminal usage
yes i am, thanks Bertrand! the first proposal is for exposing same scripting capability through gogo (aka implementing a command provider in scripting console project) 2018-05-23 11:58 GMT+02:00 Bertrand Delacretaz : > Hi Nicolas, > > On Mon, May 14, 2018 at 12:05 PM, Nicolas Peltier > wrote: > > ...thought about using terminal rather than felix html page for scripting > > (when scripting take one line like for pipes, htis might be useful)... > > Are you aware of > https://github.com/apache/sling-org-apache-sling-scripting-console ? > > There might be synergies. > > -Bertrand >
Re: [proposal][scripting console] http API for terminal usage
Hi Nicolas, On Mon, May 14, 2018 at 12:05 PM, Nicolas Peltier wrote: > ...thought about using terminal rather than felix html page for scripting > (when scripting take one line like for pipes, htis might be useful)... Are you aware of https://github.com/apache/sling-org-apache-sling-scripting-console ? There might be synergies. -Bertrand
Re: [proposal][scripting console] http API for terminal usage
Thanks for this Robert. It looks like gogo is indeed the way to go (sounds good :-)). What i'm unclear now is wether we should go the route of a provider for scripting in general, or "just" pipe (which is my direct interest), so something like a command where first argument specify a context, second is the actual script g! sling:script groovy println 'Hello World' g! sling:script groovy-pipe p.echo("/content/site").$("sling:resourceType='bar'").mv("/archives") or direct g! pipe:run echo("/content/site").$("sling:resourceType='bar'").mv("/archives") is there interest from the community for the first case and / or better ideas for making it less complicated? 2018-05-14 15:49 GMT+02:00 Robert Munteanu : > On Mon, 2018-05-14 at 12:05 +0200, Nicolas Peltier wrote: > > Hey, > > > > thought about using terminal rather than felix html page for > > scripting > > (when scripting take one line like for pipes, htis might be useful). > > The gogo shell can be deployed on Sling and you can make it accessible > via telnet ( unauthenticated, IIRC ) . I think this can also be doable > with SSH. > > From there you can add new Gogo commands from your bundle or an > additional Sling Pipes + Gogo shell bundle. > > Is that what you're looking for? > > Robert >
Re: [proposal][scripting console] http API for terminal usage
On Mon, 2018-05-14 at 12:05 +0200, Nicolas Peltier wrote: > Hey, > > thought about using terminal rather than felix html page for > scripting > (when scripting take one line like for pipes, htis might be useful). The gogo shell can be deployed on Sling and you can make it accessible via telnet ( unauthenticated, IIRC ) . I think this can also be doable with SSH. >From there you can add new Gogo commands from your bundle or an additional Sling Pipes + Gogo shell bundle. Is that what you're looking for? Robert
Re: [proposal][scripting console] http API for terminal usage
Hi, sorry about that, you are right, so: # on the server side, in addition to what exists already, would be cool that a given script resource can have "depedencies", and if you "post" to that script resource, you get dependencies executed before. This would allow to add a context that makes scripts smaller (and easier to read/maintain), # on a client side, a CLI would be nice, yes, that manages default host, auth, and eventually scripting languages. I can think about nice features with pipes as it's the one i'm using the most but i think it would be best to have something more generic Nicolas 2018-05-14 13:41 GMT+02:00 Ioan Eugen Stan : > Hi, > > Sounds interesting. Are you talking like building a CLI that can be used > for scripts and maybe more management operations? > > Could you please describe in more details how you see this working? I > think it would be more easy for people to understand your use case. > > Thanks, > > Eugen Stan > Netdava International > > Mesaj original > De la: peltier.nico...@gmail.com > Trimis: 14 mai 2018 13:05 > Către: dev@sling.apache.org > Răsp. la: dev@sling.apache.org > Subiect: [proposal][scripting console] http API for terminal usage > > Hey, > > thought about using terminal rather than felix html page for scripting > (when scripting take one line like for pipes, htis might be useful). > > Thoughts? > > Nicolas >
Re: [proposal][scripting console] http API for terminal usage
Hi, Sounds interesting. Are you talking like building a CLI that can be used for scripts and maybe more management operations? Could you please describe in more details how you see this working? I think it would be more easy for people to understand your use case. Thanks, Eugen Stan Netdava International Mesaj original De la: peltier.nico...@gmail.com Trimis: 14 mai 2018 13:05 Către: dev@sling.apache.org Răsp. la: dev@sling.apache.org Subiect: [proposal][scripting console] http API for terminal usage Hey, thought about using terminal rather than felix html page for scripting (when scripting take one line like for pipes, htis might be useful). Thoughts? Nicolas
[proposal][scripting console] http API for terminal usage
Hey, thought about using terminal rather than felix html page for scripting (when scripting take one line like for pipes, htis might be useful). Thoughts? Nicolas