[ http://issues.apache.org/jira/browse/OFBIZ-268?page=all ]
Marco Risaliti updated OFBIZ-268: --------------------------------- Attachment: envsetup.bsh header.ftl SectionMap.java > User selectable UI themes > ------------------------- > > Key: OFBIZ-268 > URL: http://issues.apache.org/jira/browse/OFBIZ-268 > Project: OFBiz (The Open for Business Project) > Issue Type: New Feature > Affects Versions: SVN trunk > Reporter: Marco Risaliti > Priority: Minor > Attachments: envsetup.bsh, header.ftl, SectionMap.java > > > From the Dev mailing list, implementation overview for user-selected UI > themes. > [Text from mailing] > I modified header.ftl to support alternative style sheets. If an alternative > style sheet is in the environment, then the maincss.css is disabled and the > alternative is used. > I copied and modified the maincss.css file to create different themes. One > css > file for each theme. > I set up a "Workspace Manager" web page where the user can select from a list > of > themes. The web page stores their selection in the user setting entity. > I modified the GlobalDecorator so that it calls an action that gets the > user's > current theme from the user setting entity and puts it in the environment. > Some of this was submitted in Jira 174. That Jira issue is kinda outdated > now, > but the changes I made to header.ftl will still work. > [End text] > I have submitted some files that can be consulted for ideas. They will NOT > work "out of the box" because they rely on other components we use > internally. I'm sure they will contain enough information so that someone can > flesh it out on their own. > Comment by Adrian Crum [10/May/06 05:12 PM] [ Permlink ] > Modified header.ftl - enables alternate style sheets. > Comment by Adrian Crum [10/May/06 05:14 PM] [ Permlink ] > An example alternative style sheet. > Comment by Adrian Crum [10/May/06 05:15 PM] [ Permlink ] > XML file used to specify available themes. Used by workspace web page. > Comment by Adrian Crum [10/May/06 05:16 PM] [ Permlink ] > Java file for theme services. > Comment by Adrian Crum [10/May/06 05:16 PM] [ Permlink ] > FTL file for the Workspace web page. > Comment by Charles Johnson [11/May/06 05:03 PM] [ Permlink ] > That sounds great Adrian. I wonder if we could have some screenshots? > Comment by Adrian Crum [11/May/06 05:16 PM] [ Permlink ] > Default.jpg - screen shot of Workspace Manager using OFBiz's default > maincss.css > Comment by Adrian Crum [11/May/06 05:17 PM] [ Permlink ] > sthwest.jpg - screenshot of workspace manager using the southwest.css > Comment by Adrian Crum [11/May/06 06:29 PM] [ Permlink ] > UserServices.java - the services used to apply the user-selected theme. I > just found this. Sorry, it's been over a year since I've seen this code. > Comment by Adrian Crum [11/May/06 06:30 PM] [ Permlink ] > SectionMap.java - used by UserServices. Seems to be a little garbled, looks > like the cr/lf pairs were changed or something. > Comment by Si Chen [11/May/06 07:14 PM] [ Permlink ] > Adrian, > So how does this work? How are you detecting alternate CSS styles? It seems > that there's a new entity and an XML for setting this? If so, what is the new > entity and how is the XML setting done? > Si > Comment by Adrian Crum [11/May/06 07:22 PM] [ Permlink ] > Si, > That part of the code is missing because it's mixed in with a bunch of other > custom stuff we do here. Basically, there is an action in the GlobalDecorator > that looks up the theme the user selected (ThemeServices.THEMES_SETTING_NAME) > in the UserSettings entity, retrieves the theme's settings from the XML file, > then puts those settings in the environment. > It's really quite simple. There are no new entities involved. Just the code I > submitted plus a simple entity lookup. > Comment by Si Chen [11/May/06 07:30 PM] [ Permlink ] > What does the UserSettings entity look like? > And, just curious, why the separate XML file and entity model? Why not put it > all into user settings? > Comment by Adrian Crum [11/May/06 07:36 PM] [ Permlink ] > UserSet.jpg - screenshot of UserSettings entity data. I hope this helps Si. > Comment by Adrian Crum [11/May/06 07:44 PM] [ Permlink ] > The separate XML file is there for flexibility. If an integrator or > administrator wanted to add more themes, all they have to do is drop the new > css files in a folder and then add entries in the XML file to point to them. > The XML file is what makes adding skins so easy. > Comment by Si Chen [11/May/06 07:53 PM] [ Permlink ] > Sorry to ask, one last question: how is a UserLogin associated with a > UserSetting? Another entity like UserLoginSetting? > Comment by Adrian Crum [11/May/06 08:00 PM] [ Permlink ] > If you look at the UserSetting screen shot, you'll see the user's login name > appended to the setting name. I was trying to implement this feature with a > minimum of intrusion into existing code - that's why I didn't set up a > separate entity. > My "OfbizEx" component contains all of the code I've submitted. It "sits > outside" the SVN code. Whenever I download an SVN update, I only need to > modify the GlobalDecorator to make this work. > Getting back to the XML file question - I used an XML file because David > prefers to keep configuration stuff out of the DB. I was trying to follow his > advice. The only info kept in the DB is the user's current selection. > Comment by Adrian Crum [11/May/06 08:11 PM] [ Permlink ] > If something like this was made a part of the project, then the workspace > manager application could be expanded to include the capability to create new > themes. A user with sufficient priviledges would be presented with another > tab that allows them to create/edit themes. Probably could use content > manager services to upload css files, logos, etc. > Comment by Adrian Crum [17/May/06 11:38 AM] [ Permlink ] > envsetup.bsh - the script that is run from the Global Decorator. It simply > gets the user's UI preferences and puts them in the layoutSettings map. > It's a copy of the old-jira issue OFBIZ-880 and I think it's better to not > lose this important new feature. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira