multi tenant - How Handle multiple customers in a single grails application with customised look and feel? -
My app needs to support multiple clients at the time of running. They will display all similar data, using the same controller, services, but with different layouts, CSS and images.
My basic idea is as follows:
1) The session has a filter to validate and set a configured value 2) My controller code will make some calls with these lines : Submit (See: "/ $ {session.userContext} / test / test")
Therefore, we will render for Customer 1: Idea / Customer 1 / Exam / Test. Gsp
Ideally I would like to / view / customer1 / directory for all custom views and layouts, but site mesh / views / The layout looks for layouts in the directory and I can not find any way around it. In this sense, the solution is a little clunky because I can not find a level of separation.
What would be ideal if I could set the root of the race, instead of starting with the idea of method on runtime, look at thoughts / customer 1, I do not know how to do this, but most of them Looks like a good solution.
Any help would be appreciated.
Cheers,
Gav
I create a subclass As you have full access to HttpServletRequest, you can provide a different view depending on how you do different from any other client (domain, session variable, etc.). If you can not set a proper view / layout for the current request, you can delegate only GrailsLayoutDecoratorMapper to keep the default behavior.
To configure a custom decorator map, you will see the default & lt; / web-app / web-INF / sitem.exml and your custom implementation. Mapper class = "org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper" /> & gt; Replace
.
Comments
Post a Comment