You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vjeran Marcinko <vj...@email.t-com.hr> on 2007/07/06 14:57:34 UTC
[T4.0] Some way to set "theme" (via Locale)?
Hello.
I have few customers where I have to deploy my Tapestry 4.0 web app, and I
would like to have some way to set specific customer "theme" thus to be able
to have many versions of templates and properties files for each customer.
For instance, I would like to set theme name "customer1", and when I go to
"Home" page, somehow Tapestry to search for
Home_customer1.html
Home_customer1.properties
The only thing that comes to my mind is setting new Locale("customer1")
somewhere, but somehow, I don't see a place to set it during Tapestry boot ?
I have found some old page on Wiki where it says to override
BaseEngine.getLocale() class, and set it via
<meta key="org.apache.tapestry.engine-class" value="my.company.EngineImpl"/>
but it doesn't work.
Any ideas?
Regards,
Vjeran
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T4.0] Some way to set "theme" (via Locale)?
Posted by Jacob Bergoo <ja...@gmail.com>.
Hi,
we have something similar, but we have a couple of public pages that
contains our clients websites and then we have different templates and color
scheme that the client can choose from in a admin area. This change reads in
the different css files that are used to style the pages. (layout, colors
etc.)
So whenever the client choose a web pages we check what template and color
scheme that client use and change the path to the right css file. The only
thing is that the html does not change, it is the same for everybody, but
the look and feal of the page are completely different.
Maybe this can give you some idea....
Cheers,
Jacob
--
View this message in context: http://www.nabble.com/-T4.0---Some-way-to-set-%22theme%22-%28via-Locale%29--tf4035342.html#a11464064
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5.0.5] Contributions to MasterDispatcher not working
Posted by Siddhartha Argollo <sl...@tre-ba.gov.br>.
No warnings.
Howard Lewis Ship wrote:
> Sounds like it should work as is, are you getting any warnings in the
> console?
>
> On 7/6/07, Siddhartha Argollo <sl...@tre-ba.gov.br> wrote:
>> Hi all,
>>
>> I have two submodules, both used by AppModule.
>>
>> In the first module, I contribute with a "MyFirstDispatcher" to
>> MasterDispatcher and the constraint "before:*". In the second module, I
>> contribute with "MySecondDispatcher" and the constraint
>> "after:MyFirstDispatcher". Although both contributions are correctly
>> done, only MyFirstDispatcher.dispatch is called by the application.
>> The thing is, if I switch the constraints, again only
>> MySecondDispatcher.dispatch is called. If I don't use the constraints,
>> neither service is called.
>>
>> I'm returning false in the dispatch method of both services. Am I
>> forgetting anything?
>> What I'm trying to do is wrong in anyway?
>>
>> I solved my problem contributing to RequestHandler with one of the
>> services and leaving the other one with the constraint "before:*", still
>> contributing to MasterDispatcher (without this constraint, it doesn't
>> work). This way, both dispatches are called by the framework.
>>
>> Thanks,
>>
>> Siddhartha Argollo
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
--
Siddhartha Argollo
Técnico Judiciário
TRE-BA
slargollo@tre-ba.gov.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5.0.5] Contributions to MasterDispatcher not working
Posted by Howard Lewis Ship <hl...@gmail.com>.
Sounds like it should work as is, are you getting any warnings in the console?
On 7/6/07, Siddhartha Argollo <sl...@tre-ba.gov.br> wrote:
> Hi all,
>
> I have two submodules, both used by AppModule.
>
> In the first module, I contribute with a "MyFirstDispatcher" to
> MasterDispatcher and the constraint "before:*". In the second module, I
> contribute with "MySecondDispatcher" and the constraint
> "after:MyFirstDispatcher". Although both contributions are correctly
> done, only MyFirstDispatcher.dispatch is called by the application.
> The thing is, if I switch the constraints, again only
> MySecondDispatcher.dispatch is called. If I don't use the constraints,
> neither service is called.
>
> I'm returning false in the dispatch method of both services. Am I
> forgetting anything?
> What I'm trying to do is wrong in anyway?
>
> I solved my problem contributing to RequestHandler with one of the
> services and leaving the other one with the constraint "before:*", still
> contributing to MasterDispatcher (without this constraint, it doesn't
> work). This way, both dispatches are called by the framework.
>
> Thanks,
>
> Siddhartha Argollo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5.0.5] Contributions to MasterDispatcher not working
Posted by Siddhartha Argollo <sl...@tre-ba.gov.br>.
1) Here's the code of the first service
public final class BasicModule
{
...
/*
// It works!
public static void
contributeHttpServletRequestHandler(OrderedConfiguration<HttpServletRequestFilter>
configuration,
@Symbol(BasicModule.APPLICATION_ENCODING)
String requestEncoding)
{
configuration.add("RequestEncoding", new
RequestEncodingFilter(requestEncoding));
}
*/
// Doesn't work...
public static void
contributeMasterDispatcher(OrderedConfiguration<HttpServletRequestFilter>
configuration,
@Symbol(BasicModule.APPLICATION_ENCODING)
String requestEncoding)
{
configuration.add("RequestEncoding", new
RequestEncodingFilter(requestEncoding));
}
...
}
2) Here's the code of the second service
public class SecurityModule
{
...
public static void bind(ServiceBinder binder)
{
binder.bind(Dispatcher.class,
SecurityDispatcher.class).withId("SecurityDispatcher");
}
public void contributeSecurityDispatcher(Configuration<String>
unsecurePaths)
{
unsecurePaths.add("/");
unsecurePaths.add("Start");
unsecurePaths.add("assets");
}
public void
contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration,
@InjectService("SecurityDispatcher")
Dispatcher securityDispatcher)
{
configuration.add("SecurityDispatcher", securityDispatcher, "before:*");
}
...
}
3) My AppModule
@SubModule({
BasicModule.class,
SecurityModule.class
})
public class AppModule
{
public void contributeApplicationDefaults(MappedConfiguration<String,
String> configuration)
{
configuration.add(BasicModule.APPLICATION_ENCODING, "utf-8");
}
}
Only the dispather with "before:*" is called.
I´m running with JBoss 4.2.0-GA.
Howard Lewis Ship wrote:
> Going to need to see the code for this.
>
> On 7/6/07, Siddhartha Argollo <sl...@tre-ba.gov.br> wrote:
>> Hi all,
>>
>> I have two submodules, both used by AppModule.
>>
>> In the first module, I contribute with a "MyFirstDispatcher" to
>> MasterDispatcher and the constraint "before:*". In the second module, I
>> contribute with "MySecondDispatcher" and the constraint
>> "after:MyFirstDispatcher". Although both contributions are correctly
>> done, only MyFirstDispatcher.dispatch is called by the application.
>> The thing is, if I switch the constraints, again only
>> MySecondDispatcher.dispatch is called. If I don't use the constraints,
>> neither service is called.
>>
>> I'm returning false in the dispatch method of both services. Am I
>> forgetting anything?
>> What I'm trying to do is wrong in anyway?
>>
>> I solved my problem contributing to RequestHandler with one of the
>> services and leaving the other one with the constraint "before:*", still
>> contributing to MasterDispatcher (without this constraint, it doesn't
>> work). This way, both dispatches are called by the framework.
>>
>> Thanks,
>>
>> Siddhartha Argollo
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
--
Siddhartha Argollo
Técnico Judiciário
TRE-BA
slargollo@tre-ba.gov.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5.0.5] Contributions to MasterDispatcher not working
Posted by Howard Lewis Ship <hl...@gmail.com>.
Going to need to see the code for this.
On 7/6/07, Siddhartha Argollo <sl...@tre-ba.gov.br> wrote:
> Hi all,
>
> I have two submodules, both used by AppModule.
>
> In the first module, I contribute with a "MyFirstDispatcher" to
> MasterDispatcher and the constraint "before:*". In the second module, I
> contribute with "MySecondDispatcher" and the constraint
> "after:MyFirstDispatcher". Although both contributions are correctly
> done, only MyFirstDispatcher.dispatch is called by the application.
> The thing is, if I switch the constraints, again only
> MySecondDispatcher.dispatch is called. If I don't use the constraints,
> neither service is called.
>
> I'm returning false in the dispatch method of both services. Am I
> forgetting anything?
> What I'm trying to do is wrong in anyway?
>
> I solved my problem contributing to RequestHandler with one of the
> services and leaving the other one with the constraint "before:*", still
> contributing to MasterDispatcher (without this constraint, it doesn't
> work). This way, both dispatches are called by the framework.
>
> Thanks,
>
> Siddhartha Argollo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
[T5.0.5] Contributions to MasterDispatcher not working
Posted by Siddhartha Argollo <sl...@tre-ba.gov.br>.
Hi all,
I have two submodules, both used by AppModule.
In the first module, I contribute with a "MyFirstDispatcher" to
MasterDispatcher and the constraint "before:*". In the second module, I
contribute with "MySecondDispatcher" and the constraint
"after:MyFirstDispatcher". Although both contributions are correctly
done, only MyFirstDispatcher.dispatch is called by the application.
The thing is, if I switch the constraints, again only
MySecondDispatcher.dispatch is called. If I don't use the constraints,
neither service is called.
I'm returning false in the dispatch method of both services. Am I
forgetting anything?
What I'm trying to do is wrong in anyway?
I solved my problem contributing to RequestHandler with one of the
services and leaving the other one with the constraint "before:*", still
contributing to MasterDispatcher (without this constraint, it doesn't
work). This way, both dispatches are called by the framework.
Thanks,
Siddhartha Argollo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org