You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Luiz Gustavo <lu...@gmail.com> on 2010/03/26 07:02:50 UTC

Pivot Web Application Example

Hi!

Could anyone post in some place (or send me) some example or reference of a
web application based on Pivot?
All the examples on the project site are desktop based, and it would be nice
to have some clear explanation on how to configure a web based project. For
example: How to organize artifacts in a project and how to configure a web
page to load the components. And, even more, how could I comunicate with EJB
components if I decide to deploy the web application based on Pivot in a
machine, and deploy EJB components in another machine?

Sorry if these sounds like stupid questions or necessities, but since the
tecnology aims to be used in both platforms, web and desktop, its necessary
to show examples in both cases for a fast evaluation.
In my specific case, I have to set up an architecture possibly using Pivot,
and its being difficult to find direct examples for a fast prototype.

Thanks in advance!

Best regards.


Luiz Gustavo S. de Souza
Analista de Sistemas - Desenvolvedor Java

http://luizgustavoss.wordpress.com
http://luizgustavoss.blogspot.com
http://twitter.com/lugustso

Re: Pivot Web Application Example

Posted by Greg Brown <gk...@mac.com>.
Just to try to clarify - applet deployment is different than WAR deployment. WAR libraries go in /WEB-INF/lib. Applet libraries can go anywhere in your web root that is visible to the browser, but I generally use /lib.

You may want to look into Oracle/Sun's best practices for applet deployment. Pivot applications deployed in the browser are simply deployed the same way.

Hope this helps,
G


On Mar 26, 2010, at 10:07 AM, Luiz Gustavo wrote:

> Hi Greg,
> 
> here is an image of the example projects I've made: http://dl.dropbox.com/u/756850/public_imgs/pivot_projects.png
> I created a library of the Pivot jars in eclipse and used it on the application that have the classes and markup files. Additionally I've copied the jars in the web app lib directory, under WEB-INF.
> When I deploy the web app (with the application jar in the lib, too) I have the erros.
> 
> Thanks for the other links!
> 
> 
> Cheers,
> 
> Luiz Gustavo
> 
> 
> 2010/3/26 Greg Brown <gk...@mac.com>
> Where are you putting the Pivot libraries? In the app I am currently working on, I use Pivot on both the client and server. I put the client libraries in a /lib directory in my application's web root, and the server libraries in /WEB-INF/lib.
> 
> On Mar 26, 2010, at 8:37 AM, Luiz Gustavo wrote:
> 
>> Hi Todd, 
>> 
>> thanks for your answer.
>> Following your sugestion, I created two projects. One for the Pivot classes and markups (this is the application jar file) and another project for the web application, that uses the pivot application jar file.
>> The imagens show project details and the main page, that would load the applet. I'm getting errors because the applet isn't able to load the dependencies.
>> Am I missing something?
>> 
>> 
>> Cheers,
>> 
>> Luiz Gustavo
>> 
>> 
>> 2010/3/26 Todd Volkert <tv...@gmail.com>
>> Hi Luiz,
>> 
>> The only real requirement is that your jar files are locatable via HTTP on the same domain as your HTML page containing the applet.  Then, you will generally use Sun's Java Deployment Toolkit (a Javascript file containing cross-browser JS) to detect the user's Java plug-in version and write out the applet tags (or force them to install the Java plug-in).  Examples of this can be found in the online Pivot demos (e.g. http://pivot.apache.org/demos/kitchen-sink.html for a full-screen app, and http://pivot.apache.org/demos/decorators.html for a non-full-screen one).
>> 
>> The only thing that springs to mind with your EJB question is that you might have to sign your jar files to perform cross-domain requests legally from within the applet.
>> 
>> Let me know if you have any questions about the parameters that are being passed to the applet in the examples.
>> 
>> Cheers,
>> -T
>> 
>> 
>> On Fri, Mar 26, 2010 at 2:02 AM, Luiz Gustavo <lu...@gmail.com> wrote:
>> Hi!
>> 
>> Could anyone post in some place (or send me) some example or reference of a web application based on Pivot?
>> All the examples on the project site are desktop based, and it would be nice to have some clear explanation on how to configure a web based project. For example: How to organize artifacts in a project and how to configure a web page to load the components. And, even more, how could I comunicate with EJB components if I decide to deploy the web application based on Pivot in a machine, and deploy EJB components in another machine?
>> 
>> Sorry if these sounds like stupid questions or necessities, but since the tecnology aims to be used in both platforms, web and desktop, its necessary to show examples in both cases for a fast evaluation.
>> In my specific case, I have to set up an architecture possibly using Pivot, and its being difficult to find direct examples for a fast prototype.
>> 
>> Thanks in advance!
>> 
>> Best regards.
>> 
>> 
>> Luiz Gustavo S. de Souza
>> Analista de Sistemas - Desenvolvedor Java
>> 
>> http://luizgustavoss.wordpress.com
>> http://luizgustavoss.blogspot.com
>> http://twitter.com/lugustso
>> 
>> 
>> 
>> 
>> <error.png><pivot_projects.png>
> 
> 
> 
> 
> -- 
> Att,
> 
> Luiz Gustavo S. de Souza
> Analista de Sistemas - Desenvolvedor Java
> 
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso


Re: Displaying multiple form errors

Posted by Greg Brown <gk...@mac.com>.
> Thanks, this looks pretty nice. I think I might be able to provide some feedback using listeners, but it would be nice to see support errors per field in future release to reduce boiler plate code.


This is potentially doable if we add an orientation property to the Form class. That way, you could nest forms inside of other forms and get the highlight behavior on nested fields. You are welcome to file a feature request in JIRA for this if you like - I'd suggest submitting it for v 2.0.

G




Re: Displaying multiple form errors

Posted by Shahzad Bhatti <sb...@peak6.com>.
Thanks, this looks pretty nice. I think I might be able to provide some feedback using listeners, but it would be nice to see support errors per field in future release to reduce boiler plate code.


On 3/26/10 3:19 PM, "Greg Brown" <gk...@mac.com> wrote:

FWIW, the look and feel of the Form class has been significantly improved for Pivot 1.5. Flag messages now appear in a color coded popup that is more strongly visually associated with the flagged field:

http://ixnay.biz/form.png

Messages can also be displayed inline such that they are always visible (i.e. they don't only appear on mouse over). Additionally, the flag icons are now more consistent with their Alert/Prompt equivalents.

G

On Mar 26, 2010, at 6:09 PM, Greg Brown wrote:

> This is unfortunately not supported. The Form container supports one flag per field (where fields are defined by the form's sections). Form has no way of knowing that you have multiple text inputs inside the box pane, so it can't attach a flag to those text inputs. It can only show a flag for the fields it knows about.
>
>
> On Mar 26, 2010, at 6:02 PM, Shahzad Bhatti wrote:
>
>> I am trying to build a form with multiple fields and would like to show all errors when form validation fails. From looking at samples, it looks like we can only have one Form.Flag per box pane such as following snippet from Forms.java
>>
>>       submitButton.getButtonPressListeners().add(new ButtonPressListener() {
>>           @Override
>>           public void buttonPressed(Button button) {
>>               String lastName = lastNameTextInput.getText();
>>               String firstName = firstNameTextInput.getText();
>>
>>               Form.Flag flag = null;
>>               if (lastName.length() == 0
>>                   || firstName.length() == 0) {
>>                   flag = new Form.Flag(MessageType.ERROR, "Name is required.");
>>               }
>>
>>               Form.setFlag(nameBoxPane, flag);
>>
>>               if (flag == null) {
>>                   errorLabel.setText(null);
>>                   Prompt.prompt("Pretending to submit...", window);
>>               } else {
>>                   errorLabel.setText("Some required information is missing.");
>>               }
>>           }
>>       });
>>
>> Is it possible to show error messages next to each field when form validation fails. I would appreciate for any examples. Thanks.
>>
>> ______________________________________________
>>
>> See  http://www.peak6.com/email_disclaimer.php
>> for terms and conditions related to this email
>



Re: Displaying multiple form errors

Posted by Greg Brown <gk...@mac.com>.
FWIW, the look and feel of the Form class has been significantly improved for Pivot 1.5. Flag messages now appear in a color coded popup that is more strongly visually associated with the flagged field:

http://ixnay.biz/form.png

Messages can also be displayed inline such that they are always visible (i.e. they don't only appear on mouse over). Additionally, the flag icons are now more consistent with their Alert/Prompt equivalents.

G

On Mar 26, 2010, at 6:09 PM, Greg Brown wrote:

> This is unfortunately not supported. The Form container supports one flag per field (where fields are defined by the form's sections). Form has no way of knowing that you have multiple text inputs inside the box pane, so it can't attach a flag to those text inputs. It can only show a flag for the fields it knows about.
> 
> 
> On Mar 26, 2010, at 6:02 PM, Shahzad Bhatti wrote:
> 
>> I am trying to build a form with multiple fields and would like to show all errors when form validation fails. From looking at samples, it looks like we can only have one Form.Flag per box pane such as following snippet from Forms.java
>> 
>>       submitButton.getButtonPressListeners().add(new ButtonPressListener() {
>>           @Override
>>           public void buttonPressed(Button button) {
>>               String lastName = lastNameTextInput.getText();
>>               String firstName = firstNameTextInput.getText();
>> 
>>               Form.Flag flag = null;
>>               if (lastName.length() == 0
>>                   || firstName.length() == 0) {
>>                   flag = new Form.Flag(MessageType.ERROR, "Name is required.");
>>               }
>> 
>>               Form.setFlag(nameBoxPane, flag);
>> 
>>               if (flag == null) {
>>                   errorLabel.setText(null);
>>                   Prompt.prompt("Pretending to submit...", window);
>>               } else {
>>                   errorLabel.setText("Some required information is missing.");
>>               }
>>           }
>>       });
>> 
>> Is it possible to show error messages next to each field when form validation fails. I would appreciate for any examples. Thanks.
>> 
>> ______________________________________________
>> 
>> See  http://www.peak6.com/email_disclaimer.php
>> for terms and conditions related to this email
> 


Re: Displaying multiple form errors

Posted by Greg Brown <gk...@mac.com>.
This is unfortunately not supported. The Form container supports one flag per field (where fields are defined by the form's sections). Form has no way of knowing that you have multiple text inputs inside the box pane, so it can't attach a flag to those text inputs. It can only show a flag for the fields it knows about.


On Mar 26, 2010, at 6:02 PM, Shahzad Bhatti wrote:

> I am trying to build a form with multiple fields and would like to show all errors when form validation fails. From looking at samples, it looks like we can only have one Form.Flag per box pane such as following snippet from Forms.java
> 
>        submitButton.getButtonPressListeners().add(new ButtonPressListener() {
>            @Override
>            public void buttonPressed(Button button) {
>                String lastName = lastNameTextInput.getText();
>                String firstName = firstNameTextInput.getText();
> 
>                Form.Flag flag = null;
>                if (lastName.length() == 0
>                    || firstName.length() == 0) {
>                    flag = new Form.Flag(MessageType.ERROR, "Name is required.");
>                }
> 
>                Form.setFlag(nameBoxPane, flag);
> 
>                if (flag == null) {
>                    errorLabel.setText(null);
>                    Prompt.prompt("Pretending to submit...", window);
>                } else {
>                    errorLabel.setText("Some required information is missing.");
>                }
>            }
>        });
> 
> Is it possible to show error messages next to each field when form validation fails. I would appreciate for any examples. Thanks.
> 
> ______________________________________________
> 
> See  http://www.peak6.com/email_disclaimer.php
> for terms and conditions related to this email


Displaying multiple form errors

Posted by Shahzad Bhatti <sb...@peak6.com>.
I am trying to build a form with multiple fields and would like to show all errors when form validation fails. From looking at samples, it looks like we can only have one Form.Flag per box pane such as following snippet from Forms.java

        submitButton.getButtonPressListeners().add(new ButtonPressListener() {
            @Override
            public void buttonPressed(Button button) {
                String lastName = lastNameTextInput.getText();
                String firstName = firstNameTextInput.getText();

                Form.Flag flag = null;
                if (lastName.length() == 0
                    || firstName.length() == 0) {
                    flag = new Form.Flag(MessageType.ERROR, "Name is required.");
                }

                Form.setFlag(nameBoxPane, flag);

                if (flag == null) {
                    errorLabel.setText(null);
                    Prompt.prompt("Pretending to submit...", window);
                } else {
                    errorLabel.setText("Some required information is missing.");
                }
            }
        });

 Is it possible to show error messages next to each field when form validation fails. I would appreciate for any examples. Thanks.

______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email

Re: Managing WTKX files for large applications

Posted by Shahzad Bhatti <sb...@peak6.com>.
Thanks Mike, I think I can use approach this until 1.5 is out.


On 3/26/10 9:56 AM, "Mike Smorul" <ms...@gmail.com> wrote:

I've added additional components/views as separate wtkx files included
in the top level application using includes. Each wtkx file resides in
its own namespace based on the id you assign it in the include.

<wtkx:include wtkx:id="loginDialog" src="loginDialog.xml"/>

When you bind a class, you can reference components in the included
file using the namespace
@WTKX(id = "loginDialog.username")
    private TextInput txtUsername;

in loginDialog.xml
<TextInput wtkx:id="username" />

After the initial include, each dev can pretty much have free reign.
The only obsticle that I've seen so far is that action names are
global (ie, login button called 'login' is global and not
loginDialog.login) This means you will have to have some convention so
you don't step on each others toes. (prefix non-global actions, etc)

-Mike

On Fri, Mar 26, 2010 at 12:49 PM, Shahzad Bhatti <sb...@peak6.com> wrote:
> From looking at the examples and tutorials, I found that most of them deal with combined WTKX files using includes. I think that approach may not scale to large application with a number of developers working on separate pieces. Ideally, I would like to use MVC style design similar to Apple's Cocoa development where Nib files that are equivalent to WTKX files are associated with each View/Controller. For example, I might have a root controller that is responsible for showing initial view (with menus/menu-buttons) and then have different controllers for various views. When user clicks on some action, it would then load the controller and load the view from the WTKX files.  I am curious how other folks actually manage WTKX files for large applications especially when working with multiple developers so that they don't step on each other's work. Thanks.
>
> ______________________________________________
>
> See  http://www.peak6.com/email_disclaimer.php
> for terms and conditions related to this email
>


Re: Managing WTKX files for large applications

Posted by Greg Brown <gk...@mac.com>.
Named actions added to the global action dictionary must be unique - however you can create any number of action instances you like and assign them to member or page variables. Does that help?

On Mar 26, 2010, at 1:24 PM, Mike Smorul wrote:

>> I believe you are referring to WTKX IDs, not action names. If so, this
>> behavior has been corrected for Pivot 1.5:
>>   http://issues.apache.org/jira/browse/PIVOT-428
>> In previous versions, includes would inherit the namespace of the parent
>> WTKX file if the include was not given its own wtkx:id. This wasn't very
>> intuitive. We now define an "inline" attribute for the <wtkx:include>
>> element. If true, the include inherits the parent's namespace; otherwise, it
>> defines its own. The default value is false.
> 
> Sorry, wrong wording, I did mean to say action rather than id. Cool
> feature on the include, that will make it much easier to break up wtkx
> files that are logically in the same namespace.
> 
> Would it be possible to have actions reside within a namespace or have
> some scoping rather than being global? I know this may not be possible
> since all actions have to be defined prior to loading a resource.
> 
> Thanks,
> -Mike


Re: Managing WTKX files for large applications

Posted by Mike Smorul <ms...@gmail.com>.
> I believe you are referring to WTKX IDs, not action names. If so, this
> behavior has been corrected for Pivot 1.5:
>   http://issues.apache.org/jira/browse/PIVOT-428
> In previous versions, includes would inherit the namespace of the parent
> WTKX file if the include was not given its own wtkx:id. This wasn't very
> intuitive. We now define an "inline" attribute for the <wtkx:include>
> element. If true, the include inherits the parent's namespace; otherwise, it
> defines its own. The default value is false.

Sorry, wrong wording, I did mean to say action rather than id. Cool
feature on the include, that will make it much easier to break up wtkx
files that are logically in the same namespace.

Would it be possible to have actions reside within a namespace or have
some scoping rather than being global? I know this may not be possible
since all actions have to be defined prior to loading a resource.

Thanks,
 -Mike

Re: Managing WTKX files for large applications

Posted by Greg Brown <gk...@mac.com>.
> The only obsticle that I've seen so far is that action names are
> global (ie, login button called 'login' is global and not
> loginDialog.login) This means you will have to have some convention so
> you don't step on each others toes. (prefix non-global actions, etc)

I believe you are referring to WTKX IDs, not action names. If so, this behavior has been corrected for Pivot 1.5:

  http://issues.apache.org/jira/browse/PIVOT-428

In previous versions, includes would inherit the namespace of the parent WTKX file if the include was not given its own wtkx:id. This wasn't very intuitive. We now define an "inline" attribute for the <wtkx:include> element. If true, the include inherits the parent's namespace; otherwise, it defines its own. The default value is false.

G


Re: Managing WTKX files for large applications

Posted by Mike Smorul <ms...@gmail.com>.
I've added additional components/views as separate wtkx files included
in the top level application using includes. Each wtkx file resides in
its own namespace based on the id you assign it in the include.

<wtkx:include wtkx:id="loginDialog" src="loginDialog.xml"/>

When you bind a class, you can reference components in the included
file using the namespace
@WTKX(id = "loginDialog.username")
    private TextInput txtUsername;

in loginDialog.xml
<TextInput wtkx:id="username" />

After the initial include, each dev can pretty much have free reign.
The only obsticle that I've seen so far is that action names are
global (ie, login button called 'login' is global and not
loginDialog.login) This means you will have to have some convention so
you don't step on each others toes. (prefix non-global actions, etc)

-Mike

On Fri, Mar 26, 2010 at 12:49 PM, Shahzad Bhatti <sb...@peak6.com> wrote:
> From looking at the examples and tutorials, I found that most of them deal with combined WTKX files using includes. I think that approach may not scale to large application with a number of developers working on separate pieces. Ideally, I would like to use MVC style design similar to Apple's Cocoa development where Nib files that are equivalent to WTKX files are associated with each View/Controller. For example, I might have a root controller that is responsible for showing initial view (with menus/menu-buttons) and then have different controllers for various views. When user clicks on some action, it would then load the controller and load the view from the WTKX files.  I am curious how other folks actually manage WTKX files for large applications especially when working with multiple developers so that they don't step on each other's work. Thanks.
>
> ______________________________________________
>
> See  http://www.peak6.com/email_disclaimer.php
> for terms and conditions related to this email
>

Re: Pivot Web Application Example

Posted by Luiz Gustavo <lu...@gmail.com>.
It's working now =)
The problem was the first '/' in the lib declaration.
Now the application is being lauched, but I still get an error "location is
null". The desktop version is ok.
Now I'm going to investigate this new error (reference problems, maybe).

Thank you all very much for the help!

Cheers,

Luiz Gustavo


2010/3/26 Todd Volkert <tv...@gmail.com>

> From the images you sent, it looks like you're telling your applet to look
> in /lib/, so if the jars are in the same folder as your HTML page, then you
> should remove the "/lib/" from the jar paths.  Can you use Firebug to
> inspect the DOM and see what paths are specified in the applet?
>
> -T
>
>
> On Fri, Mar 26, 2010 at 10:59 AM, Luiz Gustavo <lu...@gmail.com>wrote:
>
>> Hi Todd,
>>
>> my mistake. The lib directory isn't under WEB-INF as I said.
>> It's in the same directory as the index,jsp page, and I can access the jar
>> files when request then in the browser.
>>
>>
>>
>>
>>
>> 2010/3/26 Todd Volkert <tv...@gmail.com>
>>
>>> The applet will make an HTTP request for the jar files, and anything
>>> under the WEB-INF folder isn't publicly accessible via HTTP, so that could
>>> be the problem.  Can you point your browser to the URL of the jars that you
>>> specify in the HTML page and get the jar file in response?
>>>
>>> -T
>>>
>>>
>>> On Fri, Mar 26, 2010 at 10:07 AM, Luiz Gustavo <lu...@gmail.com>wrote:
>>>
>>>> Hi Greg,
>>>>
>>>> here is an image of the example projects I've made:
>>>> http://dl.dropbox.com/u/756850/public_imgs/pivot_projects.png
>>>> I created a library of the Pivot jars in eclipse and used it on the
>>>> application that have the classes and markup files. Additionally I've copied
>>>> the jars in the web app lib directory, under WEB-INF.
>>>> When I deploy the web app (with the application jar in the lib, too) I
>>>> have the erros.
>>>>
>>>> Thanks for the other links!
>>>>
>>>>
>>>> Cheers,
>>>>
>>>> Luiz Gustavo
>>>>
>>>>
>>>> 2010/3/26 Greg Brown <gk...@mac.com>
>>>>
>>>> Where are you putting the Pivot libraries? In the app I am currently
>>>>> working on, I use Pivot on both the client and server. I put the client
>>>>> libraries in a /lib directory in my application's web root, and the server
>>>>> libraries in /WEB-INF/lib.
>>>>>
>>>>> On Mar 26, 2010, at 8:37 AM, Luiz Gustavo wrote:
>>>>>
>>>>> Hi Todd,
>>>>>
>>>>> thanks for your answer.
>>>>> Following your sugestion, I created two projects. One for the Pivot
>>>>> classes and markups (this is the application jar file) and another project
>>>>> for the web application, that uses the pivot application jar file.
>>>>> The imagens show project details and the main page, that would load the
>>>>> applet. I'm getting errors because the applet isn't able to load the
>>>>> dependencies.
>>>>> Am I missing something?
>>>>>
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Luiz Gustavo
>>>>>
>>>>>
>>>>> 2010/3/26 Todd Volkert <tv...@gmail.com>
>>>>>
>>>>>> Hi Luiz,
>>>>>>
>>>>>> The only real requirement is that your jar files are locatable via
>>>>>> HTTP on the same domain as your HTML page containing the applet.  Then, you
>>>>>> will generally use Sun's Java Deployment Toolkit (a Javascript file
>>>>>> containing cross-browser JS) to detect the user's Java plug-in version and
>>>>>> write out the applet tags (or force them to install the Java plug-in).
>>>>>> Examples of this can be found in the online Pivot demos (e.g.
>>>>>> http://pivot.apache.org/demos/kitchen-sink.html for a full-screen
>>>>>> app, and http://pivot.apache.org/demos/decorators.html for a
>>>>>> non-full-screen one).
>>>>>>
>>>>>> The only thing that springs to mind with your EJB question is that you
>>>>>> might have to sign your jar files to perform cross-domain requests legally
>>>>>> from within the applet.
>>>>>>
>>>>>> Let me know if you have any questions about the parameters that are
>>>>>> being passed to the applet in the examples.
>>>>>>
>>>>>> Cheers,
>>>>>> -T
>>>>>>
>>>>>>
>>>>>> On Fri, Mar 26, 2010 at 2:02 AM, Luiz Gustavo <
>>>>>> luizgustavoss@gmail.com> wrote:
>>>>>>
>>>>>>> Hi!
>>>>>>>
>>>>>>> Could anyone post in some place (or send me) some example or
>>>>>>> reference of a web application based on Pivot?
>>>>>>> All the examples on the project site are desktop based, and it would
>>>>>>> be nice to have some clear explanation on how to configure a web based
>>>>>>> project. For example: How to organize artifacts in a project and how to
>>>>>>> configure a web page to load the components. And, even more, how could I
>>>>>>> comunicate with EJB components if I decide to deploy the web application
>>>>>>> based on Pivot in a machine, and deploy EJB components in another machine?
>>>>>>>
>>>>>>> Sorry if these sounds like stupid questions or necessities, but since
>>>>>>> the tecnology aims to be used in both platforms, web and desktop, its
>>>>>>> necessary to show examples in both cases for a fast evaluation.
>>>>>>> In my specific case, I have to set up an architecture possibly using
>>>>>>> Pivot, and its being difficult to find direct examples for a fast prototype.
>>>>>>>
>>>>>>> Thanks in advance!
>>>>>>>
>>>>>>> Best regards.
>>>>>>>
>>>>>>>
>>>>>>> Luiz Gustavo S. de Souza
>>>>>>> Analista de Sistemas - Desenvolvedor Java
>>>>>>>
>>>>>>> http://luizgustavoss.wordpress.com
>>>>>>> http://luizgustavoss.blogspot.com
>>>>>>> http://twitter.com/lugustso
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> <error.png><pivot_projects.png>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Att,
>>>>
>>>>
>>>> Luiz Gustavo S. de Souza
>>>> Analista de Sistemas - Desenvolvedor Java
>>>>
>>>> http://luizgustavoss.wordpress.com
>>>> http://luizgustavoss.blogspot.com
>>>> http://twitter.com/lugustso
>>>>
>>>
>>>
>>
>>
>> --
>> Att,
>>
>> Luiz Gustavo S. de Souza
>> Analista de Sistemas - Desenvolvedor Java
>>
>> http://luizgustavoss.wordpress.com
>> http://luizgustavoss.blogspot.com
>> http://twitter.com/lugustso
>>
>
>


-- 
Att,

Luiz Gustavo S. de Souza
Analista de Sistemas - Desenvolvedor Java

http://luizgustavoss.wordpress.com
http://luizgustavoss.blogspot.com
http://twitter.com/lugustso

Re: Managing WTKX files for large applications

Posted by Shahzad Bhatti <sb...@peak6.com>.
Thanks Greg, can't wait to use 1.5 version.


On 3/26/10 10:07 AM, "Greg Brown" <gk...@mac.com> wrote:

> From looking at the examples and tutorials, I found that most of them deal with combined WTKX files using includes. I think that approach may not scale to large application with a number of developers working on separate pieces.

Actually, WTKX includes are intended to help facilitate division of labor across team members. However, earlier versions of Pivot didn't make this quite as easy as it should have been. The Bindable interface (introduced in Pivot 1.4 but improved for Pivot 1.5) makes it much easier to associate WTKX files with "controller code". I'm using it throughout my current app and it is working great.

The best example of this right now is probably the 1.5 version of Stock Tracker (specifically, StockTrackerWindow):

  http://svn.apache.org/repos/asf/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/

I just recently updated the tutorial docs, but they won't be pushed out to the web site until 1.5 is released. In the meantime, feel free to post any questions here.

> For example, I might have a root controller that is responsible for showing initial view (with menus/menu-buttons) and then have different controllers for various views. When user clicks on some action, it would then load the controller and load the view from the WTKX files.

This isn't something you get "for free" with WTKX includes, but you can easily incorporate it into your app (the Kitchen Sink does something similar). When you need to instantiate your sub-panels, just create a new WTKXSerializer, load your class, and add it to the component hierarchy.



______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email

Re: Managing WTKX files for large applications

Posted by Greg Brown <gk...@mac.com>.
> From looking at the examples and tutorials, I found that most of them deal with combined WTKX files using includes. I think that approach may not scale to large application with a number of developers working on separate pieces.

Actually, WTKX includes are intended to help facilitate division of labor across team members. However, earlier versions of Pivot didn't make this quite as easy as it should have been. The Bindable interface (introduced in Pivot 1.4 but improved for Pivot 1.5) makes it much easier to associate WTKX files with "controller code". I'm using it throughout my current app and it is working great.

The best example of this right now is probably the 1.5 version of Stock Tracker (specifically, StockTrackerWindow):

  http://svn.apache.org/repos/asf/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/

I just recently updated the tutorial docs, but they won't be pushed out to the web site until 1.5 is released. In the meantime, feel free to post any questions here.

> For example, I might have a root controller that is responsible for showing initial view (with menus/menu-buttons) and then have different controllers for various views. When user clicks on some action, it would then load the controller and load the view from the WTKX files.

This isn't something you get "for free" with WTKX includes, but you can easily incorporate it into your app (the Kitchen Sink does something similar). When you need to instantiate your sub-panels, just create a new WTKXSerializer, load your class, and add it to the component hierarchy.


Managing WTKX files for large applications

Posted by Shahzad Bhatti <sb...@peak6.com>.
>From looking at the examples and tutorials, I found that most of them deal with combined WTKX files using includes. I think that approach may not scale to large application with a number of developers working on separate pieces. Ideally, I would like to use MVC style design similar to Apple's Cocoa development where Nib files that are equivalent to WTKX files are associated with each View/Controller. For example, I might have a root controller that is responsible for showing initial view (with menus/menu-buttons) and then have different controllers for various views. When user clicks on some action, it would then load the controller and load the view from the WTKX files.  I am curious how other folks actually manage WTKX files for large applications especially when working with multiple developers so that they don't step on each other's work. Thanks.

______________________________________________

See  http://www.peak6.com/email_disclaimer.php
for terms and conditions related to this email

Re: Pivot Web Application Example

Posted by Todd Volkert <tv...@gmail.com>.
>From the images you sent, it looks like you're telling your applet to look
in /lib/, so if the jars are in the same folder as your HTML page, then you
should remove the "/lib/" from the jar paths.  Can you use Firebug to
inspect the DOM and see what paths are specified in the applet?

-T

On Fri, Mar 26, 2010 at 10:59 AM, Luiz Gustavo <lu...@gmail.com>wrote:

> Hi Todd,
>
> my mistake. The lib directory isn't under WEB-INF as I said.
> It's in the same directory as the index,jsp page, and I can access the jar
> files when request then in the browser.
>
>
>
>
>
> 2010/3/26 Todd Volkert <tv...@gmail.com>
>
>> The applet will make an HTTP request for the jar files, and anything under
>> the WEB-INF folder isn't publicly accessible via HTTP, so that could be the
>> problem.  Can you point your browser to the URL of the jars that you specify
>> in the HTML page and get the jar file in response?
>>
>> -T
>>
>>
>> On Fri, Mar 26, 2010 at 10:07 AM, Luiz Gustavo <lu...@gmail.com>wrote:
>>
>>> Hi Greg,
>>>
>>> here is an image of the example projects I've made:
>>> http://dl.dropbox.com/u/756850/public_imgs/pivot_projects.png
>>> I created a library of the Pivot jars in eclipse and used it on the
>>> application that have the classes and markup files. Additionally I've copied
>>> the jars in the web app lib directory, under WEB-INF.
>>> When I deploy the web app (with the application jar in the lib, too) I
>>> have the erros.
>>>
>>> Thanks for the other links!
>>>
>>>
>>> Cheers,
>>>
>>> Luiz Gustavo
>>>
>>>
>>> 2010/3/26 Greg Brown <gk...@mac.com>
>>>
>>> Where are you putting the Pivot libraries? In the app I am currently
>>>> working on, I use Pivot on both the client and server. I put the client
>>>> libraries in a /lib directory in my application's web root, and the server
>>>> libraries in /WEB-INF/lib.
>>>>
>>>> On Mar 26, 2010, at 8:37 AM, Luiz Gustavo wrote:
>>>>
>>>> Hi Todd,
>>>>
>>>> thanks for your answer.
>>>> Following your sugestion, I created two projects. One for the Pivot
>>>> classes and markups (this is the application jar file) and another project
>>>> for the web application, that uses the pivot application jar file.
>>>> The imagens show project details and the main page, that would load the
>>>> applet. I'm getting errors because the applet isn't able to load the
>>>> dependencies.
>>>> Am I missing something?
>>>>
>>>>
>>>> Cheers,
>>>>
>>>> Luiz Gustavo
>>>>
>>>>
>>>> 2010/3/26 Todd Volkert <tv...@gmail.com>
>>>>
>>>>> Hi Luiz,
>>>>>
>>>>> The only real requirement is that your jar files are locatable via HTTP
>>>>> on the same domain as your HTML page containing the applet.  Then, you will
>>>>> generally use Sun's Java Deployment Toolkit (a Javascript file containing
>>>>> cross-browser JS) to detect the user's Java plug-in version and write out
>>>>> the applet tags (or force them to install the Java plug-in).  Examples of
>>>>> this can be found in the online Pivot demos (e.g.
>>>>> http://pivot.apache.org/demos/kitchen-sink.html for a full-screen app,
>>>>> and http://pivot.apache.org/demos/decorators.html for a
>>>>> non-full-screen one).
>>>>>
>>>>> The only thing that springs to mind with your EJB question is that you
>>>>> might have to sign your jar files to perform cross-domain requests legally
>>>>> from within the applet.
>>>>>
>>>>> Let me know if you have any questions about the parameters that are
>>>>> being passed to the applet in the examples.
>>>>>
>>>>> Cheers,
>>>>> -T
>>>>>
>>>>>
>>>>> On Fri, Mar 26, 2010 at 2:02 AM, Luiz Gustavo <luizgustavoss@gmail.com
>>>>> > wrote:
>>>>>
>>>>>> Hi!
>>>>>>
>>>>>> Could anyone post in some place (or send me) some example or reference
>>>>>> of a web application based on Pivot?
>>>>>> All the examples on the project site are desktop based, and it would
>>>>>> be nice to have some clear explanation on how to configure a web based
>>>>>> project. For example: How to organize artifacts in a project and how to
>>>>>> configure a web page to load the components. And, even more, how could I
>>>>>> comunicate with EJB components if I decide to deploy the web application
>>>>>> based on Pivot in a machine, and deploy EJB components in another machine?
>>>>>>
>>>>>> Sorry if these sounds like stupid questions or necessities, but since
>>>>>> the tecnology aims to be used in both platforms, web and desktop, its
>>>>>> necessary to show examples in both cases for a fast evaluation.
>>>>>> In my specific case, I have to set up an architecture possibly using
>>>>>> Pivot, and its being difficult to find direct examples for a fast prototype.
>>>>>>
>>>>>> Thanks in advance!
>>>>>>
>>>>>> Best regards.
>>>>>>
>>>>>>
>>>>>> Luiz Gustavo S. de Souza
>>>>>> Analista de Sistemas - Desenvolvedor Java
>>>>>>
>>>>>> http://luizgustavoss.wordpress.com
>>>>>> http://luizgustavoss.blogspot.com
>>>>>> http://twitter.com/lugustso
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> <error.png><pivot_projects.png>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Att,
>>>
>>>
>>> Luiz Gustavo S. de Souza
>>> Analista de Sistemas - Desenvolvedor Java
>>>
>>> http://luizgustavoss.wordpress.com
>>> http://luizgustavoss.blogspot.com
>>> http://twitter.com/lugustso
>>>
>>
>>
>
>
> --
> Att,
>
> Luiz Gustavo S. de Souza
> Analista de Sistemas - Desenvolvedor Java
>
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso
>

Re: Pivot Web Application Example

Posted by Luiz Gustavo <lu...@gmail.com>.
Hi Todd,

my mistake. The lib directory isn't under WEB-INF as I said.
It's in the same directory as the index,jsp page, and I can access the jar
files when request then in the browser.




2010/3/26 Todd Volkert <tv...@gmail.com>

> The applet will make an HTTP request for the jar files, and anything under
> the WEB-INF folder isn't publicly accessible via HTTP, so that could be the
> problem.  Can you point your browser to the URL of the jars that you specify
> in the HTML page and get the jar file in response?
>
> -T
>
>
> On Fri, Mar 26, 2010 at 10:07 AM, Luiz Gustavo <lu...@gmail.com>wrote:
>
>> Hi Greg,
>>
>> here is an image of the example projects I've made:
>> http://dl.dropbox.com/u/756850/public_imgs/pivot_projects.png
>> I created a library of the Pivot jars in eclipse and used it on the
>> application that have the classes and markup files. Additionally I've copied
>> the jars in the web app lib directory, under WEB-INF.
>> When I deploy the web app (with the application jar in the lib, too) I
>> have the erros.
>>
>> Thanks for the other links!
>>
>>
>> Cheers,
>>
>> Luiz Gustavo
>>
>>
>> 2010/3/26 Greg Brown <gk...@mac.com>
>>
>> Where are you putting the Pivot libraries? In the app I am currently
>>> working on, I use Pivot on both the client and server. I put the client
>>> libraries in a /lib directory in my application's web root, and the server
>>> libraries in /WEB-INF/lib.
>>>
>>> On Mar 26, 2010, at 8:37 AM, Luiz Gustavo wrote:
>>>
>>> Hi Todd,
>>>
>>> thanks for your answer.
>>> Following your sugestion, I created two projects. One for the Pivot
>>> classes and markups (this is the application jar file) and another project
>>> for the web application, that uses the pivot application jar file.
>>> The imagens show project details and the main page, that would load the
>>> applet. I'm getting errors because the applet isn't able to load the
>>> dependencies.
>>> Am I missing something?
>>>
>>>
>>> Cheers,
>>>
>>> Luiz Gustavo
>>>
>>>
>>> 2010/3/26 Todd Volkert <tv...@gmail.com>
>>>
>>>> Hi Luiz,
>>>>
>>>> The only real requirement is that your jar files are locatable via HTTP
>>>> on the same domain as your HTML page containing the applet.  Then, you will
>>>> generally use Sun's Java Deployment Toolkit (a Javascript file containing
>>>> cross-browser JS) to detect the user's Java plug-in version and write out
>>>> the applet tags (or force them to install the Java plug-in).  Examples of
>>>> this can be found in the online Pivot demos (e.g.
>>>> http://pivot.apache.org/demos/kitchen-sink.html for a full-screen app,
>>>> and http://pivot.apache.org/demos/decorators.html for a non-full-screen
>>>> one).
>>>>
>>>> The only thing that springs to mind with your EJB question is that you
>>>> might have to sign your jar files to perform cross-domain requests legally
>>>> from within the applet.
>>>>
>>>> Let me know if you have any questions about the parameters that are
>>>> being passed to the applet in the examples.
>>>>
>>>> Cheers,
>>>> -T
>>>>
>>>>
>>>> On Fri, Mar 26, 2010 at 2:02 AM, Luiz Gustavo <lu...@gmail.com>wrote:
>>>>
>>>>> Hi!
>>>>>
>>>>> Could anyone post in some place (or send me) some example or reference
>>>>> of a web application based on Pivot?
>>>>> All the examples on the project site are desktop based, and it would be
>>>>> nice to have some clear explanation on how to configure a web based project.
>>>>> For example: How to organize artifacts in a project and how to configure a
>>>>> web page to load the components. And, even more, how could I comunicate with
>>>>> EJB components if I decide to deploy the web application based on Pivot in a
>>>>> machine, and deploy EJB components in another machine?
>>>>>
>>>>> Sorry if these sounds like stupid questions or necessities, but since
>>>>> the tecnology aims to be used in both platforms, web and desktop, its
>>>>> necessary to show examples in both cases for a fast evaluation.
>>>>> In my specific case, I have to set up an architecture possibly using
>>>>> Pivot, and its being difficult to find direct examples for a fast prototype.
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> Best regards.
>>>>>
>>>>>
>>>>> Luiz Gustavo S. de Souza
>>>>> Analista de Sistemas - Desenvolvedor Java
>>>>>
>>>>> http://luizgustavoss.wordpress.com
>>>>> http://luizgustavoss.blogspot.com
>>>>> http://twitter.com/lugustso
>>>>>
>>>>
>>>>
>>>
>>>
>>> <error.png><pivot_projects.png>
>>>
>>>
>>>
>>
>>
>> --
>> Att,
>>
>>
>> Luiz Gustavo S. de Souza
>> Analista de Sistemas - Desenvolvedor Java
>>
>> http://luizgustavoss.wordpress.com
>> http://luizgustavoss.blogspot.com
>> http://twitter.com/lugustso
>>
>
>


-- 
Att,

Luiz Gustavo S. de Souza
Analista de Sistemas - Desenvolvedor Java

http://luizgustavoss.wordpress.com
http://luizgustavoss.blogspot.com
http://twitter.com/lugustso

Re: Pivot Web Application Example

Posted by Todd Volkert <tv...@gmail.com>.
The applet will make an HTTP request for the jar files, and anything under
the WEB-INF folder isn't publicly accessible via HTTP, so that could be the
problem.  Can you point your browser to the URL of the jars that you specify
in the HTML page and get the jar file in response?

-T

On Fri, Mar 26, 2010 at 10:07 AM, Luiz Gustavo <lu...@gmail.com>wrote:

> Hi Greg,
>
> here is an image of the example projects I've made:
> http://dl.dropbox.com/u/756850/public_imgs/pivot_projects.png
> I created a library of the Pivot jars in eclipse and used it on the
> application that have the classes and markup files. Additionally I've copied
> the jars in the web app lib directory, under WEB-INF.
> When I deploy the web app (with the application jar in the lib, too) I have
> the erros.
>
> Thanks for the other links!
>
>
> Cheers,
>
> Luiz Gustavo
>
>
> 2010/3/26 Greg Brown <gk...@mac.com>
>
> Where are you putting the Pivot libraries? In the app I am currently
>> working on, I use Pivot on both the client and server. I put the client
>> libraries in a /lib directory in my application's web root, and the server
>> libraries in /WEB-INF/lib.
>>
>> On Mar 26, 2010, at 8:37 AM, Luiz Gustavo wrote:
>>
>> Hi Todd,
>>
>> thanks for your answer.
>> Following your sugestion, I created two projects. One for the Pivot
>> classes and markups (this is the application jar file) and another project
>> for the web application, that uses the pivot application jar file.
>> The imagens show project details and the main page, that would load the
>> applet. I'm getting errors because the applet isn't able to load the
>> dependencies.
>> Am I missing something?
>>
>>
>> Cheers,
>>
>> Luiz Gustavo
>>
>>
>> 2010/3/26 Todd Volkert <tv...@gmail.com>
>>
>>> Hi Luiz,
>>>
>>> The only real requirement is that your jar files are locatable via HTTP
>>> on the same domain as your HTML page containing the applet.  Then, you will
>>> generally use Sun's Java Deployment Toolkit (a Javascript file containing
>>> cross-browser JS) to detect the user's Java plug-in version and write out
>>> the applet tags (or force them to install the Java plug-in).  Examples of
>>> this can be found in the online Pivot demos (e.g.
>>> http://pivot.apache.org/demos/kitchen-sink.html for a full-screen app,
>>> and http://pivot.apache.org/demos/decorators.html for a non-full-screen
>>> one).
>>>
>>> The only thing that springs to mind with your EJB question is that you
>>> might have to sign your jar files to perform cross-domain requests legally
>>> from within the applet.
>>>
>>> Let me know if you have any questions about the parameters that are being
>>> passed to the applet in the examples.
>>>
>>> Cheers,
>>> -T
>>>
>>>
>>> On Fri, Mar 26, 2010 at 2:02 AM, Luiz Gustavo <lu...@gmail.com>wrote:
>>>
>>>> Hi!
>>>>
>>>> Could anyone post in some place (or send me) some example or reference
>>>> of a web application based on Pivot?
>>>> All the examples on the project site are desktop based, and it would be
>>>> nice to have some clear explanation on how to configure a web based project.
>>>> For example: How to organize artifacts in a project and how to configure a
>>>> web page to load the components. And, even more, how could I comunicate with
>>>> EJB components if I decide to deploy the web application based on Pivot in a
>>>> machine, and deploy EJB components in another machine?
>>>>
>>>> Sorry if these sounds like stupid questions or necessities, but since
>>>> the tecnology aims to be used in both platforms, web and desktop, its
>>>> necessary to show examples in both cases for a fast evaluation.
>>>> In my specific case, I have to set up an architecture possibly using
>>>> Pivot, and its being difficult to find direct examples for a fast prototype.
>>>>
>>>> Thanks in advance!
>>>>
>>>> Best regards.
>>>>
>>>>
>>>> Luiz Gustavo S. de Souza
>>>> Analista de Sistemas - Desenvolvedor Java
>>>>
>>>> http://luizgustavoss.wordpress.com
>>>> http://luizgustavoss.blogspot.com
>>>> http://twitter.com/lugustso
>>>>
>>>
>>>
>>
>>
>> <error.png><pivot_projects.png>
>>
>>
>>
>
>
> --
> Att,
>
>
> Luiz Gustavo S. de Souza
> Analista de Sistemas - Desenvolvedor Java
>
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso
>

Re: Pivot Web Application Example

Posted by Luiz Gustavo <lu...@gmail.com>.
Hi Greg,

here is an image of the example projects I've made:
http://dl.dropbox.com/u/756850/public_imgs/pivot_projects.png
I created a library of the Pivot jars in eclipse and used it on the
application that have the classes and markup files. Additionally I've copied
the jars in the web app lib directory, under WEB-INF.
When I deploy the web app (with the application jar in the lib, too) I have
the erros.

Thanks for the other links!


Cheers,

Luiz Gustavo


2010/3/26 Greg Brown <gk...@mac.com>

> Where are you putting the Pivot libraries? In the app I am currently
> working on, I use Pivot on both the client and server. I put the client
> libraries in a /lib directory in my application's web root, and the server
> libraries in /WEB-INF/lib.
>
> On Mar 26, 2010, at 8:37 AM, Luiz Gustavo wrote:
>
> Hi Todd,
>
> thanks for your answer.
> Following your sugestion, I created two projects. One for the Pivot classes
> and markups (this is the application jar file) and another project for the
> web application, that uses the pivot application jar file.
> The imagens show project details and the main page, that would load the
> applet. I'm getting errors because the applet isn't able to load the
> dependencies.
> Am I missing something?
>
>
> Cheers,
>
> Luiz Gustavo
>
>
> 2010/3/26 Todd Volkert <tv...@gmail.com>
>
>> Hi Luiz,
>>
>> The only real requirement is that your jar files are locatable via HTTP on
>> the same domain as your HTML page containing the applet.  Then, you will
>> generally use Sun's Java Deployment Toolkit (a Javascript file containing
>> cross-browser JS) to detect the user's Java plug-in version and write out
>> the applet tags (or force them to install the Java plug-in).  Examples of
>> this can be found in the online Pivot demos (e.g.
>> http://pivot.apache.org/demos/kitchen-sink.html for a full-screen app,
>> and http://pivot.apache.org/demos/decorators.html for a non-full-screen
>> one).
>>
>> The only thing that springs to mind with your EJB question is that you
>> might have to sign your jar files to perform cross-domain requests legally
>> from within the applet.
>>
>> Let me know if you have any questions about the parameters that are being
>> passed to the applet in the examples.
>>
>> Cheers,
>> -T
>>
>>
>> On Fri, Mar 26, 2010 at 2:02 AM, Luiz Gustavo <lu...@gmail.com>wrote:
>>
>>> Hi!
>>>
>>> Could anyone post in some place (or send me) some example or reference of
>>> a web application based on Pivot?
>>> All the examples on the project site are desktop based, and it would be
>>> nice to have some clear explanation on how to configure a web based project.
>>> For example: How to organize artifacts in a project and how to configure a
>>> web page to load the components. And, even more, how could I comunicate with
>>> EJB components if I decide to deploy the web application based on Pivot in a
>>> machine, and deploy EJB components in another machine?
>>>
>>> Sorry if these sounds like stupid questions or necessities, but since the
>>> tecnology aims to be used in both platforms, web and desktop, its necessary
>>> to show examples in both cases for a fast evaluation.
>>> In my specific case, I have to set up an architecture possibly using
>>> Pivot, and its being difficult to find direct examples for a fast prototype.
>>>
>>> Thanks in advance!
>>>
>>> Best regards.
>>>
>>>
>>> Luiz Gustavo S. de Souza
>>> Analista de Sistemas - Desenvolvedor Java
>>>
>>> http://luizgustavoss.wordpress.com
>>> http://luizgustavoss.blogspot.com
>>> http://twitter.com/lugustso
>>>
>>
>>
>
>
> <error.png><pivot_projects.png>
>
>
>


-- 
Att,

Luiz Gustavo S. de Souza
Analista de Sistemas - Desenvolvedor Java

http://luizgustavoss.wordpress.com
http://luizgustavoss.blogspot.com
http://twitter.com/lugustso

Re: Pivot Web Application Example

Posted by Greg Brown <gk...@mac.com>.
Where are you putting the Pivot libraries? In the app I am currently working on, I use Pivot on both the client and server. I put the client libraries in a /lib directory in my application's web root, and the server libraries in /WEB-INF/lib.

On Mar 26, 2010, at 8:37 AM, Luiz Gustavo wrote:

> Hi Todd, 
> 
> thanks for your answer.
> Following your sugestion, I created two projects. One for the Pivot classes and markups (this is the application jar file) and another project for the web application, that uses the pivot application jar file.
> The imagens show project details and the main page, that would load the applet. I'm getting errors because the applet isn't able to load the dependencies.
> Am I missing something?
> 
> 
> Cheers,
> 
> Luiz Gustavo
> 
> 
> 2010/3/26 Todd Volkert <tv...@gmail.com>
> Hi Luiz,
> 
> The only real requirement is that your jar files are locatable via HTTP on the same domain as your HTML page containing the applet.  Then, you will generally use Sun's Java Deployment Toolkit (a Javascript file containing cross-browser JS) to detect the user's Java plug-in version and write out the applet tags (or force them to install the Java plug-in).  Examples of this can be found in the online Pivot demos (e.g. http://pivot.apache.org/demos/kitchen-sink.html for a full-screen app, and http://pivot.apache.org/demos/decorators.html for a non-full-screen one).
> 
> The only thing that springs to mind with your EJB question is that you might have to sign your jar files to perform cross-domain requests legally from within the applet.
> 
> Let me know if you have any questions about the parameters that are being passed to the applet in the examples.
> 
> Cheers,
> -T
> 
> 
> On Fri, Mar 26, 2010 at 2:02 AM, Luiz Gustavo <lu...@gmail.com> wrote:
> Hi!
> 
> Could anyone post in some place (or send me) some example or reference of a web application based on Pivot?
> All the examples on the project site are desktop based, and it would be nice to have some clear explanation on how to configure a web based project. For example: How to organize artifacts in a project and how to configure a web page to load the components. And, even more, how could I comunicate with EJB components if I decide to deploy the web application based on Pivot in a machine, and deploy EJB components in another machine?
> 
> Sorry if these sounds like stupid questions or necessities, but since the tecnology aims to be used in both platforms, web and desktop, its necessary to show examples in both cases for a fast evaluation.
> In my specific case, I have to set up an architecture possibly using Pivot, and its being difficult to find direct examples for a fast prototype.
> 
> Thanks in advance!
> 
> Best regards.
> 
> 
> Luiz Gustavo S. de Souza
> Analista de Sistemas - Desenvolvedor Java
> 
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso
> 
> 
> 
> 
> <error.png><pivot_projects.png>


Re: Pivot Web Application Example

Posted by Luiz Gustavo <lu...@gmail.com>.
Hi Todd,

thanks for your answer.
Following your sugestion, I created two projects. One for the Pivot classes
and markups (this is the application jar file) and another project for the
web application, that uses the pivot application jar file.
The imagens show project details and the main page, that would load the
applet. I'm getting errors because the applet isn't able to load the
dependencies.
Am I missing something?


Cheers,

Luiz Gustavo


2010/3/26 Todd Volkert <tv...@gmail.com>

> Hi Luiz,
>
> The only real requirement is that your jar files are locatable via HTTP on
> the same domain as your HTML page containing the applet.  Then, you will
> generally use Sun's Java Deployment Toolkit (a Javascript file containing
> cross-browser JS) to detect the user's Java plug-in version and write out
> the applet tags (or force them to install the Java plug-in).  Examples of
> this can be found in the online Pivot demos (e.g.
> http://pivot.apache.org/demos/kitchen-sink.html for a full-screen app, and
> http://pivot.apache.org/demos/decorators.html for a non-full-screen one).
>
> The only thing that springs to mind with your EJB question is that you
> might have to sign your jar files to perform cross-domain requests legally
> from within the applet.
>
> Let me know if you have any questions about the parameters that are being
> passed to the applet in the examples.
>
> Cheers,
> -T
>
>
> On Fri, Mar 26, 2010 at 2:02 AM, Luiz Gustavo <lu...@gmail.com>wrote:
>
>> Hi!
>>
>> Could anyone post in some place (or send me) some example or reference of
>> a web application based on Pivot?
>> All the examples on the project site are desktop based, and it would be
>> nice to have some clear explanation on how to configure a web based project.
>> For example: How to organize artifacts in a project and how to configure a
>> web page to load the components. And, even more, how could I comunicate with
>> EJB components if I decide to deploy the web application based on Pivot in a
>> machine, and deploy EJB components in another machine?
>>
>> Sorry if these sounds like stupid questions or necessities, but since the
>> tecnology aims to be used in both platforms, web and desktop, its necessary
>> to show examples in both cases for a fast evaluation.
>> In my specific case, I have to set up an architecture possibly using
>> Pivot, and its being difficult to find direct examples for a fast prototype.
>>
>> Thanks in advance!
>>
>> Best regards.
>>
>>
>> Luiz Gustavo S. de Souza
>> Analista de Sistemas - Desenvolvedor Java
>>
>> http://luizgustavoss.wordpress.com
>> http://luizgustavoss.blogspot.com
>> http://twitter.com/lugustso
>>
>
>

Re: Pivot Web Application Example

Posted by Todd Volkert <tv...@gmail.com>.
Hi Luiz,

The only real requirement is that your jar files are locatable via HTTP on
the same domain as your HTML page containing the applet.  Then, you will
generally use Sun's Java Deployment Toolkit (a Javascript file containing
cross-browser JS) to detect the user's Java plug-in version and write out
the applet tags (or force them to install the Java plug-in).  Examples of
this can be found in the online Pivot demos (e.g.
http://pivot.apache.org/demos/kitchen-sink.html for a full-screen app, and
http://pivot.apache.org/demos/decorators.html for a non-full-screen one).

The only thing that springs to mind with your EJB question is that you might
have to sign your jar files to perform cross-domain requests legally from
within the applet.

Let me know if you have any questions about the parameters that are being
passed to the applet in the examples.

Cheers,
-T

On Fri, Mar 26, 2010 at 2:02 AM, Luiz Gustavo <lu...@gmail.com>wrote:

> Hi!
>
> Could anyone post in some place (or send me) some example or reference of a
> web application based on Pivot?
> All the examples on the project site are desktop based, and it would be
> nice to have some clear explanation on how to configure a web based project.
> For example: How to organize artifacts in a project and how to configure a
> web page to load the components. And, even more, how could I comunicate with
> EJB components if I decide to deploy the web application based on Pivot in a
> machine, and deploy EJB components in another machine?
>
> Sorry if these sounds like stupid questions or necessities, but since the
> tecnology aims to be used in both platforms, web and desktop, its necessary
> to show examples in both cases for a fast evaluation.
> In my specific case, I have to set up an architecture possibly using Pivot,
> and its being difficult to find direct examples for a fast prototype.
>
> Thanks in advance!
>
> Best regards.
>
>
> Luiz Gustavo S. de Souza
> Analista de Sistemas - Desenvolvedor Java
>
> http://luizgustavoss.wordpress.com
> http://luizgustavoss.blogspot.com
> http://twitter.com/lugustso
>

Re: Pivot Web Application Example

Posted by Greg Brown <gk...@mac.com>.
> Could anyone post in some place (or send me) some example or reference of a web application based on Pivot?

With a few minor exceptions, any Pivot application can be run either on the desktop or as an applet. This page shows a number of Pivot applications running as applets:

http://pivot.apache.org/demos/

See the section entitled "The Application Interface" for more information on how this works (note that there is a typo in this version of the tutorial - "applicationClassName" should be "application_class_name"):

http://pivot.apache.org/tutorials/hello-world.html

>  how could I comunicate with EJB components if I decide to deploy the web application based on Pivot in a machine, and deploy EJB components in another machine?

I'm not an EJB expert, but maybe this article would help?

http://www.oracle.com/technology/sample_code/tech/java/codesnippet/ejb/applettoejb/HowTo_Applet_talks_to_Session_bean.html