Re: [T5.1] Obtaining The Page Name In A MarkupRendererFilter

2010-05-11 Thread Steve Eynon
Hello,

Following a suggestion from a fellow T5 user (cheers Nicolas!) I've
changed my page name injecting strategy. I now have a
ComponentClassTransformWorker which adds a Mixin to every Page
component. This Page Mixin (in the afterRender() method) then injects
the page name as a comment in the Document model.

This has the benefit of injecting the name of the rendered page as
oppose to the name of the requested page. The important difference is
that on error pages (http 404 and 500) I now inject the names of the
error pages and not what the user originally asked for.

What I'd like to know now, is there a nice way, in the
ComponentClassTransformWorker to check if I'm transforming a page?

Both of the following work, but neither seem particularly pleasant:

@Inject
private ComponentClassResolver  resolver;

try {
resolver.resolvePageClassNameToPageName(transformation.getClassName());
} catch (IllegalArgumentException e) {
// not a page... goodbye!
return;
}

... or...

if (!transformation.getClassName().contains(.pages.))
// not a page... goodbye!
return;

Any ideas?

Cheers,

Steve.



On 7 May 2010 12:00, Steve Eynon steve.ey...@googlemail.com wrote:
 Thanks for the help and a quick response! The following gives me what
 I need inside a MarkupRendererFilter:

 @Inject
 private Request request;

 @Inject
 private ComponentEventLinkEncoder linkEncoder;

 @Inject
 private ComponentClassResolver classResolver;

 String logicalPageName =
 linkEncoder.decodePageRenderRequest(request).getLogicalPageName();
 String actualPageName = classResolver.canonicalizePageName(logicalPageName);

 Cheers,

 Steve.
 --
 Steve Eynon
 mobie: (+592) 678 4236



 On 7 May 2010 10:25, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote:
 On Fri, 07 May 2010 11:05:56 -0300, Dmitry Gusev dmitry.gu...@gmail.com
 wrote:

 public void
 contributeMarkupRenderer(OrderedConfigurationMarkupRendererFilter
 configuration,
                                         final MetaDataLocator
 metaDataLocator,
                                         final ComponentEventLinkEncoder
 linkEncoder,
                                         final RequestGlobals globals)
    {
        configuration.add(NO_MARKUP_SYMBOL,
            new MarkupRendererFilter()
            {
               �...@override
                public void renderMarkup(MarkupWriter writer,
 MarkupRenderer
 renderer) {
                    PageRenderRequestParameters parameters =
 linkEncoder.decodePageRenderRequest(globals.getRequest());

 Instead of injecting RequestGlobals, you can inject Request directly.

 Not sure if this available in T5.1, but you can try this. I believe
 parameters.getLogicalPageName() is what you need.

 It is.

 --
 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



Re: [T5.1] Obtaining The Page Name In A MarkupRendererFilter

2010-05-11 Thread Steve Eynon
Yeah, exceptions are expensive to create and throw and never should
really be caught as part of the normal flow code (*). The example was
really just an ineffective way of pointing out I know the
ComponentClassResolver exists and I know it holds map of page names to
page class names.

The thing is, it always assumes the input strings (page / component /
mixin names) to be valid but doesn't provide a way for me to check
them before hand. I was just wondering if there's some other service
or transform method I've overlooked.

 use this one, but changing contains by 
 startWith(full.name.of.package.pages.);

Nice, but I'm turning it in to a component for reuse. Besides, no
one's ever going to put a pages subpackage in their component
package! (Sorry, what's that you say about 637K and Bill Gates?)

Steve.

(*) speaking of which, has anyone ever created their own Integer
parser? Or do we all just catch the NumberFormatException?


On 11 May 2010 15:01, Nicolas Bouillon nico...@bouil.org wrote:
 Le 11/05/2010 18:48, Steve Eynon a écrit :

 Hello,

 Following a suggestion from a fellow T5 user (cheers Nicolas!) I've
 changed my page name injecting strategy. I now have a
 ComponentClassTransformWorker which adds a Mixin to every Page
 component. This Page Mixin (in the afterRender() method) then injects
 the page name as a comment in the Document model.


 I'm glad that my suggestion works ;-)

 Btw, i responded by mistake directly to you instead of responding to the
 list.
 For the record, i was suggestesting to try to apply
 http://wiki.apache.org/tapestry/Tapestry5HowToVisualizeComponentHierarchy
 to pages instead of components.

 if (!transformation.getClassName().contains(.pages.))
        // not a page... goodbye!
        return;


 I may use this one, but changing contains by
 startWith(full.name.of.package.pages.);
 But the tradeoff is that you will not transform pages outside the scope of
 your project (such as ExceptionReport)

 Any ideas?

 Cheers,

 Steve.



 On 7 May 2010 12:00, Steve Eynonsteve.ey...@googlemail.com  wrote:


 Thanks for the help and a quick response! The following gives me what
 I need inside a MarkupRendererFilter:

 @Inject
 private Request request;

 @Inject
 private ComponentEventLinkEncoder linkEncoder;

 @Inject
 private ComponentClassResolver classResolver;

 String logicalPageName =
 linkEncoder.decodePageRenderRequest(request).getLogicalPageName();
 String actualPageName =
 classResolver.canonicalizePageName(logicalPageName);

 Cheers,

 Steve.
 --
 Steve Eynon
 mobie: (+592) 678 4236



 On 7 May 2010 10:25, Thiago H. de Paula Figueiredothiag...@gmail.com
  wrote:


 On Fri, 07 May 2010 11:05:56 -0300, Dmitry Gusevdmitry.gu...@gmail.com
 wrote:



 public void
 contributeMarkupRenderer(OrderedConfigurationMarkupRendererFilter
 configuration,
                                         final MetaDataLocator
 metaDataLocator,
                                         final ComponentEventLinkEncoder
 linkEncoder,
                                         final RequestGlobals globals)
    {
        configuration.add(NO_MARKUP_SYMBOL,
            new MarkupRendererFilter()
            {
               �...@override
                public void renderMarkup(MarkupWriter writer,
 MarkupRenderer
 renderer) {
                    PageRenderRequestParameters parameters =
 linkEncoder.decodePageRenderRequest(globals.getRequest());


 Instead of injecting RequestGlobals, you can inject Request directly.



 Not sure if this available in T5.1, but you can try this. I believe
 parameters.getLogicalPageName() is what you need.


 It is.

 --
 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




 -
 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: Noob problem with Guessing Game tutorial

2010-05-11 Thread Steve Eynon
Not sure what the current T5 deal is with putting .tml files in the
WEB-INF, but I'm certain it's not recommended.

Again, as Sergey and I have suggested, place your .tml files in the
same package as your java / class files.

With your current maven setup, that would be:

src/main/resources/org/apache/tapestry5/tutorial/pages

Steve.


On 11 May 2010 15:31, aibkwik phil.mcqui...@gmail.com wrote:

 Thanks, guys.  Still no joy -  Here is the entire 'shootin match'...

 Here is the error I get when I click on the start guessing link...

 http://old.nabble.com/file/p28528400/Application%2BException.jpeg


 Here is the project file tree:

 http://old.nabble.com/file/p28528400/Java%2B-%2Btutorial1_src_main_java_org_apache_tapestry5_tutorial_pages_Index.java%2B-%2BEclipse%2B-%2B_Users_phil.mcquitty_Documents_personal_javacode.jpg


 Here are the 4 source files involved


 --
 Index.tml

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  head
    titletutorial1 Start Page/title
  /head
  body

    h1Hi/Lo Guess/h1

    pI'm thinking of a number between one and ten ... /p

    p
      t:actionlinkStart guessing/t:actionlink
    /p

  /body
 /html


 
 Index.java

 ppackage org.apache.tapestry5.tutorial.pages;

 import java.util.Random;

 import org.apache.tapestry5.annotations.InjectPage;

 public class Index
 {
  private final Random random = new Random();

 �...@injectpage
  private Guess guess;

  Object onAction()
  {
    int target = random.nextInt(10) + 1;

    return guess.initialize(target);
  }
 }

 ---
 Guess.tml

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  head
    titleGuess A Number/title
  /head
  body

    h1The target number is ${target}./h1

  /body
 /html


 -
 Guess.java

 package org.apache.tapestry5.tutorial.pages;

 public class Guess {
        private int target;

        public Object initialize(int target) {
                this.target = target;

                return this;
        }

        public int getTarget() {
                return target;
        }
 }


 aibkwik wrote:

 Two problems:

 1.  The tutorial says to create Index.java but the class it creates is
 public class Start.  I can't even compile the tutorial.  Eclipse is
 telling me that Start should be declared in a separate file.  It offers
 to rename the class for me.  (It wants the class to be called Index).

 Here is the content of my Index.java file:

 public class Start
 {
   private final Random random = new Random();

   @InjectPage
   private Guess guess;

   Object onAction()
   {
     int target = random.nextInt(10) + 1;

     return guess.initialize(target);
   }
 }

 As represented in the tutorial, here is the interesting line from my
 Index.tml

   t:actionlinkStart guessing/t:actionlink

 2.  If I let eclipse rename the class to Index then I can at least
 compile it.  However, when I run it I get an error when I click on the
 Start Guessing URL.  The error is:


 Request event 'action' (on component Index:actionlink) was not handled;
 you must provide a matching event handler method in the component or in
 one of its containers.


 Can someone tell me what I am doing wrong?

 Thanks!


 --
 View this message in context: 
 http://old.nabble.com/Noob-problem-with-Guessing-Game-tutorial-tp28519315p28528400.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: Noob problem with Guessing Game tutorial

2010-05-11 Thread Steve Eynon
Scary that the exception talks about components when it should be
looking for a page.

What does your web.xml look like? What is your app package set to? It should be:

context-param
!-- The only significant configuration for Tapestry 5, this
informs Tapestry
  of where to look for pages, components and mixins. --
param-nametapestry.app-package/param-name
param-valueorg.apache.tapestry5.tutorial/param-value
/context-param

See http://tapestry.apache.org/tapestry5.1/guide/conf.html

Actually - if you're using maven, have you tried creating a project
from the maven archetype as mentioned on page one :
http://tapestry.apache.org/tapestry5.1/tutorial1/first.html

To get a working app I did as follows:

 mvn archetype:generate -DarchetypeGroupId=org.apache.tapestry 
 -DarchetypeArtifactId=quickstart -DgroupId=org.apache.tapestry  
 -DartifactId=tutorial1 -DpackageName=org.apache.tapestry5.tutorial

And accepted the default settings. (Note I changed archetype:create to
archetype:generate)

 cd tutorial1

Edited the pom.xml at the bottom to update the Tapestry version 5.1.0.5

 mvn jetty:run

Open browser to: http://localhost:8080/tutorial1/

Ta daa! That should give you a working base to start from.

Steve.


On 11 May 2010 16:11, aibkwik phil.mcqui...@gmail.com wrote:



 Not sure what the current T5 deal is with putting .tml files in the
 WEB-INF, but I'm certain it's not recommended.

 Again, as Sergey and I have suggested, place your .tml files in the
 same package as your java / class files.

 With your current maven setup, that would be:

 src/main/resources/org/apache/tapestry5/tutorial/pages

 Steve.


 --

 Really embarrassing now...

 Forgot to mention earlier that I'd tried that already, to no avail.
 I do, however, get a different error.

 Here is the new file locations you suggested -

 http://old.nabble.com/file/p28528821/Java%2B-%2Btutorial1_src_main_java_org_apache_tapestry5_tutorial_pages_Index.java%2B-%2BEclipse%2B-%2B_Users_phil.mcquitty_Documents_personal_javacode-1.jpg

 ...and here is the new error -
 http://old.nabble.com/file/p28528821/Application%2BException-1.jpeg

 I really want to make this crazy thing work and get to a point where I can
 move forward.  I will understand if you guys 'cry uncle'.   I appreciate
 your help.

 Phil

 --
 View this message in context: 
 http://old.nabble.com/Noob-problem-with-Guessing-Game-tutorial-tp28519315p28528821.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: Noob problem with Guessing Game tutorial

2010-05-11 Thread Steve Eynon
Hi Phil,

Now you've made me do the tutorial... (D'Oh) and yeah, it's not quite
as accurate as I expect it once was. But fundamentally, the principles
are sound.

So again, starting from scratch, I generate the archetype.

For the record, I'm using Maven 2.2.1 (as given by mvn -version) and
by default (i.e. pressing [enter]) it creates the tutorial in the
package : org.apache.tapestry : so we'll go with this.

Now org.apache.tapestry is important, it means all your page code
and your page templates go in to org.apache.tapestry.pages

So your Index.java and Guess.java go in to:

/src/main/java/org/apache/tapestry/pages

and Index.tml and Guess.tml go in:

/src/main/resources/org/apache/tapestry/pages

The important thing is, that once compiled, all your .class files and
your .tml files end up in the same place. Following our example this
would be:

/target/classes/org/apache/tapestry/pages

Note how org.apache.tapestry.pages is used throughout.

I cut'n'paste'ed the java files from the tutorial and they give the
wrong java package of org.apache.tapestry5.tutorial.pages but follow
the eclipse hint to change it to org.apache.tapestry.pages

The tutorial .tml files are fine.

The generated web.xml is fine also, so no need to touch that.

Despite the tutorial saying otherwise I would stick to using mvn
jetty:run for now to prevent further complicating your set up. (In
fact I use nothing else and still get live class re-loading but my
setup is probably a little more advanced.)

In fact, start using mvn clean jetty:run just to make sure no stray
class files are hanging around.

And that's it - it works on my machine!

From there it's all about cut'n'pasting bits of code and not whole
pages. And once everything is in the correct directory it should
largely, just work.

By the way, org.apache.tapestry is not a special package, you can
use what ever you want - just make sure everything is the same. i.e.
if use the package foo.bar.t5 then

.java files go in:
/src/main/java/foo/bar/t5/pages

.tml files go in:
/src/main/resources/foo/bar/t5/pages

so your .class and .tml files end up in:
/target/classes/foo/bar/t5/pages

and make sure the tapestry.app-package param-value in your web.xml is set to
foo.bar.t5

I don't think I can say much more than that. But to be honest, if
Java, Eclipse, Maven and Web Apps are all new to you, then I suspect
you're in for rough ride and a steep learning curve whatever platform
you try out.

Good luck!

Steve.




On 11 May 2010 21:14:05 UTC-4, aibkwik phil.mcqui...@gmail.com wrote:

 Steve. thanks, for hangin in there, man.

 I have had that ta da moment each time I have started over from scratch.

 Each time I re-create my project, I follow the tutorial and actually use the
 exact command you specified.  (Discovered the create error in the tutorial
 (deprecated function) after a couple of hours).

 It creates a project for me and going to the URL works great.  I see the
 time-of-day function and clicking on refresh works great.   I continue to
 follow the tutorial example and import the new, working project into my
 Eclipse.   (that's when the .tml files get separated from the .java files).

 Going to the URL at that point reveals the index.tml page and all looks good
 until you click the link.

 Nothing works beyond that.

 I checked my web.xml and did have tutorial instead of tutorial5,
 however, making the change ended up with the same error, but gave me a new
 branch in my directory along with two new .class files.

 I'm losing steam...

 I feel like I should not proceed to other samples, examples, if I can not
 get this very simple one working.  I'm considering dropping this altogether
 and giving other paradigms a try.  I've seen appFuse and echo Web but was
 under the impression that tapestry was more settled and would be easier to
 learn.  I've been on this one tutorial for 3 days LoL...  I'm a C++
 programmer trying to make the switch over to Java/web and am looking for a
 way to avoid having to learn all the 'plumbing' required in servlet/JSP
 baseline programing.

 If you have something else you'd like me to try, I'm still game on giving it
 a go.

 Phil




 Steve Eynon wrote:

 Scary that the exception talks about components when it should be
 looking for a page.

 What does your web.xml look like? What is your app package set to? It
 should be:

 context-param
     !-- The only significant configuration for Tapestry 5, this
 informs Tapestry
           of where to look for pages, components and mixins. --
     param-nametapestry.app-package/param-name
     param-valueorg.apache.tapestry5.tutorial/param-value
 /context-param

 See http://tapestry.apache.org/tapestry5.1/guide/conf.html

 Actually - if you're using maven, have you tried creating a project
 from the maven archetype as mentioned on page one :
 http://tapestry.apache.org/tapestry5.1/tutorial1/first.html

 To get a working app I did as follows:

 mvn archetype:generate -DarchetypeGroupId

Re: URLRewriting and tapestry.force-absolute-uris

2010-05-09 Thread Steve Eynon
Hi Christian,

If you are just looking to change incoming legacy requests and don't
care about URLs once the user has entered the system, have a look at:

Url Rewrite Filter - http://tuckey.org/urlrewrite/

It's a servlet filter than alters the URL before Tapestry sees it,
allowing you to convert legacy URLs into T5 friendly ones. It supports
Forwards  Redirects, regex and wildcards and I think even lets you
run java code for more complicated transformations.

Steve.
--
Steve Eynon
mobie: (+592) 678 4236



On 4 May 2010 06:08, Christian Riedel cr.ml...@googlemail.com wrote:
 Hm... but how should I change the outbound links?
 When I change the inbound request /legacy.do?show=page to /user/page the 
 outbound links will be /user/anotherPage or similar (according to my 
 debugger, while debugging the outbound filter). They are OK, I don't want the 
 user to see the links that are written in the legacy url form, so I don't 
 change them to another format.
 Then the RequestPathOptimizer touches and breaks the links. In the outbound 
 filter links to the other pages are like /user/anotherPage but the 
 optimizer strips everything in front of the last slash so in the end the 
 result is /anotherPage.

 I cannot perform redirects with the URLRewriter (to change the url in the 
 browser to the rewritten one) and I don't know how to circumvent the 
 RequestPathOptimizer just for those legacy urls. What can I do in the 
 outbound filter so that the user can access the application via a legacy url 
 and gets proper links that are not in the legacy-application's format?

 Maybe it's a bug or a new feature, I could open a JIRA if you also can't see 
 a solution :)

 Best regards,
 Christian


 Am 04.05.2010 um 00:34 schrieb Thiago H. de Paula Figueiredo:

 On Fri, 30 Apr 2010 12:20:09 -0300, Christian Riedel 
 cr.ml...@googlemail.com wrote:

 Hi list,

 Hi!

 Now Tapestry generates all links optimized to the rewritten URL, so there 
 might be links to http://app/page.component:event/smb;, which does not 
 exist... Also, locales will not be encoded into links because Tapestry 
 expects them to be there.

 When using URL rewriting, almost all the time you have an inbound rule you 
 must write a correspondent outbound one.

 --
 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



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



[T5.1] Input string is not valid; the character at position X is not valid

2010-05-08 Thread Steve Eynon
 to deal with the situation
explicitly. Maybe in a future release?

Steve.
--
Steve Eynon
mobie: (+592) 678 4236

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



[T5.1] Obtaining The Page Name In A MarkupRendererFilter

2010-05-07 Thread Steve Eynon
Hello,

I'm looking at ways to automatically insert the name of the page being
rendered into each page (so my selenium tests can check the correct
page was finally rendered). This was done using a component I placed
on each page but I'm looking for a more elegant solution.

I've tried contributing a MarkupRendererFilter to add my tag via
writer.getDocument(). The only way I know to get hold of the current
page name is through ComoponentResources.getPageName(). But
ComoponentResources wasn't in the Environment and doesn't seem to be
Shadowed either.

Is MarkupRendererFilter the right object to contribute for this? And
if so, where would I get the current Page name from?

Cheers,

Steve.
--
Steve Eynon
mobie: (+592) 678 4236

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



Re: [T5.1] Obtaining The Page Name In A MarkupRendererFilter

2010-05-07 Thread Steve Eynon
Thanks for the help and a quick response! The following gives me what
I need inside a MarkupRendererFilter:

@Inject
private Request request;

@Inject
private ComponentEventLinkEncoder linkEncoder;

@Inject
private ComponentClassResolver classResolver;

String logicalPageName =
linkEncoder.decodePageRenderRequest(request).getLogicalPageName();
String actualPageName = classResolver.canonicalizePageName(logicalPageName);

Cheers,

Steve.
--
Steve Eynon
mobie: (+592) 678 4236



On 7 May 2010 10:25, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote:
 On Fri, 07 May 2010 11:05:56 -0300, Dmitry Gusev dmitry.gu...@gmail.com
 wrote:

 public void
 contributeMarkupRenderer(OrderedConfigurationMarkupRendererFilter
 configuration,
                                         final MetaDataLocator
 metaDataLocator,
                                         final ComponentEventLinkEncoder
 linkEncoder,
                                         final RequestGlobals globals)
    {
        configuration.add(NO_MARKUP_SYMBOL,
            new MarkupRendererFilter()
            {
               �...@override
                public void renderMarkup(MarkupWriter writer,
 MarkupRenderer
 renderer) {
                    PageRenderRequestParameters parameters =
 linkEncoder.decodePageRenderRequest(globals.getRequest());

 Instead of injecting RequestGlobals, you can inject Request directly.

 Not sure if this available in T5.1, but you can try this. I believe
 parameters.getLogicalPageName() is what you need.

 It is.

 --
 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



Re: EasyFCKEditor FileUpload with Tomcat?

2010-05-05 Thread Steve Eynon
Hi,

It's all about having the app server serve up images once they've been uploaded.

For Tomcat I simply set a new context with the specified docbase. e.g.
using to set up a context of wwwfiles to serve images from

C:\Users\Ville\Documents\NetBeansProjects\wwwfiles

I just created a file called

C:\Apps\apache-tomcat-6.0.24\conf\Catalina\localhost\wwwfiles.xml

with the content

?xml version=1.0 encoding=UTF-8?
Context docBase=C:\Users\Ville\Documents\NetBeansProjects\wwwfiles
/Context

Steve.

--
Steve Eynon
mobie: (+592) 678 4236



On 5 May 2010 10:45, hunta peter.bethk...@googlemail.com wrote:

 Hi,

 i tried to get the file upload to work with tomcat with this manual:
 http://t5-easy-fckeditor.kenai.com/FileUploads.html

 Now i've got the problem that i use Tomcat instead of jetty and i have no
 idea how the 3. step in the manual should look like for tomcat.

 Can someone help?

 hunta
 --
 View this message in context: 
 http://old.nabble.com/EasyFCKEditor-FileUpload-with-Tomcat--tp28461971p28461971.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: AjaxFormLoop: property changes have no effect

2010-04-20 Thread Steve Eynon
Excellent - I'm really happy I found this email for I to, fell into
the same trap.

I entered the world of ValueEncoders after playing with Field
Translators and TypeCoercers and thought maybe they did the same
thing. I also (wrongly) thought that as I supplied the AjaxFormLoop
with a source List, Tapestry would be able to back track through the
list and set the properties for me (much the same as it read them in
the first place).

Anyhow, it all works now and I just thought I'd keep this thread
relevant in case anyone else has the same problem.

Steve.


On 5 August 2009 07:22, Andy Pahne wrote:

 You are right, that was a misunderstanding on my side.

 Now I got it. Thanks. For the curious, here is the working code:

   public ValueEncoder getVehicleEncoder(){
       return new ValueEncoder() {

           @Override public String toClient(Object value) {
               return String.valueOf(vehicles.indexOf(value));
           }

           @Override public Object toValue(String clientValue) {
               return vehicles.get(new Integer(clientValue));
           }
                 };
   }



 Still I had to take a little care that my Vehicle' equal() method returns
 some meaningfull value


 Thank you for your feedback.
 Andy

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



Re: [T5.1] How do you advise ClassNameLocator?

2009-05-09 Thread Steve Eynon
You can advise any service defined in Tapestry Core but you can not
advise services defined in Tapestry IOC.

The TapestryIOCModule is annotated with @PreventServiceDecoration
which... does just that!

Steve.


2009/5/8 Igor Drobiazko igor.drobia...@gmail.com:
 Hi Steve,

 that is not true. Of course you can override ClasspathURLConverter as any
 service in Tapestry.


 On Wed, May 6, 2009 at 6:49 PM, Steve Eynon
 steve.ey...@alienfactory.co.ukwrote:

 Arr, yes, thanks Igor.

 The JavaDocs for ClasspathURLConverter even states it exists for OSGi
 (Eclipse) apps:

  This is a hook for supporting OSGi, allowing bundleresource and
 bundleentry protocols to be converted to jar: or file:.

 The default implementation currently returns the URLs unchanged.

 But alas, this service again is defined in the TapestryIOCModule
 meaning it too can't be overridden or advised.

 I'll override it in my current classpath fudgey way...

 To overcome overriding issues, maybe rather than providing one class
 to convert all urls we could contribute UrlConverters to handle
 different protocols?

 Steve.
 --
 Steve Eynon
 www.bushmasters.co.uk
 mobie: (+592) 6784236



 2009/5/6 Igor Drobiazko igor.drobia...@gmail.com:
  Hi Steve,
 
  the problem is the protocol bundleresource.
  You should override ClasspathURLConverter which is used by
 ClassNameLocator.
  This service was introduced to be able to handle URLs which are not
 common
  in Java.
  I provide for example my own implementition of this service in an OSGi
  environment, where the URL start with bundleresource.
  So you have the same issue.
 
  --
  Best regards,
 
  Igor Drobiazko
 

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




 --
 Best regards,

 Igor Drobiazko


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



[T5.1] How do you advise ClassNameLocator?

2009-05-05 Thread Steve Eynon
How do I advise the ClassNameLocator service?

If I add the following advice method to my AppModule ...

@Match(*)
public static void adviseEverything(MethodAdviceReceiver receiver) {
System.out.println(receiver.getInterface());
}

Only the following interfaces are advised ...

interface org.apache.tapestry5.ioc.ObjectProvider
interface org.apache.tapestry5.services.AliasManager
interface org.apache.tapestry5.services.ApplicationInitializer
interface org.apache.tapestry5.services.UpdateListenerHub
interface org.apache.tapestry5.internal.services.ComponentInstantiatorSource
interface org.apache.tapestry5.services.InvalidationEventHub
interface org.apache.tapestry5.internal.services.EndOfRequestEventHub
interface org.apache.tapestry5.services.ApplicationGlobals
interface org.apache.tapestry5.services.ComponentClassResolver
interface com.formos.tapestry.templating.services.TemplateRendererSource
interface com.formos.tapestry.templating.services.LocationManager
interface 
com.formos.tapestry.templating.internal.services.TemplateRequestGlobals
interface org.apache.tapestry5.services.RequestGlobals
interface org.apache.tapestry5.services.LocalizationSetter
interface org.apache.tapestry5.services.ComponentSource
interface org.apache.tapestry5.internal.services.RequestPageCache

I can debug and step into the ClassNameLocator so I know it's been
created but I'm not given an opportunity to override its return value.

To give context, I am trying to use tapx-templating to generate
customer receipts (which are exported into pdf files via Flying Saucer
and iText).

It all works brilliantly when run from unit tests but fails miserably
when I make the same call from within an Eclipse RCP application. It
fails due to the ClassLoader of the RCP app returning URLs in the form
of :

bundleresource://1/com/bushmasters/admin/templating/pages/

which the Tapestry ClassNameLocator service doesn't understand.

I'm happy to override the ClassNameLocator and return some hard coded
defaults (as I have few pages and components) but am not sure how...?

Any help is much appreciated.

Steve.

--
Steve Eynon
www.bushmasters.co.uk
mobie: (+592) 6784236

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



Re: [T5.1] How do you advise ClassNameLocator?

2009-05-05 Thread Steve Eynon
Thanks. The following gives me the same list of interfaces as advising:

@Match(*)
public static T T decorateEverything(ClassT serviceInterface, T
delegate, String serviceId) {
System.out.println(serviceInterface.getName());
return delegate;
}

ClassNameLocator not being one of them.

I have fudged a fix by supplying my own
org.apache.tapestry5.ioc.internal.services.ClassNameLocatorImpl and
ensuring it's further up the classpath than Tapestry's but that's far
from perfect!

The Decorator documentation mentions:

 Note: It is not possible to decorate the services of the TapestryIOCModule.

The ClassNameLocator just happens to be an IOC internal class.

The Advice documentation mentions:

 Note that some services, especially those built-in to Tapestry IoC, are 
 marked as not subject to decoration, this applies to service advice as well 
 as service decoration.

The whole TapestryIOCModule is annotated with
@PreventServiceDecoration so that explains why I can't override it.

Might it be an idea to just annotate individual dangerous services
rather than a blanket ban on overriding all IOC services?

Steve.
--
Steve Eynon
www.bushmasters.co.uk
mobie: (+592) 6784236



2009/5/5 Thiago H. de Paula Figueiredo thiag...@gmail.com:
 Em Tue, 05 May 2009 19:23:14 -0300, Steve Eynon
 steve.ey...@alienfactory.co.uk escreveu:

 How do I advise the ClassNameLocator service?

 Have you tried decoration instead of method advising? The resulting code
 would be very similar.

 --
 Thiago H. de Paula Figueiredo
 Independent Java consultant, developer, and instructor
 http://www.arsmachina.com.br/thiago

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



Re: [T5.1.0.2] / [T5.1.0.3] BlackBird Info Logging

2009-05-03 Thread Steve Eynon
2009/4/24 Blower, Andy andy.blo...@proquest.co.uk:
 Any time a message, of any category, is added, Blackbird will popup (by
 design).

 This surprises me, I also assumed that (since it's a development/debugging 
 tool) the console would be disabled in production mode. I'd be very 
 interested to hear other people's opinion on this.

What this means to me, is that after I've carefully constructed all my
debug logging calls I have to go and delete them before the code goes
live. It's like hunting down System.out's all over again!

For lower level logging calls (say debug and info) I don't see why you
would want the console popping up in production mode.

Regards,

Steve.

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



[T5.1.0.4] Distinguishing Between Internal and Scripts when Combining

2009-05-03 Thread Steve Eynon
Hi,

If you add a script with an external url then script combining is disabled.

From DocumentLinkerImpl :

public void addScriptLink(String scriptURL) {
...
// If a script with an external URL is added, we can't combine the
scripts after all.
if (combineScripts  !scriptURL.startsWith(fullAssetPrefix))
combineScripts = false;
...
}

Would it not be possible to have two buckets of scripts, one for
internal scripts and the other for external? The internal scripts
could then combined into a virtual asset and the external ones
rendered as separate script tags.

The script combining and virtual assets were working wonderfully until
I added script link to Google Analytics on all my pages.

renderSupport.addScriptLink(http://www.google-analytics.com/ga.js;);

I don't want to loose this cool feature of T5 and I would imagine
adding Google Analytics to sites (in the manner above) would be a
rather common thing to do.

Regards,

Steve.

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



Re: [T5.1.0.2] / [T5.1.0.3] Combining JavaScript Libraries in IE 6

2009-04-15 Thread Steve Eynon
Hi,

We use Jetty 6.1.14 and this happens regardless of whether deployed to
Windows or Linux. We've not noticed this behaviour in Firefox or IE 7,
but it's consistent on IE 6. However, when you refresh the problematic
page then all works fine.

It's almost as if the virtual script is being downloaded after the
Tapestry initialization - hence on page refresh the script is already
cached and all works smoothly. But that does not explain why
everything works when the scripts are not combined. The only obvious
difference to the browser would be the length of the virtual js
filename.

No stack traces are being produced on the server so I was guessing
it's a quirk with IE 6 script loading but wasn't sure if it was down
to our skewed IE 6 or not.

Steve.

P.S. It's a great idea - are there any plans in the pipeline to do
similar with stylesheets?

--
Steve Eynon
www.bushmasters.co.uk
mobie: (+592) 6784236



2009/4/15 Ville Virtanen ville.virta...@cerion.fi:

 I've experienced this too, and some others in the list.

 The underlying issue is that the combining / gzipping dies in the server
 side - the page is loaded but the javascript asset is never delivered to
 the browser. However, tapestry includes initialization in the page which
 dependes to the asset, which gives error Tapestry does not exist.

 Hunt down the stack trace from production and attach it here. Do you also
 have tomcat, and develop in windows + deploy to linux?

  - Ville

 Ps. We're experiencing this randomly, and for us this is not browser
 dependent.


 Steve Eynon wrote:

 Hi,

 I noticed that if I added script on page in a component during the
 beginRender() method via...

 renderSupport.addScript()

 ...I recieved a javascript error in IE 6 complaining that the Tapestry
 object did not exist on the line:

 Tapestry.onDOMLoaded(function() {

 This only happens if tapestry.combine-scripts is set to true (i.e.
 in production mode). If this is set to false, then IE 6 is more than
 happy. It seems like IE 6 was not happy with the virtual asset js
 file.

 I was just wondering if anyone else had noticed this behaviour as I'm
 only able to test IE 6 via the usual Multiple IEs install on a Windows
 XP box (and not through a *real* IE 6 install).

 Regards,

 Steve.

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




 --
 View this message in context: 
 http://www.nabble.com/-T5.1.0.2-T5.1.0.3--Combining-JavaScript-Libraries-in-IE-6-tp23051348p23055231.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: [REQUEST] Live T5 web sites, quotes, marketting

2009-04-15 Thread Steve Eynon
Hi,

http://www.bushmasters.co.uk - An extreme adventure tour company in
South America.

We re-deployed a few weeks ago with Tapestry 5.1, upgrading from an
old PHP site. I've been a long standing advocate of Tapestry - it
makes web development fun!


They're a bit non specific but here's my two pence worth of quips:

Tapestry's rich suite of customisable components gets your web
application up and running fuss free.

The meticulous attention to detail to all areas of the feature rich
framework delivers instantly scalable web applications.

Tapestry delivers fast, clean and intuitive web applications - a
developers dream.


Have fun,

Steve.
--
Steve Eynon
www.bushmasters.co.uk
mobie: (+592) 6784236

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



[T5.1.0.2] / [T5.1.0.3] Combining JavaScript Libraries in IE 6

2009-04-14 Thread Steve Eynon
Hi,

I noticed that if I added script on page in a component during the
beginRender() method via...

renderSupport.addScript()

...I recieved a javascript error in IE 6 complaining that the Tapestry
object did not exist on the line:

Tapestry.onDOMLoaded(function() {

This only happens if tapestry.combine-scripts is set to true (i.e.
in production mode). If this is set to false, then IE 6 is more than
happy. It seems like IE 6 was not happy with the virtual asset js
file.

I was just wondering if anyone else had noticed this behaviour as I'm
only able to test IE 6 via the usual Multiple IEs install on a Windows
XP box (and not through a *real* IE 6 install).

Regards,

Steve.

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



[T5.1.0.2] / [T5.1.0.3] BlackBird Info Logging

2009-04-14 Thread Steve Eynon
Hiya,

The Tapestry js object has debug, warn and error logging methods to
BlackBird but no info logging. Is this due to design because the
logging methods are only supposed to be used by Tapestry internal
components (and hence not yet required)? Or maybe an wee oversight?

Personally, I'm excited at the idea of having BlackBird bundled with
T5 and would love to utilise it fully.

On a related note, when I send messages to BlackBird via the js
Tapestry.debug() method it seems to pop up the BlackBird console
window regardless of  whether I'm in productionMode or not. Is this
the desired behaviour? Or again, am I not supposed to use the Tapestry
js logging methods myself?

Regards,

Steve.

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



Re: [T5] using nbsp; in template

2007-12-27 Thread Steve Eynon
See the Template Doctypes section at

http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html

for more info.

Steve.

On 16/12/2007, Arve Klev [EMAIL PROTECTED] wrote:
 I put this line at the top of the template:
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
 

 and then nbsp; (among others) can be used.

 Arve Klev

 2007/12/16, Matt Brock [EMAIL PROTECTED] :
 
 
 
  Sven Homburg-2 wrote:
  
   is there a known reason why i cant use the nbsp; inside a template?
  
  Try amp;amp;nbsp;
 
  --
  View this message in context: 
  http://www.nabble.com/-T5--using--nbsp--in-template-tp14355591p14357100.html
 
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems Deploying T5 Apps with Component Modules in Jetty

2007-12-09 Thread Steve Eynon
Hi Chris,

You are correct and I agree with everything you say, no buts. You are
even right in your assumption that I'm not aware of the @SubModule
annotation. I don't recall seeing it mentioned anywhere, but will look
it up in a minute.

To address your specific points (...of my inadequacy - ulp!)

1) However which way my Eclipse environment was set up (with disparate
projects, maven plugins, etc...) the component module's manifest
wasn't being picked up. (I suspect the compiled class folders were on
the classpath and not the .jar itself - I never investigated.) As a
dirty hack to get both modules loaded, I extended the module class.
Wrong, I now know.

2) My thinking was thus; the only reason to enhance / add to an
existing app's module would be for creating a test version of your
app. I presumed that extending the module class was the only way to do
that.

I guess that, knowing T5 is still in alpha and not knowing the its
code base, when something goes wrong and I've been bashing my head
against it for some time, I'm not sure if I've done something really
dumb (which has been the case) or if it's a problem yet to be
addressed.

If it helps redeem me any, I've been an avid follower of Tapestry
since v3 and advocate it to all and sundry. And I am truely impressed
with the clean design of T5.

Regards,

Steve.

On Dec 9, 2007 5:04 PM, Chris Lewis [EMAIL PROTECTED] wrote:
 This leaves me with two questions:

 My App Module class extended the
 Component Module class. (Doh!) I now remember doing this to have the
 Jetty Launcher in Eclipse pick up the component module configuration.

 1) Why would you extend a module class so that it is effectively
 included, when all you need to do is have it on the class path and the
 the appropriate manifest entry (which I believe you said you had)? One
 of the main bonuses of having component libs is to specifically avoid
 this rigid coupling. However even if you wanted that, this is what
 @SubModule is for.

 Except for maybe adding extra configuration for a test version of an
 application I can't think why you'd want to extend the module class.

 2) Again, extending the module class is (IMO) the Wrong Way(tm) of doing
 this. I do this kind of testing/demoing for my component lib and have
 such a test version of an app module. In the test version I simply use
 @SubModule to 'include' the usual app module.

 Don't mistake my input as criticism - I just want to know if you were
 aware of these seemingly emerging T5 best practices and had found
 reasons to avoid them. If so, please share!

 sincerely,
 chris


 Steve Eynon wrote:
  Except for maybe adding extra configuration for a test version of an
  application I can't think why you'd want to extend the module class.
  That said, it's quite a constraint to impose for the module class
  doesn't *need* to be final. (And guaranteed someone, somewhere will
  want to at some point for some reason!)
 
  Maybe consider logging a warning message instead? That would then give
  more context to the Service id has already been defined error
  message.
 
  Steve.
 
  On Dec 8, 2007 5:26 PM, Howard Lewis Ship [EMAIL PROTECTED] wrote:
 
  Makes me wonder if Tapestry modules should be final?
 
 
  On Dec 8, 2007 9:12 AM, Steve Eynon [EMAIL PROTECTED] wrote:
 
  To clear this one up, I was in error. My App Module class extended the
  Component Module class. (Doh!) I now remember doing this to have the
  Jetty Launcher in Eclipse pick up the component module configuration.
 
  During my tour of the tapestry source I came across the
  tapestry.modules system parameter, so I can now have the component
  module picked up by both a stand-alone Jetty instance and the Eclipse
  Jetty Launcher.
 
  Cheers,
 
  Steve.
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems Deploying T5 Apps with Component Modules in Jetty

2007-12-08 Thread Steve Eynon
To clear this one up, I was in error. My App Module class extended the
Component Module class. (Doh!) I now remember doing this to have the
Jetty Launcher in Eclipse pick up the component module configuration.

During my tour of the tapestry source I came across the
tapestry.modules system parameter, so I can now have the component
module picked up by both a stand-alone Jetty instance and the Eclipse
Jetty Launcher.

Cheers,

Steve.


On Dec 5, 2007 4:58 PM, Thiago HP [EMAIL PROTECTED] wrote:
 On 12/5/07, Steve Eynon [EMAIL PROTECTED] wrote:
 
  To clarify, I only have the one component module (the
  WebsiteTagsModule) and it is only in that .jar that I specify the
  Tapestry-Module-Classes property in the MANIFEST.MF.

 So take a look at your environment. Once I ran into a similar problem with
 Tapestry 4 because the Tomcat plugin I was using added the Eclipse project
 classpath to the Tomcat one. This caused HiveMindo to be loaded twice
 because, in WEB-INF/lib, there was a copy of the HiveMind jar. Summary: one
 copy being loaded from WEB-INF/lib, one by Eclipse. Since I've found that,
 I've never put any JARs in WEB-INF/lib during development.
 Thiago




-- 
Steve Eynon
0780 390 5424

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems Deploying T5 Apps with Component Modules in Jetty

2007-12-08 Thread Steve Eynon
Except for maybe adding extra configuration for a test version of an
application I can't think why you'd want to extend the module class.
That said, it's quite a constraint to impose for the module class
doesn't *need* to be final. (And guaranteed someone, somewhere will
want to at some point for some reason!)

Maybe consider logging a warning message instead? That would then give
more context to the Service id has already been defined error
message.

Steve.

On Dec 8, 2007 5:26 PM, Howard Lewis Ship [EMAIL PROTECTED] wrote:
 Makes me wonder if Tapestry modules should be final?


 On Dec 8, 2007 9:12 AM, Steve Eynon [EMAIL PROTECTED] wrote:
  To clear this one up, I was in error. My App Module class extended the
  Component Module class. (Doh!) I now remember doing this to have the
  Jetty Launcher in Eclipse pick up the component module configuration.
 
  During my tour of the tapestry source I came across the
  tapestry.modules system parameter, so I can now have the component
  module picked up by both a stand-alone Jetty instance and the Eclipse
  Jetty Launcher.
 
  Cheers,
 
  Steve.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[T5] Component Module Templates Not Rendering

2007-12-08 Thread Steve Eynon
Hello,

The templates in my component module are not being rendered when I
deploy my app in a standalone version of Jetty via the webapps dir.
All is fine when deployed with the Jetty Launcher in Eclipse.

If I add a BeforeRenderTemplate method to the component I can see it
being called, so I assume Tapestry knows of the template. I can even
add elements to the writer from this method and they are rendered
fine.

Also, I don't know if this is related or not, but image (possibly all
binary?) assets from the component module are served up corrupted.
Stylesheet (text) assets are served up fine.

Does anyone have any ideas as to why this may be?

Regards,

Steve.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [T5] Component Module Templates Not Rendering

2007-12-08 Thread Steve Eynon
Hi,

Yes, thanks. It was to do with files being corrupted when the
components module was installed into the maven repo. Thanks for the
tip, it all hangs together quite nicely now.

Best regards,

Steve.

On Dec 8, 2007 8:04 PM, Howard Lewis Ship [EMAIL PROTECTED] wrote:
 Is there any chance you are using Ant filters when copying resources
 into the deployed WAR?  Try expoding the WAR and checking the files
 direclty.  Filtering (the thing that finds @FOO@ and replaces the
 value with something else) will corrupt binary files quite often.


 On Dec 8, 2007 10:10 AM, Steve Eynon [EMAIL PROTECTED] wrote:
  Hello,
 
  The templates in my component module are not being rendered when I
  deploy my app in a standalone version of Jetty via the webapps dir.
  All is fine when deployed with the Jetty Launcher in Eclipse.
 
  If I add a BeforeRenderTemplate method to the component I can see it
  being called, so I assume Tapestry knows of the template. I can even
  add elements to the writer from this method and they are rendered
  fine.
 
  Also, I don't know if this is related or not, but image (possibly all
  binary?) assets from the component module are served up corrupted.
  Stylesheet (text) assets are served up fine.
 
  Does anyone have any ideas as to why this may be?
 
  Regards,
 
  Steve.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



 --
 Howard M. Lewis Ship
 TWD Consulting, Inc.

 Creator Apache Tapestry and Apache HiveMind


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems Deploying T5 Apps with Component Modules in Jetty

2007-12-05 Thread Steve Eynon
To clarify, I only have the one component module (the
WebsiteTagsModule) and it is only in that .jar that I specify the
Tapestry-Module-Classes property in the MANIFEST.MF.

Cheers for thinking about this,

Steve.


On 05/12/2007, Chris Lewis [EMAIL PROTECTED] wrote:
 Nice catch :-). Does TIoC 'know' which modules it has loaded? If so
 perhaps an exception should be thrown, or at least a log message made,
 if an app attempts to (indirectly) load a module more than once.

 Thiago HP wrote:
  On 12/5/07, Steve Eynon [EMAIL PROTECTED] wrote:
 
  java.lang.RuntimeException:
  Service id 'AssetFinder' has already been defined by
  com.alienfactory.websitetags.WebsiteTagsModule.buildAssetFinder
  (AssetSource)
  (at WebsiteTagsModule.java:28)
  and may not be redefined by
  com.alienfactory.websitetags.WebsiteTagsModule.buildAssetFinder
  (AssetSource)
  (at WebsiteTagsModule.java:28).
 
 
  It surely looks like your WebsiteTagsModule is being loaded at least twice.
  Each of your jars has a Tapestry-Module-Classes including WebsiteTagsModule?
  If so, Tapestry-IoC will load it once for each jar in the classpath. ;-)
  Howard, maybe this could be checked and a warning raised by Tapestry-IoC.
  What do you think about it? JIRA?
  Thiago
 
 




-- 
Steve Eynon
0780 390 5424

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problems Deploying T5 Apps with Component Modules in Jetty

2007-12-05 Thread Steve Eynon
Hello,

I have a number of T5 web apps that all use a common component module.
In the component's module class (as defined by the
Tapestry-Module-Classes property in its jar's MANIFEST.MF) there is a
simlpe build method:

public static AssetFinder buildAssetFinder(@InjectService AssetSource
assetSource) {
return new AssetFinder(assetSource);
}

All is well whilst developing in Eclipse using the Jetty Launcher but
when I try to deploy in a standalone Jetty instance by copying the war
into its webapps folder I get the following exception:

java.lang.RuntimeException:
Service id 'AssetFinder' has already been defined by
com.alienfactory.websitetags.WebsiteTagsModule.buildAssetFinder(AssetSource)
(at WebsiteTagsModule.java:28)
and may not be redefined by
com.alienfactory.websitetags.WebsiteTagsModule.buildAssetFinder(AssetSource)
(at WebsiteTagsModule.java:28).
You should rename one of the service builder methods.

It's as if the MANIFEST.MF and hence my module class is being parsed
more than once. I've checked the .war and that module class does only
exist the once.

I've also tried autobuilding with the public static void
bind(ServiceBinder binder) method and receive a similar message.

I've done the usual searches (tapestry website, google, mailing lists)
and not found any mention of anyone having deployment problems outside
of Tomcat. Are there any known gotchas with respect to deploying
component modules?

Regards,

Steve.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems Deploying T5 Apps with Component Modules in Jetty

2007-12-05 Thread Steve Eynon
Hi,

 have you tried explicitly setting the id?

No I didn't try explicitly setting the service id for I only have the
one service which I only define the once. (Will try it tonight
though!)

 So, there's no chance that you have a copy of the common module lib on
 the general classpath and in WEB-INF/lib?

Nope. It's a brand spanking new install of jetty 5.1.x fresh from the
.zip from the mortbay ftp site. All I've done is copied the .war into
the webapps dir and run start.jar. That's when the exception occurs
and the app never starts up.

I get the same message on fresh installs of Jetty 5.1.9, 5.1.5, 5.1.2
and even Jetty 6.1.6.

Steve.

On 05/12/2007, Chris Lewis [EMAIL PROTECTED] wrote:
 You say you've tried auto binding, but have you tried explicitly setting
 the id? Like so:

   public static void bind(ServiceBinder binder)
   {
  binder.bind(AssetFinder.class,
 AssetFinderImpl.class).withId(AssetFinderWithExplicitId);
   }

 Auto binding assigns the class name as the service id, which is logical.
 However if you have colliding names then you need to specify unique ids.

 The fact that you're seeing this problem in deployment but not
 production smells a bit off though. Does there happen to be two copies
 of your war lying around? It sounds like that builder method is being
 called more than once (very odd), or that another part of the app is
 contributing a service with the same name - but if that were the case
 you'd probably know it.

 Steve Eynon wrote:
  Hello,
 
  I have a number of T5 web apps that all use a common component module.
  In the component's module class (as defined by the
  Tapestry-Module-Classes property in its jar's MANIFEST.MF) there is a
  simlpe build method:
 
  public static AssetFinder buildAssetFinder(@InjectService AssetSource
  assetSource) {
  return new AssetFinder(assetSource);
  }
 
  All is well whilst developing in Eclipse using the Jetty Launcher but
  when I try to deploy in a standalone Jetty instance by copying the war
  into its webapps folder I get the following exception:
 
  java.lang.RuntimeException:
  Service id 'AssetFinder' has already been defined by
  com.alienfactory.websitetags.WebsiteTagsModule.buildAssetFinder(AssetSource)
  (at WebsiteTagsModule.java:28)
  and may not be redefined by
  com.alienfactory.websitetags.WebsiteTagsModule.buildAssetFinder(AssetSource)
  (at WebsiteTagsModule.java:28).
  You should rename one of the service builder methods.
 
  It's as if the MANIFEST.MF and hence my module class is being parsed
  more than once. I've checked the .war and that module class does only
  exist the once.
 
  I've also tried autobuilding with the public static void
  bind(ServiceBinder binder) method and receive a similar message.
 
  I've done the usual searches (tapestry website, google, mailing lists)
  and not found any mention of anyone having deployment problems outside
  of Tomcat. Are there any known gotchas with respect to deploying
  component modules?
 
  Regards,
 
  Steve.
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Steve Eynon
0780 390 5424

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



<    1   2   3   4