Re: Several Advices on same service

2012-10-04 Thread kheldar666
Hi,

I find out the root cause thanks to your idea Lance.

Actually when you use the @Advise twice, matching the same Interface... then
you MUST use the id parameter in the @Advice Annotation. If not Tapestry try
to create Advice ids based on the Interface name... in that case you end up
with 2 Advices with the same Ids which is not working well :)

Thanks for the help !

Martin



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Several-Advices-on-same-service-tp5716615p5716627.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



Re: Several Advices on same service

2012-10-04 Thread kheldar666
Actually in my case, the Order in which the Advices are not important.

What I don't understand is why 1 Advice is simply ignored (apparently
because the Advice creates a second ServiceMenu with the same id... )

That being said, I will look into the Advice declaration if there is
anything wrong.




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Several-Advices-on-same-service-tp5716615p5716624.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



Re: Several Advices on same service

2012-10-03 Thread kheldar666
Yes I thought about that But anyway it should work but my approach...

So i try to figure out what is going wrong as I actually hope to have
Modules developped by 3rd Parties in the future...



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Several-Advices-on-same-service-tp5716615p5716617.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



Several Advices on same service

2012-10-03 Thread kheldar666
Hi,

I am facing an issue that I know is weird, but I can put my finger on the
root cause of the issue.

Basically I have an App developped around several Tapestry Modules. One of
my Module defines a MenuService that list down all the nodes available in
the different navigation in the site.

Then I have Advisors that filters out the results returned by the
MenuService based on several constrains.

My idea is that each Module can add its own Advises to filter further more
based on new constrains.

Hence, in each Module you would find a method like this :

@Advise(serviceInterface=MenuService.class)
public static void filterMenuServiceResults(MethodAdviceReceiver 
receiver,
MenuServiceAdvisor menuServiceAdvisor, 
final SecurityManager securityManager, 
final ApplicationStateManager 
applicationStateManager) {

// AclConstrain Advisor
MethodAdvice aclma = new 
AclContrainMethodAdvice(securityManager,
applicationStateManager);
menuServiceAdvisor.addAdvice(aclma, receiver);
}

Currently I have 2 Modules doing similar things. They both use the same
MenuServiceAdvisor but add different MethodAdvice.

The result is that when I run the App, I randomly have one or the other
MethodAdvice actually really active, and I have a message in the logs sating
that a MenuService service is already existing so the second one will be
ignored ( this message appears only  when I try to add the second Advice ).

I am using Tapestry 5.3.5... and I must miss something as I know I should be
able to add several advices on 1 service.

Anyone have an idea ?

Thanks for the help :)



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Several-Advices-on-same-service-tp5716615.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



[Sharing] How to setup a Global XSS Filter in Tapestry 5

2012-08-17 Thread kheldar666
Hi all,

I post this as I had some headaches finding the proper solution and it seems
that nobody posted a similar approach here

First step in AppModule.java:

public static void bind(ServiceBinder binder) {
binder.bind(RequestFilter.class,
XSSRequestFilterImpl.class).withId("XSSRequestFilter");
}

/*
 * XSS Filtering
 */
@Contribute(RequestHandler.class)
public static void requestHandler(OrderedConfiguration
configuration,

@InjectService("XSSRequestFilter") RequestFilter xssFilter) {
configuration.add("XSSRequestFilter", xssFilter, 
"after:StaticFiles",
"before:StoreIntoGlobals");
}

Second step, you can take a look at the XSSRequestFilterImpl class :

http://code.google.com/p/theorcs/source/browse/trunk/core/src/main/java/org/libermundi/theorcs/core/tapestry/services/xss/XSSRequestFilterImpl.java

And then XSSRequestWrapper class :

http://code.google.com/p/theorcs/source/browse/trunk/core/src/main/java/org/libermundi/theorcs/core/tapestry/services/xss/XSSRequestWrapper.java

The code of the Wrapper is inspired from this article :
http://ricardozuasti.com/2012/stronger-anti-cross-site-scripting-xss-filter-for-java-web-apps/

But I slighly changed it in order to allow people to use Rich Text that
includes images.

Hope this will be usefull to someone :)

ALso if you have any feedback, feel free to share.

Martin




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Sharing-How-to-setup-a-Global-XSS-Filter-in-Tapestry-5-tp5715533.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



Re: XSS Filter and Erratic Behaviour of Tapestry 5.3.4

2012-08-17 Thread kheldar666
Hi Thiago !

Thanks for the hint ! That helped me a lot ^^

I will post the solution and the Filter as I see many times this question of
XSS filter have been asked.

Best regards,

Martin



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/XSS-Filter-and-Erratic-Behaviour-of-Tapestry-5-3-4-tp5715492p5715532.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



XSS Filter and Erratic Behaviour of Tapestry 5.3.4

2012-08-16 Thread kheldar666
Hi all,

I am currently trying to add a general XSS Filter in my application and I am
facing some really weird behavior.

Basically the Filter operate 1 time out of 5... 

Here is my approach :

In AppModule.java

public static void bind(ServiceBinder binder) {
binder.bind(HttpServletRequestFilter.class,
XSSFilterImpl.class).withId("XssFilter");
}

/*
 * XSS Filtering
 */
@Contribute(HttpServletRequestHandler.class)
public static void httpServletRequestHandler(OrderedConfiguration
configuration,

@InjectService("XssFilter")
HttpServletRequestFilter
xssFilter)  {
configuration.add("XssFilter", xssFilter, "after:IgnoredPaths",
"before:GZIP");
}

In XSSFilterImpl.java

public class XSSFilterImpl implements HttpServletRequestFilter {
private static final Logger logger =
LoggerFactory.getLogger(XSSFilterImpl.class); 

@Override
public boolean service(HttpServletRequest request, HttpServletResponse
response, HttpServletRequestHandler handler) throws IOException {
if(logger.isDebugEnabled()){
logger.debug("Wrapping Request in XSSRequestWrapper");
}

return handler.service(new XSSRequestWrapper(request), 
response);
}

}

I see the Debug Message on each request, but sometimes I have to restart
Tomcat several time for the XSSRequestWrapper to operate properly ( I am
testing on a Form submission )...

I am wondering :

- Why do I get different behavior for each restart of Tomcat
- Is there something I miss in my approach ?

Thanks for the help :-)

Martin




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/XSS-Filter-and-Erratic-Behaviour-of-Tapestry-5-3-4-tp5715492.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: [T5] Instantiate "Interfaces"

2008-06-27 Thread Kheldar666

Yes, I know how to instantiate an Object in a onSetupRender phase for
instance.

But in the case of the BeanEditForm, the problem occurs when submitting.
Maybe the BeanEditForm, on Submit, tries to create a new User before copying
all datas from the Form to the user's properties ?

So I think I don't really have a place to instantiate anything on my own (or
I humbly recognized that I really don't know how to do that... ). I tried to
use the @Persist on the property but it doesn't help :(. 

The thing is that the exact same code with a @ApplicationState instead of
the @Persist works perfectly (if User is declared in the
ApplicationStateManager), but this is not clean in terms of memory usage...

Not sure to be clear, but I hope to find a solution



Howard Lewis Ship wrote:
> 
> There currently isn't a *global* mechanism to map an interface to a
> class so that BeanEditForm can instantiate it for you.
> 
> Instead, you can add an event handler to your page for the prepare
> event.  This method is responsible for preparing the page for either
> rendering a form, or submitting a form.  You can add code to
> instantiate the UserImpl object there.
> 
> Sven's option looks wrong; that's how you define a service, which is
> orthogonal to your problem.
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--Instantiate-%22Interfaces%22-tp18153603p18157112.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]



[T5] Instantiate "Interfaces"

2008-06-27 Thread Kheldar666

Hello,

When i use Tapestry, almost my Bean are Interfaces (ex : UserImpl implements
User ). That causes me a problem sometimes, specially when using
BeanEditForm (ex : with @Parameter private User _user ). 

When I submit the form after editing a User, I have this error :

Exception instantiating instance of org.libermundi.User (for component
'Index:beaneditform.editor'): Class org.libermundi.User does not contain a
public constructor needed to autobuild.

This is normal ! User is a interface...

So, how do I tell Tapestry how to instantiate such objects ?

I tried with Alias... doesn't work at all. The only way I could make this
work is when the User is an ApplicationStateObject because I contribute to
the ApplicationStateManager.

Any idea ? Am I wrong when trying to make everything an Interface ? 

Thanks for your answers.

Regards,

Martin
-- 
View this message in context: 
http://www.nabble.com/-T5--Instantiate-%22Interfaces%22-tp18153603p18153603.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]



[T5] EventLink generate FileNotFound Warnings

2008-06-24 Thread Kheldar666

Hello Everybody,

I recently change some of my ActionLinks with EventLinks. Since that moment
I have that kind of errors :

-
For this URL :
http://127.0.0.1:8080/theorcs-main/index.layoutrenderer.portal.editmodelink:switchEditMode

I have this Warning :

18:30:09,726  WARN Credential:191 - EXCEPTION 
java.io.IOException: Syntax of file name, directory or volume incorrect
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:395)
at java.io.File.getCanonicalPath(File.java:531)

(...)

18:30:09,729  WARN ResourceCache:251 - Alias request of
'file:/C:/Developpement/Projets/TheOrcs/theorcs-main/src/main/webapp/index.layoutrenderer.portal.editmodelink:switchEditMode'
for
'file:/C:/Developpement/Projets/TheOrcs/theorcs-main/src/main/webapp/index.layoutrenderer.portal.editmodelink:switchEditMode'


It seam that when using an EventLink Tapestry tries to find a real file...
Is this normal ? The problem disappear with ActionLink. I tested on T 5.0.12
and 5.0.13, Jetty 5, Windows (vista)... Is this a JIRA issue ?

Regards,

Martin
-- 
View this message in context: 
http://www.nabble.com/-T5--EventLink-generate-FileNotFound-Warnings-tp18094894p18094894.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: T5 Services with diferent Implementation

2008-05-20 Thread Kheldar666

@InjectService("MyService1")


maxthesecond wrote:
> 
> 
> 
> I have an Interface with 2 different implementations
> 
> lets say  IMyInterface   MyImplementation1  Myimplementation2
> 
> 
> until now I only needed to use one of the implementations at once, so in
> my client code I just wrote @Inject private IMyInterface
> 
> 
> and everithing was ok, now I'm on the need to use at the same time both
> implementations 
> 
> My first idea was to write: 
> 
> binder.bind(IMyInterface.class,MyImplementation1.class).withId("Myservice1");
> binder.bind(IMyInterface.class,MyImplementation2.class).withId("MyService2");
> 
> But now the question is: How I am suposed to used it from the client side(
> I mean a page a component)?
> 
> @Inject MyService1?
> 
> thanks for the answer!
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5-Services-with-diferent-Implementation-tp17348534p17348567.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]



[T5] Refresh Application context / IoC Registry

2008-03-09 Thread Kheldar666

Hello everybody,

I am using the tapestry-spring package and I was wondering if there is a way
the refresh to WebApplicationContext ? I looked at the sources but it seems
that the implementation of WebApplicationContext does not extends
AbstractApplicationContext [1].

May be there is a way to restart the IoC Registry ? But will this also
reload the Spring context ?

This would be very usefull in developpement phases ovoiding us to restart
Jetty each time we make an update...

Thanks for answers,

Martin

[1]
http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/context/support/AbstractApplicationContext.html#refresh()
-- 
View this message in context: 
http://www.nabble.com/-T5--Refresh-Application-context---IoC-Registry-tp15925862p15925862.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: t5: home page

2008-03-07 Thread Kheldar666

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

Parameter : tapestry.start-page-name

Regards,



Angelo Chen wrote:
> 
> hi,
> 
> t5 loads start page when it is called:
> 
> http://localhost:8080/myapp
> 
> I'd like it to load home.tmp instead, any way to set it? renaming home.tml
> to start.tml is one, but i like to keep it. thanks.
> 
> A.C.
> 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-home-page-tp15890272p15891144.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]



[T5] Component report

2008-03-06 Thread Kheldar666

Hello everybody !

I'm working on a project that -for practical reasons- have in the same Maven
project several sources folders each one containing a particular SubModule
declared in the main Tapestry App. For the moment there are no Maven
modules.

I was wondering if there is a way to generate Component Report for the
rootPackage AND the SubModule(s) ?

Regards,

Martin
-- 
View this message in context: 
http://www.nabble.com/-T5--Component-report-tp15871740p15871740.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: [T5] Index pages bug ?

2008-03-03 Thread Kheldar666

Done

https://issues.apache.org/jira/browse/TAPESTRY-2226
-- 
View this message in context: 
http://www.nabble.com/-T5--Index-pages-bug---tp15806148p15810780.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]



[T5] Index pages bug ?

2008-03-03 Thread Kheldar666

Hello everybody,

I have a problem with the new index pages. The system that shortens the url,
shorten too much I think...

Exemple in the Index.tml page a the Root of my Tapestry package :

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"; >
test


The generated URL will be http://hostname/context/1 (instead of
http://hostname/context/index/1)

The problem is that it generate a 404 Error... Is this normal ? Did I
something wrong ?

Regards,

Martin

PS : The same code in an Index page in a subdirectory doesn't generate the
404. It generated a correct shorten URL like :
http://hostname/context/subdirectory/1 but it works fine.


-- 
View this message in context: 
http://www.nabble.com/-T5--Index-pages-bug---tp15806148p15806148.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: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Kheldar666

Yes ! that was it :)

I indeed had an embedded Address with all fields empty ^^. Thank you very
much to both of you :) !

I owe you at least a beer :)

Regards

Martin



Jonathan Barker wrote:
> 
> Martin,
> 
> I'm a bit confused about what you are trying to accomplish, but maybe I
> can
> toss out some ideas.
> 
> If you have loaded a User object via Hibernate:
> 
> Scenario 1: embedded Address
> If the embedded address is all null / empty fields, then the Address
> reference in User will be null.  You may want to make sure the Address
> field
> is set before rendering.  I've hit this before and had to set the address
> (if null then new) immediately after loading from hibernate.
> 
> Scenario 2: linked Address
> The same problem as Scenario 1 will apply, plus you could run into
> problems
> if the User was loaded in an earlier session trying to follow the old
> Address proxy.
> 
> You may also want to look into the ASO documentation - specifically the
> section at the bottom for ASO's requiring configuration.  You could make
> sure your address is non-null there.
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/appstate.html
> 
> Also, you can make sure your UserImpl constructor instantiates an empty
> Address object.
> 
> Jonathan
> 
> 
>> -Original Message-
>> From: Kheldar666 [mailto:[EMAIL PROTECTED]
>> Sent: Sunday, February 03, 2008 1:53 PM
>> To: users@tapestry.apache.org
>> Subject: Re: [T5] ASO, BeanEditor and Interfaces
>> 
>> 
>> Heu...
>> 
>> I allready have a full Hibernate/Spring instantiation system that works
>> perfectly well :-) .
>> 
>> I'm not trying to instanciate a Bean via Tapestry. I try to edit one that
>> is
>> allready loaded.
>> 
>> The problem for me comes from Tapestry beanEditor that tries -I think- to
>> create an empty bean using the interface Address instead of AddressImpl
>> when
>> it creates is BeanModel.
>> 
>> Maybe be I dont know how to explain my problem clearly enought... Sorry.
>> 
>> Thank you for your help :)
>> 
>> Martin
>> 
>> 
>> Sven Homburg wrote:
>> >
>> > i think you missunderstood completely the sense of hibernate entities
>> > and IOC serices.
>> >
>> > in your case i think it makes more sense to let instantiate the enties
>> > by a factory class
>> > please read http://www.hibernate.org/328.html
>> >
>> > 2008/2/3, Kheldar666 <[EMAIL PROTECTED]>:
>> >>
>> >> Well by adding this to my module :
>> >>
>> >> public static void bind(ServiceBinder binder){
>> >> binder.bind(User.class, UserImpl.class);
>> >> binder.bind(Address.class, AddressImpl.class);
>> >> }
>> >>
>> >> I solved the User instanciation problem. But It didn't solve the
>> Address
>> >> instanciation problem.
>> >>
>> >> In fact User model have an Address property. I want to user
>> BeanEditForm
>> >> to
>> >> Edit both the User and is Address. This is the component :
>> >>
>> >> 
>> >>  
>> >> 
>> >> Address
>> >> 
>> >> 
>> >>  
>> >> 
>> >>
>> >> I set this in the AppModule for my address field can be detected by
>> the
>> >> BeanEditor :
>> >>
>> >> public static void
>> >> contributeDefaultDataTypeAnalyzer(MappedConfiguration,
>> String>
>> >> configuration) {
>> >>   configuration.add(Address.class, "address");
>> >> }
>> >>
>> >> And I stiil have the InstantiationException. If I make direct
>> reference
>> >> to
>> >> the implementation classes that works fine (but I don't want to do it
>> >> that
>> >> way).
>> >>
>> >> I tried configuration.add(AddressImpl.class, "address"); but it does
>> not
>> >> work at all because tapestru can't detect the Address field in User
>> bean.
>> >>
>> >> Any ideas ?
>> >>
>> >> Regards,
>> >>
>> >> Martin
>> >>
>> >>
>> >>
>> >>
>> >> Sven Homburg wrote:
>> >> >
>> >> > this should

Re: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Kheldar666

Heu...

I allready have a full Hibernate/Spring instantiation system that works
perfectly well :-) .

I'm not trying to instanciate a Bean via Tapestry. I try to edit one that is
allready loaded.

The problem for me comes from Tapestry beanEditor that tries -I think- to
create an empty bean using the interface Address instead of AddressImpl when
it creates is BeanModel.

Maybe be I dont know how to explain my problem clearly enought... Sorry.

Thank you for your help :)

Martin


Sven Homburg wrote:
> 
> i think you missunderstood completely the sense of hibernate entities
> and IOC serices.
> 
> in your case i think it makes more sense to let instantiate the enties
> by a factory class
> please read http://www.hibernate.org/328.html
> 
> 2008/2/3, Kheldar666 <[EMAIL PROTECTED]>:
>>
>> Well by adding this to my module :
>>
>> public static void bind(ServiceBinder binder){
>> binder.bind(User.class, UserImpl.class);
>> binder.bind(Address.class, AddressImpl.class);
>> }
>>
>> I solved the User instanciation problem. But It didn't solve the Address
>> instanciation problem.
>>
>> In fact User model have an Address property. I want to user BeanEditForm
>> to
>> Edit both the User and is Address. This is the component :
>>
>> 
>>  
>> 
>> Address
>> 
>> 
>>  
>> 
>>
>> I set this in the AppModule for my address field can be detected by the
>> BeanEditor :
>>
>> public static void
>> contributeDefaultDataTypeAnalyzer(MappedConfiguration, String>
>> configuration) {
>>   configuration.add(Address.class, "address");
>> }
>>
>> And I stiil have the InstantiationException. If I make direct reference
>> to
>> the implementation classes that works fine (but I don't want to do it
>> that
>> way).
>>
>> I tried configuration.add(AddressImpl.class, "address"); but it does not
>> work at all because tapestru can't detect the Address field in User bean.
>>
>> Any ideas ?
>>
>> Regards,
>>
>> Martin
>>
>>
>>
>>
>> Sven Homburg wrote:
>> >
>> > this should help you
>> > http://wiki.apache.org/tapestry/Tapestry5HowToIocAndHibernate
>> >
>> > 2008/2/3, Kheldar666 <[EMAIL PROTECTED]>:
>> >>
>> >> Hi Everybody,
>> >>
>> >> I was wondering if ASO and BeanEditor can work with Interfaces ? At
>> the
>> >> first sight it seems not possible.
>> >>
>> >> Let's say I have this Interface and Classes :
>> >>
>> >> public interface User {
>> >> public int getId();
>> >> public void setId(int id);
>> >> public String getName();
>> >> public void setName(String name);
>> >> }
>> >>
>> >> public class UserImpl implements User {
>> >> //An implementation with Hibernate annotation for instance
>> >> }
>> >>
>> >> Everywhere in Tapestry we use Interfaces for the IoC. But if I declare
>> >> somewhere :
>> >>
>> >>
>> >> @ApplicationState
>> >> private User _user
>> >>
>> >>
>> >> I have an InstanciationException (witch is normal, because Tapestry
>> have
>> >> no
>> >> way to guess that it should instanciate UserImpl and it tries to
>> >> instanciate
>> >> an Interface).
>> >>
>> >> So my question is : is there a way to tell Tapestry to instanciate the
>> >> right
>> >> class and not the Interface (may be via contributing to some Service
>> >> configuration or something ) ? Or should I wrote a simple data object
>> >> that
>> >> can be directly instanciated and some kind of translator that would
>> >> convert
>> >> my Data Object into the class used by my internal services ?
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/-T5--ASO%2C-BeanEditor-and-Interfaces-tp15254725p15254725.html
>> >> Sent from the Tapestry - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: [EMAIL PROTE

Re: [T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Kheldar666

Well by adding this to my module :

public static void bind(ServiceBinder binder){
binder.bind(User.class, UserImpl.class);
binder.bind(Address.class, AddressImpl.class);
}

I solved the User instanciation problem. But It didn't solve the Address
instanciation problem.

In fact User model have an Address property. I want to user BeanEditForm to
Edit both the User and is Address. This is the component :


 

Address  


 
   

I set this in the AppModule for my address field can be detected by the
BeanEditor :

public static void
contributeDefaultDataTypeAnalyzer(MappedConfiguration, String>
configuration) {
  configuration.add(Address.class, "address");
}

And I stiil have the InstantiationException. If I make direct reference to
the implementation classes that works fine (but I don't want to do it that
way).

I tried configuration.add(AddressImpl.class, "address"); but it does not
work at all because tapestru can't detect the Address field in User bean.

Any ideas ?

Regards,

Martin




Sven Homburg wrote:
> 
> this should help you
> http://wiki.apache.org/tapestry/Tapestry5HowToIocAndHibernate
> 
> 2008/2/3, Kheldar666 <[EMAIL PROTECTED]>:
>>
>> Hi Everybody,
>>
>> I was wondering if ASO and BeanEditor can work with Interfaces ? At the
>> first sight it seems not possible.
>>
>> Let's say I have this Interface and Classes :
>>
>> public interface User {
>> public int getId();
>> public void setId(int id);
>> public String getName();
>> public void setName(String name);
>> }
>>
>> public class UserImpl implements User {
>> //An implementation with Hibernate annotation for instance
>> }
>>
>> Everywhere in Tapestry we use Interfaces for the IoC. But if I declare
>> somewhere :
>>
>>
>> @ApplicationState
>> private User _user
>>
>>
>> I have an InstanciationException (witch is normal, because Tapestry have
>> no
>> way to guess that it should instanciate UserImpl and it tries to
>> instanciate
>> an Interface).
>>
>> So my question is : is there a way to tell Tapestry to instanciate the
>> right
>> class and not the Interface (may be via contributing to some Service
>> configuration or something ) ? Or should I wrote a simple data object
>> that
>> can be directly instanciated and some kind of translator that would
>> convert
>> my Data Object into the class used by my internal services ?
>> --
>> View this message in context:
>> http://www.nabble.com/-T5--ASO%2C-BeanEditor-and-Interfaces-tp15254725p15254725.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]
>>
>>
> 
> 
> -- 
> with regards
> Sven Homburg
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -
> best regards
> Sven
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--ASO%2C-BeanEditor-and-Interfaces-tp15254725p15255319.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]



[T5] ASO, BeanEditor and Interfaces

2008-02-03 Thread Kheldar666

Hi Everybody,

I was wondering if ASO and BeanEditor can work with Interfaces ? At the
first sight it seems not possible.

Let's say I have this Interface and Classes :

public interface User {
public int getId();
public void setId(int id);
public String getName();
public void setName(String name);
}

public class UserImpl implements User {
//An implementation with Hibernate annotation for instance
}

Everywhere in Tapestry we use Interfaces for the IoC. But if I declare
somewhere :


@ApplicationState
private User _user


I have an InstanciationException (witch is normal, because Tapestry have no
way to guess that it should instanciate UserImpl and it tries to instanciate
an Interface).

So my question is : is there a way to tell Tapestry to instanciate the right
class and not the Interface (may be via contributing to some Service
configuration or something ) ? Or should I wrote a simple data object that
can be directly instanciated and some kind of translator that would convert
my Data Object into the class used by my internal services ?
-- 
View this message in context: 
http://www.nabble.com/-T5--ASO%2C-BeanEditor-and-Interfaces-tp15254725p15254725.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]



How to use LinkImpl in T5.0.9 ?

2008-01-30 Thread Kheldar666

Hello everybody !

Can anybody post an exemple of how to use the 'new' LinkImpl in T5.0.9 ? Do
we still have to use the Internal component ? Is there now a more elegant
and recommanded way to create a Link to an external URL -the use of an
Internal componant is not safe at all- ?

Thanks for the answers :)

Regards,

Martin


-- 
View this message in context: 
http://www.nabble.com/How-to-use-LinkImpl-in-T5.0.9---tp15177204p15177204.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: [Tapestry 5] Template question

2008-01-28 Thread Kheldar666

Yes, but Howard allready answered that it is not a good idea for the moment.



Fernando Padilla wrote:
> 
> Do you mean like skins or themes support?
> ( of which locale is just one dimensions for skins )
> 
> Kheldar666 wrote:
>> Hi again,
>> 
>> We tried your method in our Tapestry demos. It works fine, but it is not
>> very convinient for the moment. We were wondering if there is a way to
>> implement the same mecanism that is used by the "Localized Component
>> Templates". In fact this mecanism would perfectly feet our needs.
>> 
>> If it is possible to dynamicaly change Component Template based on the
>> Locale of the current user, why wouldn't it be possible based on another
>> criteria ?
>> 
>> Is there realy no way to implement such a mecanism in Tapestry ? May be
>> we
>> could tell Tapestry in which package to look for the Component templates
>> ?
>> 
>> Thanks a lot for the answer.
>> 
>> Regards,
>> 
>> Martin
>> 
>> 
>> Howard M. Lewis Ship wrote:
>>> Tapestry has always had a tight binding between the component class  
>>> and the template.  This is opposed to Struts et al, which has a weak  
>>> relationship (and a lot more configuration).
>>>
>>> To accomplish what you want to do, you can take one of several  
>>> approaches:
>>>
>>> - Have multiple pages, representing the same content in different  
>>> formats.  I.e. Article, ArticleShort, ArticleLong, ArticleRSS,  
>>> ArticlePrint, etc.
>>>
>>> - Have a component that dynamically selects another component based on  
>>> the desired format, specified via a parameter.  The metaphor here  
>>> would be a common method with a case statement.  This is roughly the  
>>> approach that the BeanEditor and Grid components use, to match  
>>> properties and their data types to components appropriate to view or  
>>> edit such a property.
>>>
>>> I tend toward the latter approach, though to accomplish some things  
>>> (such as widely differing content types :  RSS or PDF rather than text/ 
>>> html) you may need to combine the approaches.
>>>
>>>
>>>
>>> On Jan 5, 2008, at 1:44 AM, [EMAIL PROTECTED] wrote:
>>>
>>>> Hello,
>>>>
>>>> First of all I would like to wish you an happy new year, full of  
>>>> success
>>>> for you and your family :)
>>>>
>>>> My name is Martin, I work in a french web agencie as a lead  
>>>> developper and
>>>> architect, mainly on CMS applications.
>>>>
>>>> I did want to bother you with a direct question, but I asked this  
>>>> several
>>>> times on the Tapestry user mailing list, and no one was able to give  
>>>> me a
>>>> clear ( or satisfying ) answer.
>>>>
>>>> We have a client that use an old CMS of ours, and he wants us to  
>>>> develop a
>>>> new one for him. That is why I'm very interested in Tapestry 5. We  
>>>> started
>>>> to develop different Application to test Tapestry and quite  
>>>> everythings is
>>>> ok.
>>>>
>>>> But (there is always a but) there is something that I don't know how  
>>>> to do
>>>> with tapestry 5 : handeling different display methods for the same
>>>> content. On the mailing list everybody answer : use CSS. I'm sorry but
>>>> this is not good for us.
>>>>
>>>> If I want a display method that just display a Title and a Date with a
>>>> Link to the page where the content is fully displayed... CSS does not
>>>> respond to that.
>>>>
>>>> The way I see things is : I create a Bean that represent a Content  
>>>> (let
>>>> say a "Short Article" ), then I create a Component responsible for
>>>> displaying it and -in the Component or somewhere else- I should be  
>>>> able to
>>>> tell the component -on the fly before rendering operation- to use  
>>>> this of
>>>> that .tml file (all the .tml files would be present a the starting  
>>>> of the
>>>> App).
>>>>
>>>> Well, that it... Is it possible to do that (or something that would  
>>>> do the
>>>> same ) using Tapestry ?
>>>>
>>>> I hope that my question is clear and that I didn't bother you.
>>>>
>>>> Thanks for the time you spent reading my email :)
>>>>
>>>> Regards,
>>>>
>>>> Martin Papy
>>>>
>>> Howard Lewis Ship
>>> TWD Consulting, Inc.
>>> Creator: Apache Tapestry and Apache HiveMind
>>>
>>>
>>> -
>>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Re%3A--Tapestry-5--Template-question-tp14671112p15144236.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: [Tapestry 5] Template question

2008-01-28 Thread Kheldar666

Hi again,

We tried your method in our Tapestry demos. It works fine, but it is not
very convinient for the moment. We were wondering if there is a way to
implement the same mecanism that is used by the "Localized Component
Templates". In fact this mecanism would perfectly feet our needs.

If it is possible to dynamicaly change Component Template based on the
Locale of the current user, why wouldn't it be possible based on another
criteria ?

Is there realy no way to implement such a mecanism in Tapestry ? May be we
could tell Tapestry in which package to look for the Component templates ?

Thanks a lot for the answer.

Regards,

Martin


Howard M. Lewis Ship wrote:
> 
> Tapestry has always had a tight binding between the component class  
> and the template.  This is opposed to Struts et al, which has a weak  
> relationship (and a lot more configuration).
> 
> To accomplish what you want to do, you can take one of several  
> approaches:
> 
> - Have multiple pages, representing the same content in different  
> formats.  I.e. Article, ArticleShort, ArticleLong, ArticleRSS,  
> ArticlePrint, etc.
> 
> - Have a component that dynamically selects another component based on  
> the desired format, specified via a parameter.  The metaphor here  
> would be a common method with a case statement.  This is roughly the  
> approach that the BeanEditor and Grid components use, to match  
> properties and their data types to components appropriate to view or  
> edit such a property.
> 
> I tend toward the latter approach, though to accomplish some things  
> (such as widely differing content types :  RSS or PDF rather than text/ 
> html) you may need to combine the approaches.
> 
> 
> 
> On Jan 5, 2008, at 1:44 AM, [EMAIL PROTECTED] wrote:
> 
>> Hello,
>>
>> First of all I would like to wish you an happy new year, full of  
>> success
>> for you and your family :)
>>
>> My name is Martin, I work in a french web agencie as a lead  
>> developper and
>> architect, mainly on CMS applications.
>>
>> I did want to bother you with a direct question, but I asked this  
>> several
>> times on the Tapestry user mailing list, and no one was able to give  
>> me a
>> clear ( or satisfying ) answer.
>>
>> We have a client that use an old CMS of ours, and he wants us to  
>> develop a
>> new one for him. That is why I'm very interested in Tapestry 5. We  
>> started
>> to develop different Application to test Tapestry and quite  
>> everythings is
>> ok.
>>
>> But (there is always a but) there is something that I don't know how  
>> to do
>> with tapestry 5 : handeling different display methods for the same
>> content. On the mailing list everybody answer : use CSS. I'm sorry but
>> this is not good for us.
>>
>> If I want a display method that just display a Title and a Date with a
>> Link to the page where the content is fully displayed... CSS does not
>> respond to that.
>>
>> The way I see things is : I create a Bean that represent a Content  
>> (let
>> say a "Short Article" ), then I create a Component responsible for
>> displaying it and -in the Component or somewhere else- I should be  
>> able to
>> tell the component -on the fly before rendering operation- to use  
>> this of
>> that .tml file (all the .tml files would be present a the starting  
>> of the
>> App).
>>
>> Well, that it... Is it possible to do that (or something that would  
>> do the
>> same ) using Tapestry ?
>>
>> I hope that my question is clear and that I didn't bother you.
>>
>> Thanks for the time you spent reading my email :)
>>
>> Regards,
>>
>> Martin Papy
>>
> 
> Howard Lewis Ship
> TWD Consulting, Inc.
> Creator: Apache Tapestry and Apache HiveMind
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Re%3A--Tapestry-5--Template-question-tp14671112p15140169.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: [T5] Service Module declaration

2007-09-06 Thread Kheldar666

Yes that's what I thought, but it is not very convinient...



Francois Armand wrote:
> 
> Thiago H de Paula Figueiredo wrote:
>> On Thu, 06 Sep 2007 10:03:04 -0300, Francois Armand 
>> <[EMAIL PROTECTED]> wrote:
>>
>>> I saw that in a (old) thread : 
>>> http://mail-archives.apache.org/mod_mbox/tapestry-users/200704.mbox/[EMAIL 
>>> PROTECTED] 
>>>
>>> But I can't tell you anymore, since a didn't test it.
>>
>> Just put a Tapestry-Module-Classes entry in some JAR in your 
>> application classpath and Tapestry-IoC will take care of the rest. ;)
>>
> Yes, that is what the thread explains...
> 
> -- 
> Francois Armand
> Etudes & Développements J2EE
> Groupe Linagora - http://www.linagora.com
> Tél.: +33 (0)1 58 18 68 28
> ---
> InterLDAP - http://interldap.org 
> FederID - http://www.federid.org/
> Open Source identities management and federation
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-T5--Service-Module-declaration-tf4391945.html#a12522874
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] Service Module declaration

2007-09-06 Thread Kheldar666

Hi everybody,

I'm devellopping a Tapestry application that will use several packages
(because I use a JPF plugin architecture).

So in Eclipse, I have several source folder. One for each plug in I
developp.

My problem is that I don't find a way to tell Tapestry IoC that there is a
Module in package A and another in package B.

I don't want to use @SubModule in AppModule because the packages a supposed
to be plugins (so they can be there or not) and it seems the manifest file
can only be used within a jar file (and I can't create a jar file each time
I test my plug in :s )

Is there any other solution to tell Tapestry IoC that there's a Module
somewhere else ?

Cheers

Martin
-- 
View this message in context: 
http://www.nabble.com/-T5--Service-Module-declaration-tf4391945.html#a12521931
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: T5 questions: adding my own initializations; outputing pre-formatted HTML; tree component; javadoc

2007-08-24 Thread Kheldar666

I do this :



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


Robin Helgelin wrote:
> 
> On 8/23/07, Ben Tomasini <[EMAIL PROTECTED]> 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:
> 
> 
> -- 
> regards,
> Robin
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Announce] Acegi Security library for Tapestry 5

2007-08-16 Thread Kheldar666

For the SecurityContextHolder I went a little too fast... You don't need to
use WebContextApplication  :



> configuration.add("acegiSecurityContextHolderAwareRequestFilter",
>   new HttpServletRequestFilterWrapper(new
> SecurityContextHolderAwareRequestFilter()),
> "after:acegiRememberMeProcessingFilter");
> 

For the loggout service, if the purpose is to use only the LogoutService...
What's the use of "acegi.logout.url" ? 

By the way, it's a great work you did. You solve many of my problems in one
jar :)

Cheers,

Martin


Robin Ericsson-3 wrote:
> 
> On 8/16/07, Kheldar666 <[EMAIL PROTECTED]> wrote:
>>
>> I may have two questions :
>>
>> - First is it normal that you choose not to use the
>> SecurityContextHolderAwareRequestFilter ? I used this :
> 
> Is it needed? Can the filter be found without using spring beans? I
> want the library to be completly free of spring dependencies (I know I
> can't avoid Acegi using spring, but the library doesn't need to.
> 
>> - I tryied to use the "loggout" feature, but it seams not working : Error
>> 404 when calling /j_acegi_logout. Should I add something somewhere ?
> 
> The idea is to use the LogoutService.
> 
> @Inject
> LogoutService logoutService;
> 
> logoutService.logout();
> 
> If that doesn't work, something is wrong :)
> 
> -- 
> regards,
> Robin
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-Announce--Acegi-Security-library-for-Tapestry-5-tf4279236.html#a12190506
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: [Announce] Acegi Security library for Tapestry 5

2007-08-16 Thread Kheldar666

Well... I made this, and now I can Login / Logout and use isUserInRole() and
getUserPrincipal() methods



> public static void contributeHttpServletRequestHandler(
> OrderedConfiguration configuration,
> WebApplicationContext webApplicationContext,
> @InjectService("rememberMeLogoutHandler")
> LogoutHandler rememberMeLogoutHandler,
> @Inject @Value("${acegi.logout.url}")
> String logoutUrl,
> @Inject @Value("${acegi.afterlogout.url}")
> String afterLogoutUrl
> ) {
>   
>   Filter securityContextHolderAwareRequestFilter =
> (Filter)webApplicationContext.getBean("securityContextHolderAwareRequestFilter");
> configuration.add("acegiSecurityContextHolderAwareRequestFilter",
>   new
> HttpServletRequestFilterWrapper(securityContextHolderAwareRequestFilter),
> "after:acegiRememberMeProcessingFilter");
> 
> LogoutHandler[] logoutHandler = {
>   new SecurityContextLogoutHandler(),
>   rememberMeLogoutHandler 
>   } ;
> 
> LogoutFilter acegiLogoutFilter = new
> LogoutFilter(afterLogoutUrl,logoutHandler);
>   
> acegiLogoutFilter.setFilterProcessesUrl(logoutUrl);
> 
> configuration.add("acegiLogoutFilter",
>   new HttpServletRequestFilterWrapper(acegiLogoutFilter),
> "after:acegiHttpSessionContextIntegrationFilter");
> }
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-Announce--Acegi-Security-library-for-Tapestry-5-tf4279236.html#a12185631
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: [Announce] Acegi Security library for Tapestry 5

2007-08-16 Thread Kheldar666

I may have two questions :

- First is it normal that you choose not to use the
SecurityContextHolderAwareRequestFilter ? I used this :



> public static void contributeHttpServletRequestHandler(
> OrderedConfiguration configuration,
> WebApplicationContext webApplicationContext) {
>   
>   Filter securityContextHolderAwareRequestFilter =
> (Filter)webApplicationContext.getBean("securityContextHolderAwareRequestFilter");
> configuration.add("acegiSecurityContextHolderAwareRequestFilter",
>   new
> HttpServletRequestFilterWrapper(securityContextHolderAwareRequestFilter),
> "after:acegiRememberMeProcessingFilter");
> }
> 

- I tryied to use the "loggout" feature, but it seams not working : Error
404 when calling /j_acegi_logout. Should I add something somewhere ?

Best regards,

Martin
-- 
View this message in context: 
http://www.nabble.com/-Announce--Acegi-Security-library-for-Tapestry-5-tf4279236.html#a12184379
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: [Announce] Acegi Security library for Tapestry 5

2007-08-16 Thread Kheldar666

Alleluia  
-- 
View this message in context: 
http://www.nabble.com/-Announce--Acegi-Security-library-for-Tapestry-5-tf4279236.html#a12180260
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



[T5] Skin feature

2007-08-15 Thread Kheldar666

Hi everybody,

I know that the 'multiple skin/layout' discution is something frequently
discussed here, an most of the time the answer is "Use CSS my son". Well
that's indeed probably the best answer, but in some case it's not.

For instance, I'm building a site where people that uses the site can
participate by providing new skins/layout. Unfortunatly they are not all
XHTML/CSS gods. In fact most of them use the old HTML 4 way... I can
encourage them to deliver valid "XML" templates but not really more.

Well so I studied a bit Tapestry's code to look how the "skin/layout'
feature could be done knowing that tapestry still have to use 'Static'
templates.

Couldn't it be possible to implement the skin feature by 'extending' the
same idea as for the template localisation ?

For the moment, Tapestry -in
ComponentTemplateSourceImpl.locateTemplateResource() -gets the baseResource
for a given model (Page or Component) then it look's for a localized version
of the same template.

Supposing we have a kind of SkinManager in Session (so that each use can
display it's own selected skin) I wonder if it is difficult to insert a step
where the locateTemplateResource function looks into a special directory (
let's say into .skins - like there is .components and .pages dirs).

Exemple :

Let say that my user choose the "bluesteel" skin (info recorded in the
SkinManager) and I would like to display a simple component called myComp.

First Tapestry gets the baseTemplate from : 

${tapestryRoot}/components/myComp.html

then it try to look if there is teh component's template here

${tapestryRoot}/skins/bluesteel/components/myComp.html

finaly it tries to find the localized version from the "bluesteel" dir

If Tapestry does not find a Skinned template then it falls back to default
template

So ? Is it a good idea ? A bad one ? Maybe it causes performances issues
that I'm not aware off ? 

Should I change my nickname and hide ? :)

I hope that it will help a bit.

Cheer,

Martin


-- 
View this message in context: 
http://www.nabble.com/-T5--Skin-feature-tf4276008.html#a12171332
Sent from the Tapestry - User mailing list archive at Nabble.com.


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