You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ben Tomasini <be...@gmail.com> on 2007/08/23 22:51:13 UTC

Re: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc

I have the same requirement mentioned in #2.  What is the best approach to
handle this with Tapestry 5?  I am thinking of just eager loading a service
and invoking the init method in the builder method of the module.  Any other
thoughts?

I think this was the Tapestry 4 way:
http://tapestry.apache.org/tapestry4/tapestry/hivedocs/module/tapestry.init.html

Ben

On 6/5/07, Erik Vullings <er...@gmail.com> wrote:
>
> Hi,
>
> I've recently started working with T5 because I liked a lot what I've
> seen! I therefore have some basic questions, and I hope you can help
> me with them:
>
> 1. I've started changing the quickstart project to move a current
> struts2-spring-jdbc application to T5. Where can I put my dao
> initialization  (creation of hsqldb tables, which used to be done via
> my ContextListener class in struts2)?
>
> 2. In my existing application, I use a (folder-like) tree based on the
> www.dhtmlgoodies.com drag-drop-folder-tree. It is based on a standard
> HTML unordered list, which I generate in my page's java class. In the
> accompanying HTML file, I use "${formattedTree}" However, when I
> return the formattedTree "<ul><li>..." it becomes &lt;ul&gt; etc. How
> can I change the encoding, in other words, output raw HTML to the HTML
> template file.
>
> 3. Related to Q2, are there any T5 tutorials on how to develop a tree
> component, similar to a grid component? Or does someone already have
> it?
>
> 4. Is it possible to enable T5 javadoc help to display in the Eclipse IDE?
>
> Thanks for your help,
> Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc

Posted by Josh Canfield <jo...@thedailytube.com>.
Hehe... I suppose if I'd read the old post more closely (as opposed to just
looking at #2) I could have figured that out. Sounds like the @EagerLoad
that Robin pointed to is what you want.

On 8/23/07, Ben Tomasini <be...@gmail.com> wrote:
>
> Doh.
>
> I meant #1.
>
> Thanks.
>
> Ben
>
> On 8/23/07, Josh Canfield <jo...@thedailytube.com> wrote:
> >
> > I don't follow how invoking an init method in your builder is related to
> > the
> > problem of the html generation. Can you expand on that?
> >
> > I would use a component and the MarkupWriter in the
> > beginRender/afterRender
> > methods. Something like this: (this code has not been compiled so
> > compilation/functional defects may exist)
> >
> >
> > public class MyComponent {
> >
> >   void beginRender(MarkupWriter writer) {
> >     writer.element("ul");
> >     // if you have a tree then you could recursively build out the
> > unordered
> > list...
> >     for (String item : itemValues ) {
> >       writer.element("li");
> >       writer.write(item);
> >       writer.end();
> >     }
> >     // you could end the element here, ending it in afterrender
> >     // allows the component body to be evalutated.
> >   }
> >
> >   void afterRender(MarkupWriter writer) {
> >      writer.end();
> >   }
> > }
> >
> >
> > Josh
> > On 8/23/07, Ben Tomasini <be...@gmail.com> wrote:
> > >
> > > I have the same requirement mentioned in #2.  What is the best
> approach
> > to
> > > handle this with Tapestry 5?  I am thinking of just eager loading a
> > > service
> > > and invoking the init method in the builder method of the module.  Any
> > > other
> > > thoughts?
> > >
> > > I think this was the Tapestry 4 way:
> > >
> > >
> >
> http://tapestry.apache.org/tapestry4/tapestry/hivedocs/module/tapestry.init.html
> > >
> > > Ben
> > >
> > > On 6/5/07, Erik Vullings <er...@gmail.com> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I've recently started working with T5 because I liked a lot what
> I've
> > > > seen! I therefore have some basic questions, and I hope you can help
> > > > me with them:
> > > >
> > > > 1. I've started changing the quickstart project to move a current
> > > > struts2-spring-jdbc application to T5. Where can I put my dao
> > > > initialization  (creation of hsqldb tables, which used to be done
> via
> > > > my ContextListener class in struts2)?
> > > >
> > > > 2. In my existing application, I use a (folder-like) tree based on
> the
> > > > www.dhtmlgoodies.com drag-drop-folder-tree. It is based on a
> standard
> > > > HTML unordered list, which I generate in my page's java class. In
> the
> > > > accompanying HTML file, I use "${formattedTree}" However, when I
> > > > return the formattedTree "<ul><li>..." it becomes &lt;ul&gt; etc.
> How
> > > > can I change the encoding, in other words, output raw HTML to the
> HTML
> > > > template file.
> > > >
> > > > 3. Related to Q2, are there any T5 tutorials on how to develop a
> tree
> > > > component, similar to a grid component? Or does someone already have
> > > > it?
> > > >
> > > > 4. Is it possible to enable T5 javadoc help to display in the
> Eclipse
> > > IDE?
> > > >
> > > > Thanks for your help,
> > > > Erik
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > --
> > TheDailyTube.com. Sign up and get the best new videos on the internet
> > delivered fresh to your inbox.
> >
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc

Posted by Ben Tomasini <be...@gmail.com>.
Doh.

I meant #1.

Thanks.

Ben

On 8/23/07, Josh Canfield <jo...@thedailytube.com> wrote:
>
> I don't follow how invoking an init method in your builder is related to
> the
> problem of the html generation. Can you expand on that?
>
> I would use a component and the MarkupWriter in the
> beginRender/afterRender
> methods. Something like this: (this code has not been compiled so
> compilation/functional defects may exist)
>
>
> public class MyComponent {
>
>   void beginRender(MarkupWriter writer) {
>     writer.element("ul");
>     // if you have a tree then you could recursively build out the
> unordered
> list...
>     for (String item : itemValues ) {
>       writer.element("li");
>       writer.write(item);
>       writer.end();
>     }
>     // you could end the element here, ending it in afterrender
>     // allows the component body to be evalutated.
>   }
>
>   void afterRender(MarkupWriter writer) {
>      writer.end();
>   }
> }
>
>
> Josh
> On 8/23/07, Ben Tomasini <be...@gmail.com> wrote:
> >
> > I have the same requirement mentioned in #2.  What is the best approach
> to
> > handle this with Tapestry 5?  I am thinking of just eager loading a
> > service
> > and invoking the init method in the builder method of the module.  Any
> > other
> > thoughts?
> >
> > I think this was the Tapestry 4 way:
> >
> >
> http://tapestry.apache.org/tapestry4/tapestry/hivedocs/module/tapestry.init.html
> >
> > Ben
> >
> > On 6/5/07, Erik Vullings <er...@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > I've recently started working with T5 because I liked a lot what I've
> > > seen! I therefore have some basic questions, and I hope you can help
> > > me with them:
> > >
> > > 1. I've started changing the quickstart project to move a current
> > > struts2-spring-jdbc application to T5. Where can I put my dao
> > > initialization  (creation of hsqldb tables, which used to be done via
> > > my ContextListener class in struts2)?
> > >
> > > 2. In my existing application, I use a (folder-like) tree based on the
> > > www.dhtmlgoodies.com drag-drop-folder-tree. It is based on a standard
> > > HTML unordered list, which I generate in my page's java class. In the
> > > accompanying HTML file, I use "${formattedTree}" However, when I
> > > return the formattedTree "<ul><li>..." it becomes &lt;ul&gt; etc. How
> > > can I change the encoding, in other words, output raw HTML to the HTML
> > > template file.
> > >
> > > 3. Related to Q2, are there any T5 tutorials on how to develop a tree
> > > component, similar to a grid component? Or does someone already have
> > > it?
> > >
> > > 4. Is it possible to enable T5 javadoc help to display in the Eclipse
> > IDE?
> > >
> > > Thanks for your help,
> > > Erik
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
>
>
>
> --
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
>

Re: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc

Posted by Josh Canfield <jo...@thedailytube.com>.
I don't follow how invoking an init method in your builder is related to the
problem of the html generation. Can you expand on that?

I would use a component and the MarkupWriter in the beginRender/afterRender
methods. Something like this: (this code has not been compiled so
compilation/functional defects may exist)


public class MyComponent {

  void beginRender(MarkupWriter writer) {
    writer.element("ul");
    // if you have a tree then you could recursively build out the unordered
list...
    for (String item : itemValues ) {
      writer.element("li");
      writer.write(item);
      writer.end();
    }
    // you could end the element here, ending it in afterrender
    // allows the component body to be evalutated.
  }

  void afterRender(MarkupWriter writer) {
     writer.end();
  }
}


Josh
On 8/23/07, Ben Tomasini <be...@gmail.com> wrote:
>
> I have the same requirement mentioned in #2.  What is the best approach to
> handle this with Tapestry 5?  I am thinking of just eager loading a
> service
> and invoking the init method in the builder method of the module.  Any
> other
> thoughts?
>
> I think this was the Tapestry 4 way:
>
> http://tapestry.apache.org/tapestry4/tapestry/hivedocs/module/tapestry.init.html
>
> Ben
>
> On 6/5/07, Erik Vullings <er...@gmail.com> wrote:
> >
> > Hi,
> >
> > I've recently started working with T5 because I liked a lot what I've
> > seen! I therefore have some basic questions, and I hope you can help
> > me with them:
> >
> > 1. I've started changing the quickstart project to move a current
> > struts2-spring-jdbc application to T5. Where can I put my dao
> > initialization  (creation of hsqldb tables, which used to be done via
> > my ContextListener class in struts2)?
> >
> > 2. In my existing application, I use a (folder-like) tree based on the
> > www.dhtmlgoodies.com drag-drop-folder-tree. It is based on a standard
> > HTML unordered list, which I generate in my page's java class. In the
> > accompanying HTML file, I use "${formattedTree}" However, when I
> > return the formattedTree "<ul><li>..." it becomes &lt;ul&gt; etc. How
> > can I change the encoding, in other words, output raw HTML to the HTML
> > template file.
> >
> > 3. Related to Q2, are there any T5 tutorials on how to develop a tree
> > component, similar to a grid component? Or does someone already have
> > it?
> >
> > 4. Is it possible to enable T5 javadoc help to display in the Eclipse
> IDE?
> >
> > Thanks for your help,
> > Erik
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

Re: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc

Posted by Robin Helgelin <lo...@gmail.com>.
On 8/24/07, Kheldar666 <ma...@liber-mundi.org> wrote:
>
> I do this :
>
>
>
> >       In AppModule.java :
> >
> >       public void
> > contributeApplicationInitializer(OrderedConfiguration<ApplicationInitializerFilter>
> > configuration) {
> >               configuration.add("mainModuleInitializer", new
> > MainModuleInitializer());
> >       }
> >
> > With MainModuleInitializer implementing ApplicationInitializerFilter

Oh, nice! Didn't even know there was such a filter :)

-- 
        regards,
        Robin

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


Re: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc

Posted by Kheldar666 <ma...@liber-mundi.org>.
I do this :



> 	In AppModule.java :
> 
> 	public void
> contributeApplicationInitializer(OrderedConfiguration<ApplicationInitializerFilter>
> configuration) {
> 	        configuration.add("mainModuleInitializer", new
> MainModuleInitializer());
> 	}
> 
> With MainModuleInitializer implementing ApplicationInitializerFilter
> 
> 


Robin Helgelin wrote:
> 
> On 8/23/07, Ben Tomasini <be...@gmail.com> wrote:
>> I have the same requirement mentioned in #2.  What is the best approach
>> to
>> handle this with Tapestry 5?  I am thinking of just eager loading a
>> service
>> and invoking the init method in the builder method of the module.  Any
>> other
>> thoughts?
>> > 1. I've started changing the quickstart project to move a current
>> > struts2-spring-jdbc application to T5. Where can I put my dao
>> > initialization  (creation of hsqldb tables, which used to be done via
>> > my ContextListener class in struts2)?
> 
> I use an @EagerLoad service similar to this, example code can be found
> here:
> <http://www.localhost.nu/svn/public/tapestry5-acegi-example/src/main/java/nu/localhost/tapestry/acegi/example/services/AppModule.java>
> 
> -- 
>         regards,
>         Robin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5-questions%3A-adding-my-own-initializations--outputing-pre-formatted-HTML--tree-component--javadoc-tf3872028.html#a12309051
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc

Posted by Robin Helgelin <lo...@gmail.com>.
On 8/23/07, Ben Tomasini <be...@gmail.com> wrote:
> I have the same requirement mentioned in #2.  What is the best approach to
> handle this with Tapestry 5?  I am thinking of just eager loading a service
> and invoking the init method in the builder method of the module.  Any other
> thoughts?
> > 1. I've started changing the quickstart project to move a current
> > struts2-spring-jdbc application to T5. Where can I put my dao
> > initialization  (creation of hsqldb tables, which used to be done via
> > my ContextListener class in struts2)?

I use an @EagerLoad service similar to this, example code can be found here:
<http://www.localhost.nu/svn/public/tapestry5-acegi-example/src/main/java/nu/localhost/tapestry/acegi/example/services/AppModule.java>

-- 
        regards,
        Robin

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