[jira] Created: (OFBIZ-268) User selectable UI themes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (OFBIZ-268) User selectable UI themes

Nicolas Malin (Jira)
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


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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-268) User selectable UI themes

Nicolas Malin (Jira)
     [ 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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-268) User selectable UI themes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-268?page=all ]

Marco Risaliti updated OFBIZ-268:
---------------------------------

    Attachment: southwest.css
                ThemeServices.java
                UiThemes.xml

> 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: DEFAULT.JPG, envsetup.bsh, header.ftl, SectionMap.java, southwest.css, STHWEST.JPG, ThemeServices.java, UiThemes.xml, UserServices.java, USERSET.JPG, viewMain.ftl
>
>
> 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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-268) User selectable UI themes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-268?page=all ]

Marco Risaliti updated OFBIZ-268:
---------------------------------

    Attachment: UserServices.java
                viewMain.ftl
                DEFAULT.JPG

> 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: DEFAULT.JPG, envsetup.bsh, header.ftl, SectionMap.java, southwest.css, STHWEST.JPG, ThemeServices.java, UiThemes.xml, UserServices.java, USERSET.JPG, viewMain.ftl
>
>
> 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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-268) User selectable UI themes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-268?page=all ]

Marco Risaliti updated OFBIZ-268:
---------------------------------

    Attachment: STHWEST.JPG
                USERSET.JPG

> 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: DEFAULT.JPG, envsetup.bsh, header.ftl, SectionMap.java, southwest.css, STHWEST.JPG, ThemeServices.java, UiThemes.xml, UserServices.java, USERSET.JPG, viewMain.ftl
>
>
> 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

       
Reply | Threaded
Open this post in threaded view
|

Re: [jira] Updated: (OFBIZ-268) User selectable UI themes

Adrian Crum
In reply to this post by Nicolas Malin (Jira)
Thank you for bringing this over Marco. I plan to work on this feature as soon
as I have time. I will mention it in the new Jira.


Marco Risaliti (JIRA) wrote:

>      [ 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.
>
>
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-268) User selectable UI themes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
    [ http://issues.apache.org/jira/browse/OFBIZ-268?page=comments#action_12434541 ]
           
Adrian Crum commented on OFBIZ-268:
-----------------------------------

Some of the work has been done to make this feature a part of the project. I plan to work on this feature as soon as I have time. Here is what is left to be done:

1. Si Chen introduced a ViewSettings entity some time ago. A service needs to be written to store & retrieve the UI theme information (basically the contents of the layoutSettings map) from that entity. The attached UserServices.java file could be modified to complete this step.

2. A web page needs to be developed to allow a user to select from a list of  UI themes. The attached ThemeServices.java and viewMain.ftl files could be modified to complete this step. The attached files use an XML file to define the UI Theme elements - I want to change that to an entity, so someone on an administrator level can add/modify UI Themes.

3. The GlobalDecorator needs to be modified to call the UI Theme service to get the user's currently selected UI Theme settings - instead of the current hard-coded css file assignments.

4. At least one alternate css file needs to be created to demonstrate the UI Themes feature.


> 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: DEFAULT.JPG, envsetup.bsh, header.ftl, SectionMap.java, southwest.css, STHWEST.JPG, ThemeServices.java, UiThemes.xml, UserServices.java, USERSET.JPG, viewMain.ftl
>
>
> 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

       
Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (OFBIZ-268) User selectable UI themes

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)
     [ http://issues.apache.org/jira/browse/OFBIZ-268?page=all ]

Jacopo Cappellato updated OFBIZ-268:
------------------------------------

    Description:
It's a copy of the old-jira issue http://jira.undersunconsulting.com/browse/OFBIZ-880 from Adrian Crum.

=========================================

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.



  was:
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.


> 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: DEFAULT.JPG, envsetup.bsh, header.ftl, SectionMap.java, southwest.css, STHWEST.JPG, ThemeServices.java, UiThemes.xml, UserServices.java, USERSET.JPG, viewMain.ftl
>
>
> It's a copy of the old-jira issue http://jira.undersunconsulting.com/browse/OFBIZ-880 from Adrian Crum.
> =========================================
> 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.

--
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