You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Daniel M Garland <da...@titanemail.com> on 2005/06/21 17:35:32 UTC
Tapestry and SSI
Hi
Can I use server-side includes as part of a HTML template?
TIA
--
Regards,
*Dan Garland*
daniel.garland@titanemail.com <ma...@titanemail.com>
Tel: +44 (0) 207 803 1947
Mob: +44 (0) 7979 770053
ICQ: 120963437
AIM: dmgarland1767
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and SSI
Posted by Jamie Orchard-Hays <ja...@dang.com>.
thanks, Shawn!
On Jun 21, 2005, at 5:50 PM, Shawn Church wrote:
> Ok, you can download the Include component here:
> http://www.boxity.com/tapestry.html
>
> This component depends on commons-httpclient and commons-logging, but
> I've included all the dependencies with the source project.
>
> Sorry for the lame page design, but I didn't have much time to spend on
> it this afternoon. I will probably dress it up later, especially if I
> add other components.
>
> I've included some documentation on that page as well. I've only used
> this on some of my internal projects, so it is pretty basic in
> functionality, but it has worked well for me.
>
> Please let me know if you have any problems or suggestions.
>
> Shawn
>
> Quoting Shawn Church <sh...@boxity.com>:
>
>> Sure, I would be happy to. I will get it packaged up as soon as
>> possible.
>>
>> Shawn
>>
>> Quoting Jamie Orchard-Hays <ja...@dang.com>:
>>
>>> Hey Shawn, could you share that component? I have a need for
>>> something
>>> like that.
>>>
>>> Thanks,
>>>
>>> Jamie
>>>
>>> Shawn Church wrote:
>>>> You can normally just use the Block and RenderBlock components.
>> I
>>>> however recently needed to include company-wide navigation in my
>>> apps,
>>>> and I didn't want to duplicate the navigation across all of my
>>> Tapestry
>>>> applications. I also needed to be able to support immediate
>>> updates to
>>>> the navigation content, which is difficult with Tapestry due to
>> its
>>> page
>>>> caching features. I wrote a very simplistic Include component
>>> which
>>>> basically just retrieves the data from a specified URL and
>> inserts
>>>> everything in place. The only real downsides are that the
>> contents
>>> must
>>>> be static and relative links should be avoided (or handled).
>>>>
>>>> Shawn
>>>>
>>>> Quoting Daniel M Garland <da...@titanemail.com>:
>>>>
>>>>
>>>>> Hi
>>>>>
>>>>> Can I use server-side includes as part of a HTML template?
>>>>>
>>>>> TIA
>>>>> --
>>>>> Regards,
>>>>>
>>>>> *Dan Garland*
>>>>> daniel.garland@titanemail.com
>>> <ma...@titanemail.com>
>>>>> Tel: +44 (0) 207 803 1947
>>>>> Mob: +44 (0) 7979 770053
>>>>> ICQ: 120963437
>>>>> AIM: dmgarland1767
>>>>>
>>>>>
>>>>>
>>>
>>>> ____________________________________________________________________
>>>> __
>>>>> This email has been scanned by the MessageLabs Email Security
>>>>> System.
>>>>> For more information please visit
>> http://www.messagelabs.com/email
>>>
>>>
>>>> ____________________________________________________________________
>>>> __
>>>>>
>>>
>>>> --------------------------------------------------------------------
>>>> -
>>>>> To unsubscribe, e-mail:
>>> tapestry-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail:
>>>>> tapestry-user-help@jakarta.apache.org
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail:
>>> tapestry-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>> tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> tapestry-user-help@jakarta.apache.org
>>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> tapestry-user-help@jakarta.apache.org
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and SSI
Posted by Shawn Church <sh...@boxity.com>.
Ok, you can download the Include component here:
http://www.boxity.com/tapestry.html
This component depends on commons-httpclient and commons-logging, but
I've included all the dependencies with the source project.
Sorry for the lame page design, but I didn't have much time to spend on
it this afternoon. I will probably dress it up later, especially if I
add other components.
I've included some documentation on that page as well. I've only used
this on some of my internal projects, so it is pretty basic in
functionality, but it has worked well for me.
Please let me know if you have any problems or suggestions.
Shawn
Quoting Shawn Church <sh...@boxity.com>:
> Sure, I would be happy to. I will get it packaged up as soon as
> possible.
>
> Shawn
>
> Quoting Jamie Orchard-Hays <ja...@dang.com>:
>
> > Hey Shawn, could you share that component? I have a need for
> > something
> > like that.
> >
> > Thanks,
> >
> > Jamie
> >
> > Shawn Church wrote:
> > > You can normally just use the Block and RenderBlock components.
> I
> > > however recently needed to include company-wide navigation in my
> > apps,
> > > and I didn't want to duplicate the navigation across all of my
> > Tapestry
> > > applications. I also needed to be able to support immediate
> > updates to
> > > the navigation content, which is difficult with Tapestry due to
> its
> > page
> > > caching features. I wrote a very simplistic Include component
> > which
> > > basically just retrieves the data from a specified URL and
> inserts
> > > everything in place. The only real downsides are that the
> contents
> > must
> > > be static and relative links should be avoided (or handled).
> > >
> > > Shawn
> > >
> > > Quoting Daniel M Garland <da...@titanemail.com>:
> > >
> > >
> > >>Hi
> > >>
> > >>Can I use server-side includes as part of a HTML template?
> > >>
> > >>TIA
> > >>--
> > >>Regards,
> > >>
> > >>*Dan Garland*
> > >>daniel.garland@titanemail.com
> > <ma...@titanemail.com>
> > >>Tel: +44 (0) 207 803 1947
> > >>Mob: +44 (0) 7979 770053
> > >>ICQ: 120963437
> > >>AIM: dmgarland1767
> > >>
> > >>
> > >>
> >
> >>______________________________________________________________________
> > >>This email has been scanned by the MessageLabs Email Security
> > >>System.
> > >>For more information please visit
> http://www.messagelabs.com/email
> >
> >
> >>______________________________________________________________________
> > >>
> >
> >>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > >>For additional commands, e-mail:
> > >>tapestry-user-help@jakarta.apache.org
> > >>
> > >
> > >
> > >
> > >
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and SSI
Posted by Shawn Church <sh...@boxity.com>.
Sure, I would be happy to. I will get it packaged up as soon as possible.
Shawn
Quoting Jamie Orchard-Hays <ja...@dang.com>:
> Hey Shawn, could you share that component? I have a need for
> something
> like that.
>
> Thanks,
>
> Jamie
>
> Shawn Church wrote:
> > You can normally just use the Block and RenderBlock components. I
> > however recently needed to include company-wide navigation in my
> apps,
> > and I didn't want to duplicate the navigation across all of my
> Tapestry
> > applications. I also needed to be able to support immediate
> updates to
> > the navigation content, which is difficult with Tapestry due to its
> page
> > caching features. I wrote a very simplistic Include component
> which
> > basically just retrieves the data from a specified URL and inserts
> > everything in place. The only real downsides are that the contents
> must
> > be static and relative links should be avoided (or handled).
> >
> > Shawn
> >
> > Quoting Daniel M Garland <da...@titanemail.com>:
> >
> >
> >>Hi
> >>
> >>Can I use server-side includes as part of a HTML template?
> >>
> >>TIA
> >>--
> >>Regards,
> >>
> >>*Dan Garland*
> >>daniel.garland@titanemail.com
> <ma...@titanemail.com>
> >>Tel: +44 (0) 207 803 1947
> >>Mob: +44 (0) 7979 770053
> >>ICQ: 120963437
> >>AIM: dmgarland1767
> >>
> >>
> >>
> >>______________________________________________________________________
> >>This email has been scanned by the MessageLabs Email Security
> >>System.
> >>For more information please visit http://www.messagelabs.com/email
>
> >>______________________________________________________________________
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail:
> >>tapestry-user-help@jakarta.apache.org
> >>
> >
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and SSI
Posted by Jamie Orchard-Hays <ja...@dang.com>.
Hey Shawn, could you share that component? I have a need for something
like that.
Thanks,
Jamie
Shawn Church wrote:
> You can normally just use the Block and RenderBlock components. I
> however recently needed to include company-wide navigation in my apps,
> and I didn't want to duplicate the navigation across all of my Tapestry
> applications. I also needed to be able to support immediate updates to
> the navigation content, which is difficult with Tapestry due to its page
> caching features. I wrote a very simplistic Include component which
> basically just retrieves the data from a specified URL and inserts
> everything in place. The only real downsides are that the contents must
> be static and relative links should be avoided (or handled).
>
> Shawn
>
> Quoting Daniel M Garland <da...@titanemail.com>:
>
>
>>Hi
>>
>>Can I use server-side includes as part of a HTML template?
>>
>>TIA
>>--
>>Regards,
>>
>>*Dan Garland*
>>daniel.garland@titanemail.com <ma...@titanemail.com>
>>Tel: +44 (0) 207 803 1947
>>Mob: +44 (0) 7979 770053
>>ICQ: 120963437
>>AIM: dmgarland1767
>>
>>
>>
>>______________________________________________________________________
>>This email has been scanned by the MessageLabs Email Security
>>System.
>>For more information please visit http://www.messagelabs.com/email
>>______________________________________________________________________
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail:
>>tapestry-user-help@jakarta.apache.org
>>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Anyone looked at BetterPetShop?
Posted by Pablo Ruggia <pr...@gmail.com>.
Yes, Tapestry use class enhacement.
On 6/30/05, Vadim Pesochinskiy <vp...@gmail.com> wrote:
>
> Hello!
>
> Looking at better pet shop (betterpetshop.dev.java.net<http://betterpetshop.dev.java.net>)
> application, and
> cannot understand why most of page classes are abstract. Abstract
> methods are getters and setters. There are no concrete classes that
> extend them. Does Tapestry use run-time class enhancing for page classes?
>
>
Re: Anyone looked at BetterPetShop?
Posted by Pablo Ruggia <pr...@gmail.com>.
On 7/1/05, Vadim Pesochinskiy <vp...@gmail.com> wrote:
>
> Yes, that helps. Thanks a lot.
>
> Bright idea, it would be interesting to try find bugs in code that does
> not exist.
That code is generated by the framework, tested by thounthends of people. I
don't think you'll gonna need to debug it. Also class enhacement helps a lot
to reduce the repetitive code.
I am wondering how far run-time byte code generation will go...
>
> Todd O'Bryan wrote:
>
> > Because if you implement the methods, you're responsible for
> > initializing and otherwise dealing with the page properties. If you
> > leave them abstract Tapestry takes care of all of that for you. You
> > only have to even declare the abstract methods if you actually call
> > them in your own Java code, and that's just to make the compiler
> > happy. Any calls that Tapestry makes internally (to set or get
> > properties from the page) happen automatically.
> >
> > It's a little confusing and indirect, but it really does make your
> > life easier.
> >
> > HTH,
> > Todd
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
RE: Anyone looked at BetterPetShop?
Posted by Adam Saltiel <ad...@btinternet.com>.
Well, you don't find bugs in the enhanced code, the bugs (runtime
exceptions) point back to your own code. After a while of working like
this, and knowing your own app, you begin to understand where the bugs
originate by e.g. looking at the stack trace and thinking about how
things should be working by keeping in mind the architecture of the app.
There is also a clear distinction between what is set up as components
and in the module descriptor and what you add in your own code. That is
there are typical bugs associated with the former and once that is
stable it is possible to work on elaborating your code to take account
of, say, business logic or display requirements only touching your .jwc
in a very controlled way, so you would have a very good idea where the
bugs originate at this stage.
Adam
> -----Original Message-----
> From: Vadim Pesochinskiy [mailto:vpesochi@gmail.com]
> Sent: Friday, July 01, 2005 5:19 AM
> To: Tapestry users
> Subject: Re: Anyone looked at BetterPetShop?
>
> Yes, that helps. Thanks a lot.
>
> Bright idea, it would be interesting to try find bugs in code that
does
> not exist. I am wondering how far run-time byte code generation will
go...
>
> Todd O'Bryan wrote:
>
> > Because if you implement the methods, you're responsible for
> > initializing and otherwise dealing with the page properties. If you
> > leave them abstract Tapestry takes care of all of that for you. You
> > only have to even declare the abstract methods if you actually call
> > them in your own Java code, and that's just to make the compiler
> > happy. Any calls that Tapestry makes internally (to set or get
> > properties from the page) happen automatically.
> >
> > It's a little confusing and indirect, but it really does make your
> > life easier.
> >
> > HTH,
> > Todd
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Anyone looked at BetterPetShop?
Posted by Vadim Pesochinskiy <vp...@gmail.com>.
Yes, that helps. Thanks a lot.
Bright idea, it would be interesting to try find bugs in code that does
not exist. I am wondering how far run-time byte code generation will go...
Todd O'Bryan wrote:
> Because if you implement the methods, you're responsible for
> initializing and otherwise dealing with the page properties. If you
> leave them abstract Tapestry takes care of all of that for you. You
> only have to even declare the abstract methods if you actually call
> them in your own Java code, and that's just to make the compiler
> happy. Any calls that Tapestry makes internally (to set or get
> properties from the page) happen automatically.
>
> It's a little confusing and indirect, but it really does make your
> life easier.
>
> HTH,
> Todd
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Anyone looked at BetterPetShop?
Posted by Todd O'Bryan <to...@mac.com>.
Because if you implement the methods, you're responsible for
initializing and otherwise dealing with the page properties. If you
leave them abstract Tapestry takes care of all of that for you. You
only have to even declare the abstract methods if you actually call
them in your own Java code, and that's just to make the compiler
happy. Any calls that Tapestry makes internally (to set or get
properties from the page) happen automatically.
It's a little confusing and indirect, but it really does make your
life easier.
HTH,
Todd
On Jun 30, 2005, at 9:22 PM, Vadim Pesochinskiy wrote:
> OK. Here is an example of page class that he has. Abstract methods
> are getters and setters. Same methods are referenced in
> corresponding .page file, also listed below. I am absolutely
> clueless as to what would be the reason for leaving this methods
> abstract.
>
> I would imagine tapestry will do enhancing to wrap implementations
> of setters to know if object has to be stored in session, but why
> would you want to leave methods and class abstract and not have
> class that implements it?
>
> I am pondering if he uses some code generation to create java beans
> that are domain objects used with hibernate, but I do not see any
> evidence of that anywhere in the source tree or build files.
>
>
>
> package org.apache.tapestry.pets.presentation.pages;
>
> import johnmammen.betterpetshop.service.PetshopManager;
>
> import org.apache.tapestry.IRequestCycle;
> import org.apache.tapestry.event.PageEvent;
> import org.apache.tapestry.event.PageRenderListener;
> import org.apache.tapestry.pets.PetshopBasePage;
>
> import org.apache.tapestry.pets.domain.model.IProduct;
>
> import org.apache.tapestry.pets.presentation.components.PagedModel;
>
> public abstract class CategoryPage extends PetshopBasePage implements
> PageRenderListener {
>
> //for getting the petshop service
> public abstract PetshopManager getPetshopService();
>
> public void pageBeginRender(PageEvent event) {
> if (getModel() == null)
> setModel(new PagedModel());
>
> if (getCategory() != null) {
> //getting the petshop service
> setProductList(getPetshopService().findByCategory
> (getCategory()));
> }
>
> }
>
> public void selectItem(IRequestCycle cycle) {
> Object[] parameters = cycle.getServiceParameters();
> String prodid = ((String) parameters[0]);
> String prodname = ((String) parameters[1]);
> ProductCategoryPage productcategory = (ProductCategoryPage)
> cycle
> .getPage("ProductCategory");
> productcategory.setProdID(prodid);
> productcategory.setProdName(prodname);
> cycle.activate(productcategory);
> }
>
> public void directJumpToPage(IRequestCycle cycle) {
> Object[] parameters = cycle.getServiceParameters();
> int page = ((Integer) parameters[0]).intValue();
> int pCount = ((Integer) parameters[1]).intValue();
> setCategory((String) parameters[2]);
>
> PagedModel nmodel = new PagedModel();
> nmodel.setPageCount(pCount);
> nmodel.setPageToShow(page);
> setModel(nmodel);
> }
>
> public abstract void setCategory(String value);
>
> public abstract String getCategory();
>
> public abstract void setProductList(IProduct[] productList);
>
> public abstract IProduct[] getProductList();
>
> public abstract int getProductPage();
>
> public abstract void setProductPage(int productPage);
>
> public abstract IProduct getProduct();
>
> public abstract void setProduct(IProduct product);
>
> public abstract PagedModel getModel();
>
> public abstract void setModel(PagedModel model);
>
> }
>
> <?xml version="1.0"?>
> <!DOCTYPE page-specification PUBLIC
> "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
> "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
>
> <page-specification
> class="org.apache.tapestry.pets.presentation.pages.CategoryPage">
>
> <property-specification name="category" type="java.lang.String"/>
> <property-specification name="product"
> type="org.apache.tapestry.pets.domain.model.IProduct"/>
> <property-specification name="productList"
> type="org.apache.tapestry.pets.domain.model.IProduct[]"/>
> <property-specification name="productPage" type="int"/>
> <property-specification name="model"
> type="org.apache.tapestry.pets.presentation.components.PagedModel"/>
> <property-specification name="petshopService"
> type="johnmammen.betterpetshop.service.PetshopManager">
> global.appContext.getBean("petshopService")
> </property-specification>
> </page-specification>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Anyone looked at BetterPetShop?
Posted by Vadim Pesochinskiy <vp...@gmail.com>.
OK. Here is an example of page class that he has. Abstract methods are
getters and setters. Same methods are referenced in corresponding .page
file, also listed below. I am absolutely clueless as to what would be
the reason for leaving this methods abstract.
I would imagine tapestry will do enhancing to wrap implementations of
setters to know if object has to be stored in session, but why would you
want to leave methods and class abstract and not have class that
implements it?
I am pondering if he uses some code generation to create java beans that
are domain objects used with hibernate, but I do not see any evidence of
that anywhere in the source tree or build files.
package org.apache.tapestry.pets.presentation.pages;
import johnmammen.betterpetshop.service.PetshopManager;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.event.PageEvent;
import org.apache.tapestry.event.PageRenderListener;
import org.apache.tapestry.pets.PetshopBasePage;
import org.apache.tapestry.pets.domain.model.IProduct;
import org.apache.tapestry.pets.presentation.components.PagedModel;
public abstract class CategoryPage extends PetshopBasePage implements
PageRenderListener {
//for getting the petshop service
public abstract PetshopManager getPetshopService();
public void pageBeginRender(PageEvent event) {
if (getModel() == null)
setModel(new PagedModel());
if (getCategory() != null) {
//getting the petshop service
setProductList(getPetshopService().findByCategory(getCategory()));
}
}
public void selectItem(IRequestCycle cycle) {
Object[] parameters = cycle.getServiceParameters();
String prodid = ((String) parameters[0]);
String prodname = ((String) parameters[1]);
ProductCategoryPage productcategory = (ProductCategoryPage) cycle
.getPage("ProductCategory");
productcategory.setProdID(prodid);
productcategory.setProdName(prodname);
cycle.activate(productcategory);
}
public void directJumpToPage(IRequestCycle cycle) {
Object[] parameters = cycle.getServiceParameters();
int page = ((Integer) parameters[0]).intValue();
int pCount = ((Integer) parameters[1]).intValue();
setCategory((String) parameters[2]);
PagedModel nmodel = new PagedModel();
nmodel.setPageCount(pCount);
nmodel.setPageToShow(page);
setModel(nmodel);
}
public abstract void setCategory(String value);
public abstract String getCategory();
public abstract void setProductList(IProduct[] productList);
public abstract IProduct[] getProductList();
public abstract int getProductPage();
public abstract void setProductPage(int productPage);
public abstract IProduct getProduct();
public abstract void setProduct(IProduct product);
public abstract PagedModel getModel();
public abstract void setModel(PagedModel model);
}
<?xml version="1.0"?>
<!DOCTYPE page-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 3.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
<page-specification
class="org.apache.tapestry.pets.presentation.pages.CategoryPage">
<property-specification name="category" type="java.lang.String"/>
<property-specification name="product"
type="org.apache.tapestry.pets.domain.model.IProduct"/>
<property-specification name="productList"
type="org.apache.tapestry.pets.domain.model.IProduct[]"/>
<property-specification name="productPage" type="int"/>
<property-specification name="model"
type="org.apache.tapestry.pets.presentation.components.PagedModel"/>
<property-specification name="petshopService"
type="johnmammen.betterpetshop.service.PetshopManager">
global.appContext.getBean("petshopService")
</property-specification>
</page-specification>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: Anyone looked at BetterPetShop?
Posted by Adam Saltiel <ad...@btinternet.com>.
betterpetshop, no.
Page class runtime enhancement, yes.
Adam
> -----Original Message-----
> From: Vadim Pesochinskiy [mailto:vpesochi@gmail.com]
> Sent: Thursday, June 30, 2005 6:16 PM
> To: Tapestry users
> Subject: Anyone looked at BetterPetShop?
>
> Hello!
>
> Looking at better pet shop (betterpetshop.dev.java.net) application,
and
> cannot understand why most of page classes are abstract. Abstract
> methods are getters and setters. There are no concrete classes that
> extend them. Does Tapestry use run-time class enhancing for page
classes?
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Anyone looked at BetterPetShop?
Posted by Vadim Pesochinskiy <vp...@gmail.com>.
Hello!
Looking at better pet shop (betterpetshop.dev.java.net) application, and
cannot understand why most of page classes are abstract. Abstract
methods are getters and setters. There are no concrete classes that
extend them. Does Tapestry use run-time class enhancing for page classes?
Re: Tapestry and SSI
Posted by Shawn Church <sh...@boxity.com>.
The Include component I posted a few days ago was not really intended as
a Border component replacement, but rather as a supplement. In my case,
the Border template usually has navigation specific to the local webapp,
and the contained Include component inserts site-wide navigation links
to other apps, etc., so I don't have to copy/paste common navigation
links. Since the Include component inserts the contents of a specified
external URI, changes to that one external page are immediately
reflected across the entire site, without having to repeatedly
copy/paste those changes and also without having to redeploy all the apps.
Shawn
Quoting Robert Zeigler <ro...@scazdl.org>:
> Daniel M Garland wrote:
> > Hi
> >
> >> The only real downsides are that the contents must
> >> be static and relative links should be avoided (or handled).
> >>
> >>
> >>
> >
> > If I want a consistent navigation bar throughout the website that
> uses
> > directlinks and other tapestry components what are my options
> then?
> > Cut+paste is bound to lead to issues....
>
> I would suggest a "Border" component.
>
> Border.html
>
> <html jwcid="@Shell" title="'My App'">
> <body jwcid="@Body">
> <div id="menu">
> <ul>
> <li><a href="#" jwcid="@DirectLink">Nav1</a></li>
> ...
> </ul>
> </div>
> <div id="content">
> <span jwcid="@RenderBody"/>
> </div>
> </body>
> </html>
>
> Then, in each of your pages, you can do:
>
> <body jwcid="@Border">
> Some page text.
> </body>
>
> Voila, Everything is included nicely. :)
>
> Robert
>
> >
> > TIA
> > Cheers
> > Dan
> >
> >
> >
> ______________________________________________________________________
> > This email has been scanned by the MessageLabs Email Security
> System.
> > For more information please visit http://www.messagelabs.com/email
> >
> ______________________________________________________________________
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and SSI
Posted by Robert Zeigler <ro...@scazdl.org>.
Daniel M Garland wrote:
> Hi
>
>> The only real downsides are that the contents must
>> be static and relative links should be avoided (or handled).
>>
>>
>>
>
> If I want a consistent navigation bar throughout the website that uses
> directlinks and other tapestry components what are my options then?
> Cut+paste is bound to lead to issues....
I would suggest a "Border" component.
Border.html
<html jwcid="@Shell" title="'My App'">
<body jwcid="@Body">
<div id="menu">
<ul>
<li><a href="#" jwcid="@DirectLink">Nav1</a></li>
...
</ul>
</div>
<div id="content">
<span jwcid="@RenderBody"/>
</div>
</body>
</html>
Then, in each of your pages, you can do:
<body jwcid="@Border">
Some page text.
</body>
Voila, Everything is included nicely. :)
Robert
>
> TIA
> Cheers
> Dan
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and SSI
Posted by Daniel M Garland <da...@titanemail.com>.
Hi
>The only real downsides are that the contents must
>be static and relative links should be avoided (or handled).
>
>
>
If I want a consistent navigation bar throughout the website that uses
directlinks and other tapestry components what are my options then?
Cut+paste is bound to lead to issues....
TIA
Cheers
Dan
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Tapestry and SSI
Posted by Shawn Church <sh...@boxity.com>.
You can normally just use the Block and RenderBlock components. I
however recently needed to include company-wide navigation in my apps,
and I didn't want to duplicate the navigation across all of my Tapestry
applications. I also needed to be able to support immediate updates to
the navigation content, which is difficult with Tapestry due to its page
caching features. I wrote a very simplistic Include component which
basically just retrieves the data from a specified URL and inserts
everything in place. The only real downsides are that the contents must
be static and relative links should be avoided (or handled).
Shawn
Quoting Daniel M Garland <da...@titanemail.com>:
> Hi
>
> Can I use server-side includes as part of a HTML template?
>
> TIA
> --
> Regards,
>
> *Dan Garland*
> daniel.garland@titanemail.com <ma...@titanemail.com>
> Tel: +44 (0) 207 803 1947
> Mob: +44 (0) 7979 770053
> ICQ: 120963437
> AIM: dmgarland1767
>
>
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security
> System.
> For more information please visit http://www.messagelabs.com/email
> ______________________________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org