The attached patch may be useful to you. Basically
you can build off of or modify one of the existing
applications by only copying five files and changing
only what is different between project app and your
app. The explanation of what needs to be
copied/modified can be found in this post.
There are a couple of issues that I should point out.
1) It makes the screen widget dependent on the web.xml
files (not ideal if you're going for a rich client
2) Revision 5088 did some refactoring on the screen
widget, this patch reverts the revision on the
ScreenWidgetViewHandler.java source file. I'm sure my
modification that loads the decoratorComponent
variable into context can be made to the
ScreenRenderer.java source file but I don't have time
to test it.
After following the directions in the post, you would
only need to create
and create your decorator screen which would run
whatever script for your header.
Let me know if you need any help or if I misspoke.
I have an application running that uses the stylesheet
ProductStore. I'm looking into a way of changing only
depending on where the user has come from. I've had a
look into how this
can be done and I've come up with a couple of ways -
so I'm just
wondering if anyone has any suggestions for ideas that
are better than
mine as both of them have flaws.
The first one is to create a whole new application
changing only the
header file and then tell each referrer link to the
site using the
different mount-points as defined in my
ofbiz-component files for the
apps. Since the code in my applications will be
identical I really am
loathed to do this. I could create a skeleton
application by copying
only the widgets and the controller and leave all the
ftls and bshs
(except the header and footer) where they are but I
see this being a
pain further down the line when I change the
The next way I came up with was to analyse the
initalReferrerId in the
VisitHandler and put a stylesheet in the session
depending on what is
found. This should work fine but if they lose the
session and the
website's look and feel suddenly changed it could get
If anyone has better ideas or advice on which of these
ways would be
best it would be massively appreciated.