Re: T5.2.5 Error uploading file using FORM with ID will generate NPE.

2011-06-09 Thread ael
What do you mean i should use the Upload component?

I only based the code based on 
http://tapestry.apache.org/uploading-files.html
http://tapestry.apache.org/uploading-files.html 

Then i modified it based on Multiple FORM design.











public class UploadExample
{
@Property
private UploadedFile file;

@Component(id = "guestForm")
private Form guestForm;

public void onSuccessFromguestForm()
{
File copied = new File("/my/file/location/" +
file.getFileName());

file.write(copied);
}
}




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-2-5-Error-uploading-file-using-FORM-with-ID-will-generate-NPE-tp4474992p4475147.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: T5.2.5 Error uploading file using FORM with ID will generate NPE.

2011-06-09 Thread Thiago H. de Paula Figueiredo

On Thu, 09 Jun 2011 23:45:03 -0300, ael  wrote:


Error uploading file using FORM with ID.
File value is null.
TEMPLATE CLASS





You need to use the Upload component in your template.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: expansions and expresion language

2011-06-09 Thread Thiago H. de Paula Figueiredo
On Thu, 09 Jun 2011 22:50:17 -0300, bogdan_cm   
wrote:



Hi everyone,


Hi!

  I know I found it someplace but for the life of me i cannot find it  
again. There was a reference on how to use expansions, how to invoke  
methods from templates, how to generate numeric intervals in the  
template  and a few

other things. Kind'a like an expression language for Tap.


http://tapestry.apache.org/ -> click "documentation" -> click "property  
expressions".


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



T5.2.5 Error uploading file using FORM with ID will generate NPE.

2011-06-09 Thread ael
Error uploading file using FORM with ID.

File value is null.

TEMPLATE CLASS







PAGE CLASS


@Component(id = "guestForm")
private Form guestForm;

@Property
private UploadedFile file;

public void onSuccessFromguestForm() {

// Set Path
String path = "C:/temp/";
File copied;

// Get File
copied = new File(path + file.getFileName());
}



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-2-5-Error-uploading-file-using-FORM-with-ID-will-generate-NPE-tp4474992p4474992.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



expansions and expresion language

2011-06-09 Thread bogdan_cm
Hi everyone, 
  I know I found it someplace but for the life of me i cannot find it again.
There was a reference on how to use expansions, how to invoke methods from
templates, how to generate numeric intervals in the template  and a few
other things. Kind'a like an expression language for Tap. 

Anyone has a link to such a page?

Thanks very much, 
Bogdan. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/expansions-and-expresion-language-tp4474896p4474896.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: tapestry-security 0.4.0 released!

2011-06-09 Thread Kalle Korhonen
It's stable as in its tested every which way. The only reason 0.4.0 is
carrying a beta tag is that I'm planning on adding a few operations,
and there's a remote possibility that some of the existing signatures
will change. I fully recommend every T5.2 user moving to 0.4.0 as soon
as possible.

Kalle


On Thu, Jun 9, 2011 at 5:56 PM, ael  wrote:
> Wow... Good job...
>
> I can wait for the stable version :)
>
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/tapestry-security-0-4-0-released-tp4459174p4474814.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: tapestry-security 0.4.0 released!

2011-06-09 Thread ael
Wow... Good job...

I can wait for the stable version :) 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/tapestry-security-0-4-0-released-tp4459174p4474814.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: RE : Eclipse IDE and TML code completion

2011-06-09 Thread Mark
TapestryTools is currently being developed as part of GSOS. I don't think
the autocomplete has been implemented yet.

Mark
On Jun 8, 2011 11:34 AM,  wrote:
> Hi
>
> Finally, get it working according to
> http://wiki.apache.org/tapestry/Tapestry5JSPEditorEclipse . I don't
> know why, but
>
> http://tapestrytools.googlecode.com/svn/trunk/TapestryTools_UpdateSite/just 
> doesn't work for me. :(
>
> Thanks
> John
>
>
> 於 2011/6/9 0:10, onj888-tapes...@yahoo.com.hk 提到:
>> thanks Mark and Laurent,
>>
>> So, I used my previous download helios
>> eclipse-reporting-helios-SR1-win32.zip to make another trial, I use the
>> updatesite
>> http://tapestrytools.googlecode.com/svn/trunk/TapestryTools_UpdateSite/
>> to install the tools, change the content type to add *.tml in jsp. I
>> openned the quick-start index.tml with jsp editor, type > ok, but >
>> Thanks
>> John.
>>
>>
>> 於 2011/6/8 22:00, Guerin Laurent 提到:
>>> Mark is right, you have to use the JSP editor.
>>> So, i have tested with Eclipse Helios and it work for me.
>>>
>>> Laurent.
>>>
>>> -Message d'origine-
>>> De : Mark [mailto:mark-li...@xeric.net]
>>> Envoyé : mercredi 8 juin 2011 15:49
>>> À : Tapestry users; onj888-tapes...@yahoo.com.hk
>>> Objet : Re: RE : Eclipse IDE and TML code completion
>>>
>>> On Tue, Jun 7, 2011 at 12:04 AM,  wrote:
 it doesn't response when I type >> Make sure you are using the right editor. I can't remember if it is the
xml editor or the jsp editor that you want, but the other editors won't
work.
>>>
>>> Mark
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>


Re: Tapestry 5.1.10 Links in Chrome and IE9

2011-06-09 Thread Thiago H. de Paula Figueiredo

On Thu, 09 Jun 2011 14:57:39 -0300, Pups  wrote:


Hello everybody,


Hi!


Ok, I'm trying to encode return_url parameter before calling
addParameter("return_url", returnUrl)


You should do that yourself, as the method documentation says: "Adds a  
parameter value. The value will be added, as is, to the URL. In many  
cases, the value should be URL encoded via URLEncoder. Which encoding are  
you using? Out-of-the-box, Tapestry uses UTF-8, so should you.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Tapestry 5.1.10 Links in Chrome and IE9

2011-06-09 Thread Pups
Hello everybody,

Let's me try to describe my issue.
I've some ActionLink on the component and when I click it my Tapestry
application generate some link and return it 
part of code is here

public Object onActionFromAddToBundleCart() throws ShoppingCartException {
...
Link addProductsToCartLink =
pageRenderLinkSource.createPageRenderLinkWithContext(BundleAddToCart.class,
addToCartContext.toArray());
addProductsToCartLink.addParameter("return_url", returnUrl);
return addProductsToCartLink;
}

Page BundleAddToCart works properly. When I use Firefox (any version) I have
link like this

http://myserver/BundleAddToCart/contextItem1/contextItem2/contextItem3/contextItem4?return_url=http://externalserver/somecontext/

And everything works. But when I try to use Google Chrome browser or IE9 I
have some strange behaviour.
I see that tapestry parse all string with pattern "/" and I have incorrect
url parameter message like this "contextItem4?return_url=http:" is
incorrect... 
Ok, I'm trying to encode return_url parameter before calling 
addParameter("return_url", returnUrl)

and as a result I have correct link seemingly...

http://myserver/BundleAddToCart/contextItem1/contextItem2/contextItem3/contextItem4?return_url=http%3A%2F%2Fexternalserver%2Fsomecontext%2F

But when this link doesn't return to Tapestry. In the response header I see
the following 
Connection:close
Content-Length:0
Date:Thu, 09 Jun 2011 17:49:15 GMT
Server:Apache-Coyote/1.1

and in the address bar I see the link like this

http://myserver/BundleAddToCart/contextItem1/contextItem2/contextItem3/contextItem4%3Freturn_url=http%3A%2F%2Fexternalserver%2Fsomecontext%2F

('?' encoded to '%3F' ).

In the IE9 the same behaviour.

One thing I've noticed. This start to occure after I've added to my project
described here 

http://tapestry.1045711.n5.nabble.com/Re-Prototype-IE9-update-td4331824.html

What's wrong? There is my error? Please HELP. I spent 3 days trying to
resolve current issue.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Tapestry-5-1-10-Links-in-Chrome-and-IE9-tp4473624p4473624.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



RE: Image file upload with Easy FCKEditor

2011-06-09 Thread Alex W. Croton
Hi Thiago,

Yes, I have - there's a bit of a oops there ... I forgot one other change that 
I made - that is the local path that the files can be saved to - I have changed 
this in both the SimpleFckEditorPathServiceImpl class and in the 
 section of the Pom file.

Other than that, the details are the same.

I am running Jetty from the command line, and I have tested that I can read and 
write files and folders in the directory that I created (I am presuming that on 
Windows XP Jetty is not changing the user id that it is running under).

Regards,

Alex C

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] 
Sent: 09 June 2011 17:44
To: Tapestry users
Subject: Re: Image file upload with Easy FCKEditor

On Thu, 09 Jun 2011 13:25:47 -0300, Alex W. Croton  
wrote:

> Hi All,

Hi!

> In Firefox, I get a dialog box informing me that I have chosen to open 
> upload.php - and what do I want to do with it? Selecting Cancel, I'm 
> back to the Image Properties box, and can close it.

Have you followed the steps in
http://t5-easy-fckeditor.kenai.com/FileUploads.html? If yes, it looks like a 
bug to me.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Swf asset in jar root directory

2011-06-09 Thread leandroaispuru
Thank you for your reply Christian.



2011/6/9 Christian Riedel 

> It's right there: http://tapestry.apache.org/assets.html
>
> > Assets in Templates
> > Assets can also be referenced directly in templates. Two binding
> prefixes[1] exist for this: "asset:" and "context:". The "asset:" prefix can
> obtain assets from the classpath (the default) or from the web context (by
> specifying the "context:" domain explicitly):
>
> [1]
> http://tapestry.apache.org/component-parameters.html#ComponentParameters-bindingexpressions
>
> Cheers
> Christian
>
> :-)
>
>
> Am 09.06.2011 um 17:41 schrieb leandroaisp...@gmail.com:
>
> > Sorry... a friend tells me about the "classpath" prefix.
> > Now i have it working.
> >
> > I can't find that in Tapestry Asset Documentation. I think it must be in
> > some place where i didn't search.
> >
> > Thanks again.
> >
> > 2011/6/9 
> >
> >> Hi,
> >> I'm having a problem including an asset from the root dir of a jar.
> >> I have two projects.
> >>
> >> projectA --> a web application (war) .
> >>
> >> projectB --> a jar project with pages (An own Tapestry lib).
> >>
> >> ProjectA has projectB.jar in its libs directory.
> >>
> >> ProjectB contains a .swf file that is injected in a page of the same
> >> project.
> >> The problem is that if i use  @Path("/miSwf.swf") tapestry tryes to find
> >> the asset in the folder of the class that is injecting the file.
> >> Is there any way to inject an asset that is in the classpath root
> directory
> >> without relative path??
> >>
> >> I can't use relative path because it is too long and it gives me an
> error.
> >> And i think that using relative path is not the best option because if
> >> tomorrow the class is refactorized and moved to another package it won't
> >> work.
> >>
> >> Thans in advance.
> >>
> >> Leandro.
> >>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Image file upload with Easy FCKEditor

2011-06-09 Thread Thiago H. de Paula Figueiredo
On Thu, 09 Jun 2011 13:25:47 -0300, Alex W. Croton  
 wrote:



Hi All,


Hi!

In Firefox, I get a dialog box informing me that I have chosen to open  
upload.php - and what do I want to do with it? Selecting Cancel, I'm  
back to the Image Properties box, and can close it.


Have you followed the steps in  
http://t5-easy-fckeditor.kenai.com/FileUploads.html? If yes, it looks like  
a bug to me.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Image file upload with Easy FCKEditor

2011-06-09 Thread Alex W. Croton
Hi All,

I posted a question some time ago regarding getting image uploads to work 
correctly with FCKEditor, but was pulled off onto another project and therefore 
unable to follow up, please accept my apologies.

[previous posts on 
http://tapestry.1045711.n5.nabble.com/Image-file-upload-with-Easy-FCKEditor-td3277128.html
 ]

I have revisited this and I am still getting the same problem.

Starting with a clean directory structure and having deleted the Maven .m2 
cache to ensure that I did not pick anything up by mistake, I followed the 
process on http://tapestry.apache.org/creating-the-skeleton-application.html to 
get an up-to-date and clean Pom, and confirm that it worked with Jetty.

I then used the instructions from 
http://t5-easy-fckeditor.kenai.com/Installing.html working from the Installing, 
Getting Started and Supporting File uploads sections (I skipped the Configuring 
section as this seems to only be dealing with the custom JavaScript 
configuration of the editor's look and feel).

The only changes from the detailed instructions given on these web pages were:
A. I used a different groupId and artifactId (and therefore package name) for 
the project
B. I changed the version of the dependency for t5-easy-fckeditor to 1.0.5 as I 
believe that this is the current version

>From my Pom file, 
Tapestry version is 5.2.5
Maven-Jetty-Plugin is 6.1.16
T5-easy-fckeditor is 1.0.5

Java is 1.6.0_21-b06

To replicate the problem, click on the image button, the dialog opens, select 
the Upload tab, browse the local file system and find an image file (I used a 
23k JPG file). Click on Send it to the Server.

In Firefox, I get a dialog box informing me that I have chosen to open 
upload.php - and what do I want to do with it? Selecting Cancel, I'm back to 
the Image Properties box, and can close it.

In IE 8, the Image Properties box displays an animated bar, presumably to 
indicate that the upload is taking place - and then becomes unresponsive (i.e. 
I cannot close the Image Properties box) the only way forward is to close the 
browser.

I'm sure that this is as Ville pointed out back on the previous message thread, 
that FCK Editor is falling back to php as its default backend.

Can anyone help with what I am missing for getting this configuration to work?

Regards,
Alex C


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Swf asset in jar root directory

2011-06-09 Thread Christian Riedel
It's right there: http://tapestry.apache.org/assets.html

> Assets in Templates
> Assets can also be referenced directly in templates. Two binding prefixes[1] 
> exist for this: "asset:" and "context:". The "asset:" prefix can obtain 
> assets from the classpath (the default) or from the web context (by 
> specifying the "context:" domain explicitly):

[1] 
http://tapestry.apache.org/component-parameters.html#ComponentParameters-bindingexpressions

Cheers
Christian

:-)


Am 09.06.2011 um 17:41 schrieb leandroaisp...@gmail.com:

> Sorry... a friend tells me about the "classpath" prefix.
> Now i have it working.
> 
> I can't find that in Tapestry Asset Documentation. I think it must be in
> some place where i didn't search.
> 
> Thanks again.
> 
> 2011/6/9 
> 
>> Hi,
>> I'm having a problem including an asset from the root dir of a jar.
>> I have two projects.
>> 
>> projectA --> a web application (war) .
>> 
>> projectB --> a jar project with pages (An own Tapestry lib).
>> 
>> ProjectA has projectB.jar in its libs directory.
>> 
>> ProjectB contains a .swf file that is injected in a page of the same
>> project.
>> The problem is that if i use  @Path("/miSwf.swf") tapestry tryes to find
>> the asset in the folder of the class that is injecting the file.
>> Is there any way to inject an asset that is in the classpath root directory
>> without relative path??
>> 
>> I can't use relative path because it is too long and it gives me an error.
>> And i think that using relative path is not the best option because if
>> tomorrow the class is refactorized and moved to another package it won't
>> work.
>> 
>> Thans in advance.
>> 
>> Leandro.
>> 


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: BeanEditForm - small problem

2011-06-09 Thread Howard Lewis Ship
Please refer to the FAQ for a description of this problem, and some
solutions.

On Fri, May 20, 2011 at 9:23 AM, toejoe  wrote:
> Thank You for the reply.
>
> However, suggested solution did not work, but your proposal gave me the
> idea. I deleted all constructors from entity class. Bean edit form is now
> working! This is the first time I created entity classes with the wizard.
:(
>
> Cheers
>
> --
> View this message in context:
http://tapestry.1045711.n5.nabble.com/BeanEditForm-small-problem-tp4412666p4412964.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to learn
how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com


Re: T5: property expression language intelligence

2011-06-09 Thread Howard Lewis Ship
I understand where you are coming from, but I can't see this in the core.
Robert identified my thinking at the time I introduced the naming aliases,
and even that's a bit controversial.

On Thu, May 26, 2011 at 3:58 PM, Adam Zimowski  wrote:
> No prob. I'll just hire intern monkeys to do all that unnecessary
> typing for me :-)
>
> Just kidding. Thanks for your feedback.
>
> On Thu, May 26, 2011 at 9:44 AM, Thiago H. de Paula Figueiredo
>  wrote:
>> On Thu, 26 May 2011 11:06:44 -0300, Geoff Callender
>>  wrote:
>>
>>> -1 for me. I can see it causing immense confusion in normal maintenance
>>> work esp. when refactoring.
>>
>> -1 to me. The less to understand, the better.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and
>> instructor
>> Owner, Ars Machina Tecnologia da Informação Ltda.
>> http://www.arsmachina.com.br
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to learn
how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com


Re: Swf asset in jar root directory

2011-06-09 Thread leandroaispuru
Sorry... a friend tells me about the "classpath" prefix.
Now i have it working.

I can't find that in Tapestry Asset Documentation. I think it must be in
some place where i didn't search.

Thanks again.

2011/6/9 

> Hi,
> I'm having a problem including an asset from the root dir of a jar.
> I have two projects.
>
> projectA --> a web application (war) .
>
> projectB --> a jar project with pages (An own Tapestry lib).
>
> ProjectA has projectB.jar in its libs directory.
>
> ProjectB contains a .swf file that is injected in a page of the same
> project.
> The problem is that if i use  @Path("/miSwf.swf") tapestry tryes to find
> the asset in the folder of the class that is injecting the file.
> Is there any way to inject an asset that is in the classpath root directory
> without relative path??
>
> I can't use relative path because it is too long and it gives me an error.
> And i think that using relative path is not the best option because if
> tomorrow the class is refactorized and moved to another package it won't
> work.
>
> Thans in advance.
>
> Leandro.
>


Swf asset in jar root directory

2011-06-09 Thread leandroaispuru
Hi,
I'm having a problem including an asset from the root dir of a jar.
I have two projects.

projectA --> a web application (war) .

projectB --> a jar project with pages (An own Tapestry lib).

ProjectA has projectB.jar in its libs directory.

ProjectB contains a .swf file that is injected in a page of the same
project.
The problem is that if i use  @Path("/miSwf.swf") tapestry tryes to find the
asset in the folder of the class that is injecting the file.
Is there any way to inject an asset that is in the classpath root directory
without relative path??

I can't use relative path because it is too long and it gives me an error.
And i think that using relative path is not the best option because if
tomorrow the class is refactorized and moved to another package it won't
work.

Thans in advance.

Leandro.


Re: let tapestry handle hibernate or use spring ?

2011-06-09 Thread Thiago H. de Paula Figueiredo

On Thu, 09 Jun 2011 02:21:33 -0300,  wrote:


Thanks Thiago, is there anything which is unique in tapestry-hibernate?
I means, something I have to give up if I go for spring?


Tapestry-Hibernate creates creation of ValueEncoders for mapped entity  
classes automatically. I can't recall anything else, besides the easier  
configuration and not using Spring . . .


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Issue in implementing multiple select dropdown twice in a form

2011-06-09 Thread nazarhussain_s
Hi,
  If I am implementing multiple select twice in a form, I am facing an
issue.I am currently following Tapestry in Action - pg 145 example for
multiple select. If I am trying to implement the example in the way given
below i am getting ambiguous output.Anybody help out regarding that.


Home.html
---





Select toppings:

  

  



Select breads:

  

  







 # Return to Home page .






Home.page
---







Home.java
--
package com.tapestry;

import org.apache.tapestry.event.PageBeginRenderListener;
import org.apache.tapestry.event.PageEvent;
import org.apache.tapestry.html.BasePage;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.apache.tapestry.IRequestCycle;

public abstract class Home extends BasePage implements
PageBeginRenderListener{

private static String[] TOPPINGS
={"Lettuce","Tomato","Onions","Pickles","Relish","Mustard","Ketchup"};
private static String[] BREADS 
={"Grains","Oat","Honey","Italian","Mexican","Whole Wheat"};



public String[] getAllToppings(){
return TOPPINGS;
}

public abstract String getTopping();
public abstract void setSelectedToppings(ArrayList toppings);
public abstract ArrayList getSelectedToppings();

public boolean isToppingSelected(){
return getSelectedToppings().contains(getTopping());
}

public void setToppingSelected(boolean toppingSelected){
if(toppingSelected){
System.out.println("\nbefore adding"+getTopping());
getSelectedToppings().add(getTopping());
}

else{
System.out.println("\nbefore removing"+getTopping());
getSelectedToppings().remove(getTopping());
}

}

 public void selectToppings(IRequestCycle cycle){
 String toppings = getToppingsList();
 ToppingsResult page = (ToppingsResult)cycle.getPage("ToppingsResult");
 page.setToppings(toppings);
 cycle.activate(page);
 }

private String getToppingsList() {
if(getSelectedToppings().isEmpty())
return "No Toppings";

StringBuffer buffer = new StringBuffer();
int count  = getSelectedToppings().size();

int x=0;

Iterator i = getSelectedToppings().iterator();

while(i.hasNext()){
if(++x > 1){
if(x == count)
buffer.append(" and ");
else
buffer.append(", ");

}

String topping = (String)i.next();
System.out.println("\n topping iterator has "+topping);
buffer.append(topping);
}
 
buffer.append(".");

return buffer.toString();

}


public String[] getAllBreads(){
return BREADS;
}

public abstract String getBread();
public abstract void setSelectedBreads(ArrayList breads);
public abstract ArrayList getSelectedBreads();

public boolean isBreadSelected(){
return getSelectedBreads().contains(getBread());
}

public void setBreadSelected(boolean breadSelected){
if(breadSelected){
getSelectedBreads().add(getBread());
}
else{
getSelectedBreads().remove(getBread());
}

}

 public void selectBreads(IRequestCycle cycle){
 String breads = getBreadsList();
 ToppingsResult page = (ToppingsResult)cycle.getPage("ToppingsResult");
 page.setToppings(breads);
 cycle.activate(page);
 }

private String getBreadsList() {
if(getSelectedBreads().isEmpty())
return "No Breads";

StringBuffer buffer = new StringBuffer();
int count  = getSelectedBreads().size();

int x=0;

Iterator i = getSelectedBreads().iterator();

while(i.hasNext()){
if(++x > 1){
if(x == count)
buffer.append(" a

Re: T5 Using DAO within a DAO causes NPE.

2011-06-09 Thread kristian marinkovic
i also prefer constructor injection over anything else :)

On Thu, Jun 9, 2011 at 8:05 AM, Taha Hafeez wrote:

> Yes, but wherever possible I find it a better option as using constructor
> injection ensures the bean is created properly even if you yourself create
> it, so minimal NPEs,  just like the above case.
>
> regards
> Taha
>
> On Thu, Jun 9, 2011 at 10:36 AM, kristian marinkovic <
> kristian.marinko...@gmail.com> wrote:
>
> > Constructor injection does not work on pages, components and mixins.
> Works
> > only on services.
> > G,
> > Kris
> > Am 2011 6 9 01:49 schrieb "ael" :
> > > I always make life complicated.
> > >
> > > Well just inject the DAO within pages. problem solved.
> > > But still i want to make my page class neat though.
> > >
> > > Also contructor injection is another solution.
> > >
> > > Thanks :)
> > >
> > > --
> > > View this message in context:
> >
> >
> http://tapestry.1045711.n5.nabble.com/T5-Using-DAO-within-a-DAO-causes-NPE-tp4467009p4471238.html
> > > Sent from the Tapestry - User mailing list archive at Nabble.com.
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> >
>


Glassfish 3.1 - and tapestry live class reload

2011-06-09 Thread Magnus Kvalheim
Hi all,

We're considering switching from a servlet container to a java EE 6 server.
I've installed glassfish 3.1 and am using eclipse helios with glassfish
plugin.

Glassfish has a reloading feature built in, but it actually reloads the app
whenever a class file change. Tapestry's live class reload would
obviously be much faster!
I've tried to make eclipse output compiled classes directly into the
exploded war on the server.
I've also tried to manually replace the class, but none of these approaches
work. Seems like it's using a 'cached' version even though a newer exist...

I've posted on the glassfish forum, and they seem to be willing to add a
feature to the eclipse plugin that allows class replacement without
redeploy. Great!!
http://www.java.net/forum/topic/glassfish/glassfish/class-replace-no-redeploy
However I don't know if this will fix the issue...

*Have anyone successfully got live class reloading working on glassfish?*
*
*
thanks
Magnus


Re: First stab at CDI module for tapestry

2011-06-09 Thread Magnus Kvalheim
Thanks Howard, great to hear I'm on the right track :)

I haven't given much thought to exposing tapestry services to cdi.
It's not something we currently require for our projects, but if it's
requested by others I could look into that as well!

*Question*
I have one issue related to the CDIObjectProvider though.
While testing the quickstart (which uses the CDIModule) I created and
registered a tapestry service - which accidentally also satisfies as a CDI
managed bean.
*From quickstart appmodule*
*public static void bind(ServiceBinder binder){*
* binder.bind(AnotherService.class).withId("AnotherSrv");*
*}*

As posted earlier the CDIProvider is contributed to the MasterObjectProvider
as last (after:*)?
*configuration.add("cdiProvider", cdiProvider, "after:*");*

AnotherService is injected into a component/page
*@Inject private AnotherService another;*
*
*
What I would want is the cdiprovider to be asked last - so that if Tapestry
itself cannot provide the service it will eventually get delegated to CDI.
In this case - tapestry should provide the service.
However, the cdiprovider is asked to provide the bean. (This is why I've
specifically test for scope now.)

So the question is. *How can I make sure that the CDIProvider is asked last
in chain?*
Do I have to contribute to InjectionProvider as well?

thanks in advance
Magnus

On Wed, Jun 8, 2011 at 6:47 PM, Howard Lewis Ship  wrote:

> Nope, it's designed to be easy ... though contributions into
> MasterObjectProvider are always tricky since you can get into
> dependency cycles very easily. You've properly side-stepped this using
> @InjectService (using the special @Local marker annotation is always
> very important).
>
> The hard part, which is still difficult with Spring, is proper
> co-dependence:  allowing Tapestry services to be injected into Spring
> beans as well as the reverse.  It comes down to a turf battle about
> which framework is "in charge".
>
> On Wed, Jun 8, 2011 at 4:56 AM, Magnus Kvalheim 
> wrote:
> > Hi all,
> >
> > We're looking into moving our apps from a 'traditional' servlet container
> > with spring into a Java EE web profile server like glassfish 3.1.
> > Motivations for doing this is to utilize cdi(jsr 299, 330), ejb3 and
> more.
> > Not just for the tapestry app, but also the other applications in
> > our portfoleo which share common core business logic.
> >
> > For reference on previous discussions:
> >
> http://tapestry.1045711.n5.nabble.com/Java-based-spring-configuration-td3394086.html
> > http://tapestry.1045711.n5.nabble.com/Discussion-td2421783i20.html
> >
> > Now, I've tried running the tapestry quickstart app in glassfish 3.1
> (with
> > the eclipse connector for publishing).
> > This works ok - although I cannot make live class reloading work. :(
> >
> > Glassfish uses Weld, so the CDIModule is basically an objectprovider for
> > injecting Weld managed beans.
> > (As you probably know CDI/Weld can also be used outside jee as
> alternative
> > to tapestry-ioc, spring, etc)
> >
> > *CDIModule class*
> > *public class CDIModule { *
> > * public static void bind(ServiceBinder binder) {*
> > *binder.bind(ObjectProvider.class,
> > CDIObjectProvider.class).withId("CDIObjectProvider");*
> > *} *
> > * public static BeanManager buildBeanManager(Logger log) { *
> > * try {*
> > * BeanManager beanManager = (BeanManager) new
> > InitialContext().lookup("java:comp/BeanManager");*
> > * return beanManager; *
> > * } catch (NamingException e) {*
> > * log.error("Could not lookup jndi resource: java:comp/BeanManager", e);*
> > * }*
> > * return null;*
> > * } *
> > * public static void contributeMasterObjectProvider(*
> > * @InjectService("CDIObjectProvider") ObjectProvider cdiProvider,*
> > * OrderedConfiguration configuration) { *
> > *// configuration.add("cdiProvider", cdiProvider,
> >
> "after:Service,after:AnnotationBasedContributions,after:Alias,after:Autobuild");
> > *
> > * configuration.add("cdiProvider", cdiProvider, "after:*"); *
> > * } *
> > *}*
> > *
> > *
> > The beanmanager is expected to be found in jndi. If the beans.xml is
> present
> > it will be available at this point.
> > The BeanManager is also exposed as a service and injectable for other
> > services or components.
> > I've tested by adding the *@SubModule(CDIModule.class) *to my quickstart
> > appmodule.
> > *
> > *
> > *CDIObjectProvider class*
> > *public class CDIObjectProvider implements ObjectProvider { *
> > * private BeanManager beanManager;*
> > * private Logger log;*
> > * *
> > * @SuppressWarnings({ "unchecked", "rawtypes" })*
> > * private Set allowedScopes = CollectionFactory.newSet(*
> > * ApplicationScoped.class,*
> > * Singleton.class);*
> > *
> > *
> > * public CDIObjectProvider(*
> > * Logger log,*
> > * @InjectService("BeanManager") BeanManager manager) {*
> > * this.beanManager = manager;*
> > * this.log = log;*
> > * }*
> > * @SuppressWarnings("unchecked")*
> > * public  T provide(Class objectType,*
> > * AnnotationPro

Re: Just completed a barcode component using barbecue

2011-06-09 Thread Massimo Lusetti
On Thu, Jun 9, 2011 at 7:45 AM, Greg Pagendam-Turner
 wrote:

> Hi All,
>
> I've just completed a component to render barcodes using the opensource
> library called barbecue.
>
> All it takes is to put  in a
> page.
>
> Does anyone want to put this component in their component library?

Publish it on github...

Cheers
-- 
Massimo
http://meridio.blogspot.com

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org