Hi, I want to create a small CMS. The main purpose is to make a limited number of pages configurable. Configurable means that I use a template with placeholders in which components out of a set can be filled in.
For example the template: SimpleSkeleton.tml <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Title<title> </head> <body> <t:delegate t:to="component11" /> <br /> <t:delegate t:to="component12" /> </body> </html> One of the components could be as follows: SimpleLinkedImage.tml: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> <a href="#" t:type="pagelink" t:page="page" t:context="context"> <img src="${imageUrl}" alt="${imageName}" name="${imageName}" /> </a> </div> SimpleLinkedImage.java: public class SimpleLinkedImage { private String _page; private List<String> _context; private String _imageUrl; private String _imageName; // setter and getter } Because it's not possible to predict which component would be needed and how often, I want to create it programmatically by using this code. SimpleSkeleton.java public class SimpleSkeleton { public Object getComponent11 () { linkedImage = new SimpleLinkedImage(); linkedImage.setImageUrl( "http://tapestry.apache.org/tapestry5/images/tapestry_banner.gif" ); linkedImage.setImageName( "Tapestry Banner" ); linkedImage.setPage( "start" ); linkedImage.setContext( null ); return linkedImage; } public Object getComponent12 () { linkedImage = new SimpleLinkedImage(); linkedImage.setImageUrl( "http://tapestry.apache.org/tapestry5/images/tapestry_banner.gif" ); linkedImage.setImageName( "Tapestry Banner_2" ); linkedImage.setPage( "start" ); linkedImage.setContext( null ); return linkedImage; } } But as you can imagine it dosen't work. Is there another approach to solve this problem? _______________________________________________________________________ Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
