Re: T5: CMS integration - multiple templates single controller?

2010-07-23 Thread Adam Zimowski
Okay having to try both suggestions I'm finding that requirement of a
component class is what's making this simple requirement a difficult
excercise. I was able to get templates to load from a different
location on the filesystem, but that's not really my requirement.

Here is a very simplified scenario that would totally solve my problem:

* Basically all our CMS pages are static, so the controller class
would have been an empty Java class:

public class Page1 {}
public class Page2 {}
etc etc

We are totally fine with WAR based package structure

our.app.pages.cms

where all static pages go to cms package.

So to simplify my problem, all I really need is a way for Tapestry to
load all my pages in the cms package, without a Java class with a safe
assumption that it would have been empty one.

So is there a way to make Tapestry process a template without a Java
class? That's really, all I need.

Adam

On Wed, Jul 21, 2010 at 5:19 PM, Howard Lewis Ship hls...@gmail.com wrote:
 I've managed to get more of the docs working, including Javadoc, but
 not the component report yet.

 http://tapestry.formos.com/nightly/tapx/


 On Wed, Jul 21, 2010 at 11:26 AM, Adam Zimowski zimowsk...@gmail.com wrote:
 Thank you much Guys. This is definitely giving me ways to explore. I
 will share our solution when it's ready, but may post some questions
 first :)

 On Wed, Jul 21, 2010 at 11:35 AM, Thiago H. de Paula Figueiredo
 thiag...@gmail.com wrote:
 Take a look at these past discussions:

 http://old.nabble.com/Tapestry-Templates-%2B-Scripting-Language-(CMS)-to27191065s302.html#a27191192
 http://old.nabble.com/How-to-load-tml-files-from-the-filesystem-instead-of-classpath--tp28462363s302p28469434.html


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

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



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





 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

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

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

 -
 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: CMS integration - multiple templates single controller?

2010-07-23 Thread Thiago H. de Paula Figueiredo
On Fri, 23 Jul 2010 13:26:03 -0300, Adam Zimowski zimowsk...@gmail.com  
wrote:



So is there a way to make Tapestry process a template without a Java
class? That's really, all I need.


No. On the other hand, you can have a Tapestry page to render different  
output based on activaction context or query parameters.


If I had to implement a CMS, I would use a template engine like  
Freemarker, a WYSOWYG HTML editor like FCKeditor or even some wiki-like  
language to let users edit what they want and Tapestry for the rest.


Tapestry templates were designed to be used by developers, not end users.

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

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

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



Re: T5: CMS integration - multiple templates single controller?

2010-07-23 Thread Adam Zimowski
I guess worst case scenario we can precompile these empty classes
during our publishing process. Need to verify if that will work but
that would be the work around.


On Fri, Jul 23, 2010 at 11:26 AM, Adam Zimowski zimowsk...@gmail.com wrote:
 Okay having to try both suggestions I'm finding that requirement of a
 component class is what's making this simple requirement a difficult
 excercise. I was able to get templates to load from a different
 location on the filesystem, but that's not really my requirement.

 Here is a very simplified scenario that would totally solve my problem:

 * Basically all our CMS pages are static, so the controller class
 would have been an empty Java class:

 public class Page1 {}
 public class Page2 {}
 etc etc

 We are totally fine with WAR based package structure

 our.app.pages.cms

 where all static pages go to cms package.

 So to simplify my problem, all I really need is a way for Tapestry to
 load all my pages in the cms package, without a Java class with a safe
 assumption that it would have been empty one.

 So is there a way to make Tapestry process a template without a Java
 class? That's really, all I need.

 Adam

 On Wed, Jul 21, 2010 at 5:19 PM, Howard Lewis Ship hls...@gmail.com wrote:
 I've managed to get more of the docs working, including Javadoc, but
 not the component report yet.

 http://tapestry.formos.com/nightly/tapx/


 On Wed, Jul 21, 2010 at 11:26 AM, Adam Zimowski zimowsk...@gmail.com wrote:
 Thank you much Guys. This is definitely giving me ways to explore. I
 will share our solution when it's ready, but may post some questions
 first :)

 On Wed, Jul 21, 2010 at 11:35 AM, Thiago H. de Paula Figueiredo
 thiag...@gmail.com wrote:
 Take a look at these past discussions:

 http://old.nabble.com/Tapestry-Templates-%2B-Scripting-Language-(CMS)-to27191065s302.html#a27191192
 http://old.nabble.com/How-to-load-tml-files-from-the-filesystem-instead-of-classpath--tp28462363s302p28469434.html


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

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



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





 --
 Howard M. Lewis Ship

 Creator of Apache Tapestry

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

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

 -
 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: CMS integration - multiple templates single controller?

2010-07-23 Thread Thiago H. de Paula Figueiredo
On Fri, 23 Jul 2010 13:31:59 -0300, Adam Zimowski zimowsk...@gmail.com  
wrote:



I guess worst case scenario we can precompile these empty classes
during our publishing process. Need to verify if that will work but
that would be the work around.


Why not having a single page class that loads the content to be rendered  
according to activation context or query parameters?


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

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

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



Re: T5: CMS integration - multiple templates single controller?

2010-07-23 Thread Thiago H. de Paula Figueiredo
On Fri, 23 Jul 2010 13:45:57 -0300, Adam Zimowski zimowsk...@gmail.com  
wrote:



I was thinking about that Thiago :) In fact, that's about how we do it
currently with Struts. I'm going to give this a try today.


Struts is a completely different beast when compared to Tapestry, so most  
of the approaches used in one don't apply to the other.


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

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

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



Re: T5: CMS integration - multiple templates single controller?

2010-07-23 Thread Robert Zeigler
That's how I've done it in the past.  With URL rewriting, this can be made even 
nicer in that you can map your more complicated url (with extra 
parameters/pathinfo) to a simpler url, and vice versa

Robert

On Jul 23, 2010, at 7/2311:45 AM , Adam Zimowski wrote:

 I was thinking about that Thiago :) In fact, that's about how we do it
 currently with Struts. I'm going to give this a try today.
 
 Adam
 
 On Fri, Jul 23, 2010 at 11:37 AM, Thiago H. de Paula Figueiredo
 thiag...@gmail.com wrote:
 On Fri, 23 Jul 2010 13:31:59 -0300, Adam Zimowski zimowsk...@gmail.com
 wrote:
 
 I guess worst case scenario we can precompile these empty classes
 during our publishing process. Need to verify if that will work but
 that would be the work around.
 
 Why not having a single page class that loads the content to be rendered
 according to activation context or query parameters?
 
 --
 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



Re: T5: CMS integration - multiple templates single controller?

2010-07-23 Thread Michael Gentry
On Fri, Jul 23, 2010 at 12:51 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 Struts is a completely different beast when compared to Tapestry, so most of
 the approaches used in one don't apply to the other.

I think that's why we are here, Thiago.  :-)

mrg

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



Re: T5: CMS integration - multiple templates single controller?

2010-07-23 Thread Adam Zimowski
Tapestry never disappoints! Single page loading content from
activation context is so simple and easy, it just feels like the right
way to go!

Here is what I've got which pretty much works. Static publishable
content wrapped around a layout. Few questions regarding possible
improvements:

* Is there anything fundamentally wrong with what I have (I haven't
coded Tapestry in years)?
* Is there a better way to store file content (cache?). Not sure if
reading it on each access is the right way to go.
* I supposed I need to look for the right file name myself based on
the locale? page1.html page1_fr.html etc etc. We do that currently, so
no problem if not, but checking if there is any helpful utility
resolver out there?

my.app.tapestry.components
public class Cms {

@Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
private String target;

@Inject
private Locale locale;

@Inject
private Logger log;

@BeginRender
void renderMessage(MarkupWriter writer) {

log.debug(locale.toString());

File f = new File(cms/ + target + .html);
try {
String s = FileUtils.readFileToString(f);
writer.writeRaw(s);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
writer.writeRaw(bERROR/b reading file);
}
}
}

my.app.tapestry.pages
public class Info {

@SuppressWarnings(unused)
@Property(write=false)
private String target;


void onActivate(String aParam) {
target = aParam;
}
}

Info.tml
t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd;
t:cms t:target=${target}/
/t:layout

projectRoot/cms/
 - page1.html

Requesting 127.0.0.1/info/page1.html   works like a charm :)

Adam


On Fri, Jul 23, 2010 at 12:51 PM, Michael Gentry mgen...@masslight.net wrote:
 On Fri, Jul 23, 2010 at 12:51 PM, Thiago H. de Paula Figueiredo
 thiag...@gmail.com wrote:
 Struts is a completely different beast when compared to Tapestry, so most of
 the approaches used in one don't apply to the other.

 I think that's why we are here, Thiago.  :-)

 mrg

 -
 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: CMS integration - multiple templates single controller?

2010-07-21 Thread Adam Zimowski
One of the big features of our current Struts-based app (we are
porting to T5), is the integration with content management system (we
use RedDot). What we do currently, is we have a single Struts action,
which inspects query parameter for CMS page, and dynamically streams
the markup for that page (along with some Tiles magic). We also do
some high-level URL rewriting to pretty-up page query parameter.

In Tapestry, I was relating this to having a single page controller
and multiple TML files. Is this possible? A big thing for us is that
we need our CMS pages to contain a layout component with all the
dynamic stuff, yet everything else on those pages is static, managed
through CMS studio tool by entirely different (non-technical,
business) team. These pages are to be published to a running
deployment, of course with whatever frequency.

So my questions are:

* Specifically, is it possible and if so, how, to have single
controller, multiple templates.
* Any examples of existing CMS-Tapestry integration? We are likely to
stay on RedDot with this project, but maybe there are some good ideas
out there.

Thank You

Adam

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



Re: T5: CMS integration - multiple templates single controller?

2010-07-21 Thread Howard Lewis Ship
The tapx library includes a dynamic templating component that is
probably perfect for your needs.  Unfortunately, the documentation for
tapx isn't building lately, so it's a challenge to know about it.
I'll try and work on that over the next couple of days.


On Wed, Jul 21, 2010 at 8:00 AM, Adam Zimowski zimowsk...@gmail.com wrote:
 One of the big features of our current Struts-based app (we are
 porting to T5), is the integration with content management system (we
 use RedDot). What we do currently, is we have a single Struts action,
 which inspects query parameter for CMS page, and dynamically streams
 the markup for that page (along with some Tiles magic). We also do
 some high-level URL rewriting to pretty-up page query parameter.

 In Tapestry, I was relating this to having a single page controller
 and multiple TML files. Is this possible? A big thing for us is that
 we need our CMS pages to contain a layout component with all the
 dynamic stuff, yet everything else on those pages is static, managed
 through CMS studio tool by entirely different (non-technical,
 business) team. These pages are to be published to a running
 deployment, of course with whatever frequency.

 So my questions are:

 * Specifically, is it possible and if so, how, to have single
 controller, multiple templates.
 * Any examples of existing CMS-Tapestry integration? We are likely to
 stay on RedDot with this project, but maybe there are some good ideas
 out there.

 Thank You

 Adam

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





-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

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

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

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



Re: T5: CMS integration - multiple templates single controller?

2010-07-21 Thread Thiago H. de Paula Figueiredo

Take a look at these past discussions:

http://old.nabble.com/Tapestry-Templates-%2B-Scripting-Language-(CMS)-to27191065s302.html#a27191192
http://old.nabble.com/How-to-load-tml-files-from-the-filesystem-instead-of-classpath--tp28462363s302p28469434.html


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

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

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



Re: T5: CMS integration - multiple templates single controller?

2010-07-21 Thread Adam Zimowski
Thank you much Guys. This is definitely giving me ways to explore. I
will share our solution when it's ready, but may post some questions
first :)

On Wed, Jul 21, 2010 at 11:35 AM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 Take a look at these past discussions:

 http://old.nabble.com/Tapestry-Templates-%2B-Scripting-Language-(CMS)-to27191065s302.html#a27191192
 http://old.nabble.com/How-to-load-tml-files-from-the-filesystem-instead-of-classpath--tp28462363s302p28469434.html


 --
 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: CMS integration - multiple templates single controller?

2010-07-21 Thread Howard Lewis Ship
I've managed to get more of the docs working, including Javadoc, but
not the component report yet.

http://tapestry.formos.com/nightly/tapx/


On Wed, Jul 21, 2010 at 11:26 AM, Adam Zimowski zimowsk...@gmail.com wrote:
 Thank you much Guys. This is definitely giving me ways to explore. I
 will share our solution when it's ready, but may post some questions
 first :)

 On Wed, Jul 21, 2010 at 11:35 AM, Thiago H. de Paula Figueiredo
 thiag...@gmail.com wrote:
 Take a look at these past discussions:

 http://old.nabble.com/Tapestry-Templates-%2B-Scripting-Language-(CMS)-to27191065s302.html#a27191192
 http://old.nabble.com/How-to-load-tml-files-from-the-filesystem-instead-of-classpath--tp28462363s302p28469434.html


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

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



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





-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

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

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

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