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 2010/11/24 02:30:48 UTC

Little things in Pivot tutorials

Hi, I've found some little things in Tutorials, here some info:

- hello-world.xml
        <p>
            The application class name is specified as the first argument to the
            <tt>DesktopApplicationContext</tt> loader application. The
sample <tt>HelloJava</tt>
            application also defines a convenience <tt>main()</tt>
method that delegates to
            <tt>DesktopApplicationContext.main()</tt>, allowing it to
be bundled in an executable
            JARs and more easily launched from within an IDE. Defining
such a convenience method
            is common practice in Pivot development.
        </p>
But in the HelloJava sample (inside the page, and in the .java source)
the main method has been removed some time ago if I remember well ...


- hello-bxml
Is there a way to write in page a title when bxml files are shown (for
example for hello.bxml and hello_javascript.bxml) ?
Otherwise could not be clear (for example to Pivot newbies) what is
the file name listed ... for Java sources is implicit, but for others
not.
Of course this could be applied event to any other place of
documentation where bxml files are shown.

And, in this section:
        <p>
            Most Pivot applications will be constructed this way,
declaring the structure of the
            UI in BXML rather than creating it programmatically in
code. However, event handlers,
            which allow an application to respond to user input, are
always defined in code (either
            Java or a compatible JVM scripting language). For example,
the following BXML produces
            output very similar to the previous two versions, using a
combination of BXML and
            JavaScript:
        </p>
I think it will be more clear (again, to newbies) that the following
part is related to something like an "All BXML" solution, for example
splitting the previous paragraph, and add a little spacing and a title
before the last section ... I hope to be clear, if not tell me :-) .


- stock-tracker.ui.xml
        <h3>The Bindable Interface</h3>
Here there isn't a sample (BXML side, but aligned with the Java code
shown) of how to define elements inside BXML to be binded by code.
And I'd add a little more space just before the last part on
initialize() ... to better shown that's another section here.

            including JavaScript, Groovy, adnd Clojure, among others.
Any attribute value preceded by
a type error ...
            initialization paramters for class instances declared as
elements. Script code can
a type error ...


- stock-tracker.ui.xml
References to "@" symbols are still valid ?
Sorry, but if I remember well something on symbols have been removed
some time ago ... but I could be wrong.


- stock-tracker.events.xml
The isn't a sample to explain how to link Actions from inside BXML files.


And a last question, not related to documentation:
in many samples I've seen that if we'd have an abstract class
(implementing Application, and with a default implementation of all
their methods) containing some common stuff (like a bindable Window,
and some commonly-used global variables like BXMLSerializer,
JSONSerializer, Resources, Locale, etc ...) maybe we could simplify
some tutorials and demos ... what do you think ? Or maybe if not for
Pivot itself, for one it its extensions ?



For now its all.
A great work has been done for the 2.0, these are only refinements :-)


Bye,
Sandro

Re: Little things in Pivot tutorials

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

>>
>> Running latest Tutorials from Pivot-2.0 pre-release, from here: http://ixnay.biz/pivot-tutorials/
>> ...
>>
>> Important: running Tutorials I always get a (very annoying) Startup dialog
>> from Java, asking me if block the Applet (default Yes = block), because it
>> contains a mix of signed and unsigned code ... do you see this ?
>> I think this will not be a good "experience" for users, so maybe for Applets
>> we should choose if all unsigned or all signed jars ...
>
> No, I don't see this warning.
At Home (Windows 7) I don't see this behavior, while at work (in a
Windows XP Sp3 environment, but where the PC is in a Windows Domain
with polices, etc) I see it ... on both PC I have the latest Java 6
Update 22 JRE ... strange.

In any case, the important is that the annoying dialog box from Java
(Mixed mode code, and by default now the selected choice is to block
the Applet) doesn't happen always (or better, always in all
environments), so from my point of view we are Ok here.
In someone sees it (even on other platforms), please tell me so we can
write some more info, at least to tell users what to do ...

Bye,
Sandro

Re: Little things in Pivot tutorials

Posted by Greg Brown <gk...@mac.com>.
No, I don't see this warning.

On Nov 26, 2010, at 8:59 AM, Sandro Martini wrote:

> 
>> I have not seen this error. The demos and tutorials should either be using
> all signed or all unsigned JARs, so I'm not sure what might be causing it.
> Can you try to narrow it down?
> Ok, in next days I'll start to look at it, but is one thing that needs many
> investigations (and time), but for user experience is important, so I'll put
> this on top of my priorities for Pivot, and tell you some update.
> 
> Only one question, trying latest Tutorials from your site, with the Mac, do
> you see this warning (from Java) ?
> And last, what other say (someone other has seen this) ?
> 
> Thank you very much.
> 
> Bye
> 
> -- 
> View this message in context: http://apache-pivot-developers.417237.n3.nabble.com/Little-things-in-Pivot-tutorials-tp1958043p1972846.html
> Sent from the Apache Pivot - Developers mailing list archive at Nabble.com.


Re: Little things in Pivot tutorials

Posted by Sandro Martini <sa...@gmail.com>.
> I have not seen this error. The demos and tutorials should either be using
all signed or all unsigned JARs, so I'm not sure what might be causing it.
Can you try to narrow it down?
Ok, in next days I'll start to look at it, but is one thing that needs many
investigations (and time), but for user experience is important, so I'll put
this on top of my priorities for Pivot, and tell you some update.

Only one question, trying latest Tutorials from your site, with the Mac, do
you see this warning (from Java) ?
And last, what other say (someone other has seen this) ?

Thank you very much.

Bye

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

Re: Little things in Pivot tutorials

Posted by Greg Brown <gk...@mac.com>.
> Important: running Tutorials I always get a (very annoying) Startup dialog
> from Java, asking me if block the Applet (default Yes = block), because it
> contains a mix of signed and unsigned code ... do you see this ?

I have not seen this error. The demos and tutorials should either be using all signed or all unsigned JARs, so I'm not sure what might be causing it. Can you try to narrow it down?



Re: Little things in Pivot tutorials

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

>>>> - hello-world.xml
>>> ...
>
>I'm pretty sure I have removed most of these references - are you still
seeing some?
In updated pre-release tutorials here ( http://ixnay.biz/pivot-tutorials/ )
now it's Ok.

Important: running Tutorials I always get a (very annoying) Startup dialog
from Java, asking me if block the Applet (default Yes = block), because it
contains a mix of signed and unsigned code ... do you see this ?
I think this will not be a good "experience" for users, so maybe for Applets
we should choose if all unsigned or all signed jars ...


>>>> - hello-bxml 
>>> ...
>
> It is possible - I believe the source XML contains the name of the file. 
>We'd just need to update the XSLT to add it to the HTML output. 
>Feel free to look into this if you are interested. 
Looking better, I see that some bxml file has an html comment at the top
with the name of the file, while others not. This evening 'll try to look at
it ... I have little experience with XSLT, but I can try to see, and tell
you what I have found.


>>>> - stock-tracker.events.xml
> ...
>
>I really don't think it is that big a deal, but feel free to add this if
you like.
Ok, I'll try to look at it ...


>>> Are you suggesting that we create a common default implementation of the
>> Application interface that we can use throughout the tutorial?
>> Yes, and maybe not only in tutorials ... 
>
>I have considered this at various times, but there just doesn't seem to be
that much commonality across our various demo and tutorial applications. 
I understand, so we could put (later, if/when it's the time) a class like
this in one of our pivot-related subprojects on Google Code ...

Bye

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

Re: Little things in Pivot tutorials

Posted by Greg Brown <gk...@mac.com>.
>>> - hello-world.xml
>> ...
>> I removed the reference to the convenience main() method, since this
> approach is no longer used as pervasively as it used to be.
> Ok, so probably also in the doc the references to main() should be removed
> too (or changing a little the paragraph to explaining that in code those
> part has been removed because ...), right ?

I'm pretty sure I have removed most of these references - are you still seeing some?

>>> - hello-bxml
>>> Is there a way to write in page a title when bxml files are shown (for
>>> example for hello.bxml and hello_javascript.bxml) ?
>> 
>> In these cases, I think that the name of the file isn't all that relevant -
> the content of the example is what is important.
> Yes, but could be useful to simplify users that want to read a tutorial and
> make experiments with code in the same time, so reading the file name of
> bxml files could be useful to know what to open directly in the IDE, all
> here ...

It is possible - I believe the source XML contains the name of the file. We'd just need to update the XSLT to add it to the HTML output. Feel free to look into this if you are interested.

>>> - stock-tracker.events.xml
>>> The isn't a sample to explain how to link Actions from inside BXML files.
>> 
>> That's OK - it is covered in another tutorial.
> Ok, but what do you think to put a line of text there to say something like
> "this is covered in the ... Tutorial" (even without an hyperlink, but just
> as an info).

I really don't think it is that big a deal, but feel free to add this if you like.

>>> And a last question, not related to documentation:
>>> in many samples I've seen that if we'd have an abstract class
>>> (implementing Application, and with a default implementation of all
>>> their methods) containing some common stuff (like a bindable Window,
>>> and some commonly-used global variables like BXMLSerializer,
>>> JSONSerializer, Resources, Locale, etc ...) maybe we could simplify
>>> some tutorials and demos ... what do you think ? Or maybe if not for
>>> Pivot itself, for one it its extensions ?
>> 
>> Are you suggesting that we create a common default implementation of the
> Application interface that we can use throughout the tutorial? 
> Yes, and maybe not only in tutorials ...

I have considered this at various times, but there just doesn't seem to be that much commonality across our various demo and tutorial applications.


Re: Little things in Pivot tutorials

Posted by Sandro Martini <sa...@gmail.com>.
Hi Greg,

>> - hello-world.xml
>...
>I removed the reference to the convenience main() method, since this
approach is no longer used as pervasively as it used to be.
Ok, so probably also in the doc the references to main() should be removed
too (or changing a little the paragraph to explaining that in code those
part has been removed because ...), right ?

>> - hello-bxml
>> Is there a way to write in page a title when bxml files are shown (for
>> example for hello.bxml and hello_javascript.bxml) ?
>
>In these cases, I think that the name of the file isn't all that relevant -
the content of the example is what is important.
Yes, but could be useful to simplify users that want to read a tutorial and
make experiments with code in the same time, so reading the file name of
bxml files could be useful to know what to open directly in the IDE, all
here ...

>> - stock-tracker.ui.xml
>> References to "@" symbols are still valid ?
>
>Yes - that's how we convert attribute values to URLs that are relative to
the current document.
Ok, I was confused by the removing of relative path in other places (now "/"
is mandatory in some places), and maybe some reference to it (but in other
parts of tutorials) should be updated (but probably this is already Ok).

>> - stock-tracker.events.xml
>> The isn't a sample to explain how to link Actions from inside BXML files.
>
>That's OK - it is covered in another tutorial.
Ok, but what do you think to put a line of text there to say something like
"this is covered in the ... Tutorial" (even without an hyperlink, but just
as an info).

>> And a last question, not related to documentation:
>> in many samples I've seen that if we'd have an abstract class
>> (implementing Application, and with a default implementation of all
>> their methods) containing some common stuff (like a bindable Window,
>> and some commonly-used global variables like BXMLSerializer,
>> JSONSerializer, Resources, Locale, etc ...) maybe we could simplify
>> some tutorials and demos ... what do you think ? Or maybe if not for
>> Pivot itself, for one it its extensions ?
>
>Are you suggesting that we create a common default implementation of the
Application interface that we can use throughout the tutorial? 
Yes, and maybe not only in tutorials ...
>At this point, that probably isn't necessary, since most of the tutorials
have been updated to use ScriptApplication as a launcher.
Ok, but could be useful when (for many reasons) the launcher is not
ScriptApplication.

Thank you very much (even for other fixes),
Sandro


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

Re: Little things in Pivot tutorials

Posted by Greg Brown <gk...@mac.com>.
> - hello-world.xml
> ...The sample <tt>HelloJava</tt>
>            application also defines a convenience <tt>main()</tt>
> method that delegates to
>            <tt>DesktopApplicationContext.main()</tt>, allowing it to
> be bundled in an executable
>            JARs and more easily launched from within an IDE. Defining
> such a convenience method
>            is common practice in Pivot development.
>        </p>
> But in the HelloJava sample (inside the page, and in the .java source)
> the main method has been removed some time ago if I remember well ...

I removed the reference to the convenience main() method, since this approach is no longer used as pervasively as it used to be.

> - hello-bxml
> Is there a way to write in page a title when bxml files are shown (for
> example for hello.bxml and hello_javascript.bxml) ?

In these cases, I think that the name of the file isn't all that relevant - the content of the example is what is important.

> And, in this section:
>        <p>
>            Most Pivot applications will be constructed this way,
> declaring the structure of the
>            UI in BXML rather than creating it programmatically in
> code. However, event handlers,
>            which allow an application to respond to user input, are
> always defined in code (either
>            Java or a compatible JVM scripting language). For example,
> the following BXML produces
>            output very similar to the previous two versions, using a
> combination of BXML and
>            JavaScript:
>        </p>
> I think it will be more clear (again, to newbies) that the following
> part is related to something like an "All BXML" solution, for example
> splitting the previous paragraph, and add a little spacing and a title
> before the last section ... I hope to be clear, if not tell me :-) .

I think this would be an artificial distinction. Compiled and script code can be freely intermingled in any application (and commonly will be). So I think it is best to leave it as is.

> - stock-tracker.ui.xml
>        <h3>The Bindable Interface</h3>
> Here there isn't a sample (BXML side, but aligned with the Java code
> shown) of how to define elements inside BXML to be binded by code.
> And I'd add a little more space just before the last part on
> initialize() ... to better shown that's another section here.

Done.

>            including JavaScript, Groovy, adnd Clojure, among others.
> Any attribute value preceded by
> a type error ...
>            initialization paramters for class instances declared as
> elements. Script code can
> a type error ...

Fixed - thanks.

> - stock-tracker.ui.xml
> References to "@" symbols are still valid ?

Yes - that's how we convert attribute values to URLs that are relative to the current document.

> - stock-tracker.events.xml
> The isn't a sample to explain how to link Actions from inside BXML files.

That's OK - it is covered in another tutorial.

> And a last question, not related to documentation:
> in many samples I've seen that if we'd have an abstract class
> (implementing Application, and with a default implementation of all
> their methods) containing some common stuff (like a bindable Window,
> and some commonly-used global variables like BXMLSerializer,
> JSONSerializer, Resources, Locale, etc ...) maybe we could simplify
> some tutorials and demos ... what do you think ? Or maybe if not for
> Pivot itself, for one it its extensions ?

Are you suggesting that we create a common default implementation of the Application interface that we can use throughout the tutorial? At this point, that probably isn't necessary, since most of the tutorials have been updated to use ScriptApplication as a launcher.

G