You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2011/09/06 15:49:19 UTC

Pivot-Shell

Hi all,
an idea for future Pivot releases, based on what I see/use on other modern
frameworks like Grails, Griffon, Play, Rails, to give to us (and our users)
a more Installable Internet Applications (IIA) feel, even for Pivot itself
... and for example to run Tutorials and Demos as Standalone applications
without having to deploy pivot wars in a local Tomcat.
So for example the run application command could propose a list of candidate
classes (maybe with the name without the default Pivot package for them, if
unique).
Note that for this we should even deploy pivot-demos and pivot-tutorials
jars, and not only inside wars.

Proposal: 
add a pivot-shell jar and a bootstrap shell script (one for Windows and
another for Unix/Linux) that set the environment to Pivot jars (and maybe
others if present in the right folder) that could give us (and our users) to
run Pivot tasks simply, for example some command:

run-appl, run-applet, run-webstart, 
alias (cache a simple name for a full class name), 
install (copy the given jar under a .pivot-shell/lib folder under user
profile),
and maybe even create-app from some templates, 
etc ...

Note that single commands usually are searched in dedicated folders (and/or
jars) for better modularity.


Ok, I know this is a lot of stuff, and for example most frameworks providing
this feature are using Groovy to simplify (a lot) things ... but in a
mid/long term vision could be useful.
Play for example goes further and embed a Python distribution inside it,
while I've seen other frameworks distribute only shell scripts (for example
in Ruby) without the interpreter.
But of course I don't want to bloat our binary distribution with many MB of
things ... and to have problems with licenses by redistribution (contact
legals on jira if needed). 
So a first approach could be to have some minimal features inside a jar, and
some (OS native) shell scripts to bootstrap this (non-interactive) Shell.
And if possible inside pivot-shell jar put some utility classes to scan
Pivot classes and cache (in a config file under the profile) all that are
runnable as Application, and Applet, etc ...

To start I could create it in one of our Apache-Extras projects, and see
later if useful to move in a pivot-shell project in core Pivot ... and
create a binary distribution for it to go over the Pivot binary
distribution, in overlay mode.

Comments ? Volunteers ?

Of course I know that some proposed things are not possible without a great
effort (so probably it's not worth the case), but for the moment I'd like to
share these ideas ...


What do you think ?

Bye,
Sandro


--
View this message in context: http://apache-pivot-developers.417237.n3.nabble.com/Pivot-Shell-tp3313582p3313582.html
Sent from the Apache Pivot - Developers mailing list archive at Nabble.com.

Re: Pivot-Shell

Posted by Sandro Martini <sa...@gmail.com>.
Hi Chris,
some comments ...

>I like the general idea of providing some tooling to help with Pivot
development, but what about writing tools as Pivot apps, so that they could
also be used as reference applications?
Yes, and up to 1.5.2 there was the Tools subproject, but has been dropped
... and to me seem that some (development only) Tools could be useful to
have.

>Pivot is a UI toolkit so I think it would make more sense to use it to
provide non-CLI tools if they make sense.
Yes, but for example even to execute (as Standalone Applications) already
packaged Demos is not so trivial (but this is a problem in general of Java
deploy, not so friendly), so at least my proposal to have a startup script
to set the right environment, and later have even some utility class to give
some hint.
A similar approach (even for a GUI framework) for example is in Griffon
(another great framework), that a look here:
http://griffon.codehaus.org/Quick+Start

Another very useful feature there (and the same in Grails, Play, etc) is to
give some hint to the user, on parameters for commands, similar commands,
etc. but could be too much for us at the moment.

I agree that this is more for developers than final Users, but things can be
generalized (a little, without spending too much time on it) even for them.


>There is a lot of very useful example code that many people might not be
aware of unless they download and use the Pivot source release, or checkout
from SVN.
Yes, I agree.


>A while ago I thought about creating a simple Pivot app to launch demos and
tutorials so that people could
>
>It would just present the available demos/apps in a searchable way and
allow the user to double click to launch as a desktop (or script)
application.  There would be a link to where the source code could be
found (package & class names/svn directory/website url/whatever).  It could
even show the BXML & resource files, and show a screenshot of the running
app/demo.
Good, but without a script to setup classpath etc it would not so simple to
run.
>
>My initial plan was for the app to scan jar files to find classes that
implement Application, and find BXML files whose root node was a Window
subclass that implements Bindable.  But if that information could also be
extracted as part of the build process and bundled with the release (either
in the same jars as the demos/tutorials, or in its own jar/json/xml file).
This is exactly my proposal for some utility class inside the pivot-shell
(new, dedicated and simple jar), scan candidates (and maybe cache them in a
file under the user profile, or already inside the jar, it's a detail).
And maybe start with an overlay zip to unzip over Pivot binary distribution,
so no change in existing things for the moment. Initial plan could be to
start this as project inside one of our Apache-Extras, and see later, ok ?
And put even this in the infinite TODO list :-) .

As always comments, suggestions, etc are welcome ...

Bye,
Sandro


--
View this message in context: http://apache-pivot-developers.417237.n3.nabble.com/Pivot-Shell-tp3313582p3316511.html
Sent from the Apache Pivot - Developers mailing list archive at Nabble.com.

Re: Pivot-Shell

Posted by Chris Bartlett <cb...@gmail.com>.
I like the general idea of providing some tooling to help with Pivot
development, but what about writing tools as Pivot apps, so that they
could also be used as reference applications?

Pivot is a UI toolkit so I think it would make more sense to use it to
provide non-CLI tools if they make sense.

On 6 September 2011 20:49, Sandro Martini <sa...@gmail.com> wrote:
> ... and for example to run Tutorials and Demos as Standalone applications
> without having to deploy pivot wars in a local Tomcat.
> So for example the run application command could propose a list of candidate
> classes (maybe with the name without the default Pivot package for them, if
> unique).

There is a lot of very useful example code that many people might not
be aware of unless they download and use the Pivot source release, or
checkout from SVN.

A while ago I thought about creating a simple Pivot app to launch
demos and tutorials so that people could

It would just present the available demos/apps in a searchable way and
allow the user to double click to launch as a desktop (or script)
application.  There would be a link to where the source code could be
found (package & class names/svn directory/website url/whatever).  It
could even show the BXML & resource files, and show a screenshot of
the running app/demo.

My initial plan was for the app to scan jar files to find classes that
implement Application, and find BXML files whose root node was a
Window subclass that implements Bindable.  But if that information
could also be extracted as part of the build process and bundled with
the release (either in the same jars as the demos/tutorials, or in its
own jar/json/xml file).

Chris

SV: SV: Pivot-Shell

Posted by Edvin Syse <es...@syse.no>.
> It is a nice idea, and sounds like it would be a good demo of using Pivot as
> something more than a simple applet or a desktop application.
> Let us know if you need help with anything.

I will, thank you :)

Re: SV: Pivot-Shell

Posted by Chris Bartlett <cb...@gmail.com>.
It is a nice idea, and sounds like it would be a good demo of using
Pivot as something more than a simple applet or a desktop application.
Let us know if you need help with anything.

On 7 September 2011 18:41, Edvin Syse <es...@syse.no> wrote:
>> "PivotPad" seem interesting ... do you think it will be possible to have it
>> inside one of ore Apache-Extras projects ?
>
> Absolutely. I will get it up and running, get some feedback from you guys, and then we can decide if it should live in Apache-Extras or something :) I would like to provide hosting for this, so each user don't need to set it up, just use the app provided at pivotpad.com or something, so the code wouldn't be that interesting, but still..
>

SV: SV: Pivot-Shell

Posted by Edvin Syse <es...@syse.no>.
> "PivotPad" seem interesting ... do you think it will be possible to have it
> inside one of ore Apache-Extras projects ?

Absolutely. I will get it up and running, get some feedback from you guys, and then we can decide if it should live in Apache-Extras or something :) I would like to provide hosting for this, so each user don't need to set it up, just use the app provided at pivotpad.com or something, so the code wouldn't be that interesting, but still.. 

Re: SV: Pivot-Shell

Posted by Chris Bartlett <cb...@gmail.com>.
On 7 September 2011 17:58, Sandro Martini <sa...@gmail.com> wrote:
> @Chris:
> I need some time to read (in detail) your post, and to write a response :-)
> ... this afternoon.
> And I have other (crazy) ideas, I only have to find some time to write ...

No problem.  I have too many ideas and not enough time to make them
into something real.

My post really comes down to this.
1) Pivot tools are good
2) Build the the tools with Pivot if it makes sense - but if a CLI
interface/shell is better then that is fine too.

Re: SV: Pivot-Shell

Posted by Sandro Martini <sa...@gmail.com>.
Hi Edvin,
"PivotPad" seem interesting ... do you think it will be possible to have it
inside one of ore Apache-Extras projects ? 
If wanted, you could publish is as a subproject in one (I granted to you
commit in some of them) ... the mission of Apache-Extras is to try to join
forces and expand (in our case) Pivot-related things, so for example this
could be another interesting thing.


@Chris:
I need some time to read (in detail) your post, and to write a response :-)
... this afternoon.
And I have other (crazy) ideas, I only have to find some time to write ...

Bye


--
View this message in context: http://apache-pivot-developers.417237.n3.nabble.com/Pivot-Shell-tp3313582p3316306.html
Sent from the Apache Pivot - Developers mailing list archive at Nabble.com.

SV: Pivot-Shell

Posted by Edvin Syse <es...@syse.no>.
I just want to mention that I've started working on something I call "PivotPad" for now. It's basically an applet running Pivot that let's you quickstart new Pivot-projects (mavenized), edit them online, and run them in the same jvm you're using for the editor-app. Each project will have a link, both to the source code repo and to run the application as an applet or webstart app (autocreated self-signed cert per user etc), so that it is very easy to show a problem/bug and the code at the same time. Other users can create an account and fork projects and stuff like that. A download-link will give you a zip-file containing the mavenized project, or even a non-mavenized project containing the dependencies if needed.

Obviously not the same thing you're talking about, just wanted to mention it :)

-- Edvin