Restore common-theme with ofbiz-framework

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

Restore common-theme with ofbiz-framework

Nicolas Malin-2
Michael,

I finished to restore my work on common-theme from ofbiz to
ofbiz-framework :
https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1

Now I will work on the java object to manage the widget theme on user
session.

Nicolas

--
logoNrd <https://nereide.fr/>
        Nicolas Malin
The apache way <http://theapacheway.com/> : *Openness* Technical
decisions are made publicly
[hidden email]
8 rue des Déportés 37000 TOURS, 02 47 50 30 54

Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
<http://theapacheway.com/>|ofbiz-fr <http://www.ofbiz-fr.org/>|réseau LE
<http://www.libre-entreprise.org/>
Reply | Threaded
Open this post in threaded view
|

Re: Restore common-theme with ofbiz-framework

taher
Hi Nicolas,

Great stuff, I'm not sure what everyone thinks but I prefer if we can
try to get your work incorporated back into the code base as early as
possible and to start completing the work from there.

On Tue, Jul 18, 2017 at 5:38 PM, Nicolas Malin <[hidden email]> wrote:

> Michael,
>
> I finished to restore my work on common-theme from ofbiz to ofbiz-framework
> :
> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1
>
> Now I will work on the java object to manage the widget theme on user
> session.
>
> Nicolas
>
> --
> logoNrd <https://nereide.fr/>
>         Nicolas Malin
> The apache way <http://theapacheway.com/> : *Openness* Technical decisions
> are made publicly
> [hidden email]
> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>
> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
> <http://theapacheway.com/>|ofbiz-fr <http://www.ofbiz-fr.org/>|réseau LE
> <http://www.libre-entreprise.org/>
Reply | Threaded
Open this post in threaded view
|

Re: Restore common-theme with ofbiz-framework

Nicolas Malin-2
Hi Taher, I understand the motivation but my work it's currently
unstable. I continue to centralize the theme configuration for more
stabilization.

Nicolas


Le 18/07/2017 à 16:54, Taher Alkhateeb a écrit :

> Hi Nicolas,
>
> Great stuff, I'm not sure what everyone thinks but I prefer if we can
> try to get your work incorporated back into the code base as early as
> possible and to start completing the work from there.
>
> On Tue, Jul 18, 2017 at 5:38 PM, Nicolas Malin <[hidden email]> wrote:
>> Michael,
>>
>> I finished to restore my work on common-theme from ofbiz to ofbiz-framework
>> :
>> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1
>>
>> Now I will work on the java object to manage the widget theme on user
>> session.
>>
>> Nicolas
>>
>> --
>> logoNrd <https://nereide.fr/>
>>          Nicolas Malin
>> The apache way <http://theapacheway.com/> : *Openness* Technical decisions
>> are made publicly
>> [hidden email]
>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>
>> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
>> <http://theapacheway.com/>|ofbiz-fr <http://www.ofbiz-fr.org/>|réseau LE
>> <http://www.libre-entreprise.org/>

Reply | Threaded
Open this post in threaded view
|

Re: Restore common-theme with ofbiz-framework

Nicolas Malin-2
Hello Taher,

I continued my work on this subject and success to pass the main problem
that I detected the last time.
I create an xml definition for the theme and three class :
ModelTheme : a threadsafe class to load each theme definition
Theme : is a runnable classe that contains a modelTheme and the specific
visual theme selected
ThemeFactory: to initialize in cache models and resolve easily a Theme
from a visualThemeId

With that, I modified OFBiz to set a theme on context for screen script
and service, so when you need a value related to a theme, you just ask

Each theme can extend an other theme (all theme extend common-theme). I
realized some try and it's really fun. This open a multiple possibility,
I imagine now to define a decorator API and each theme can surcharge the
wanted element to indicate how it want render it.

This is a POC, I appreciate if you can check this works for criticize
it, because I move step by step and change my mind with each problem
that I raised. So please I need some fresh eyes for some verification on
my java class creation, the xsd definition and some other idea to
improve this start.

Oh The patch it's big so I isolate the ModelTheme adding on this commit
https://github.com/nmalin/ofbiz-framework/commit/813b0aac473e32e71c9eef78ed18f9ffcb5e1cca

Yes its a duplication of jira comment ;)

Nicolas

Le 18/07/2017 à 21:18, Nicolas Malin a écrit :

> Hi Taher, I understand the motivation but my work it's currently
> unstable. I continue to centralize the theme configuration for more
> stabilization.
>
> Nicolas
>
>
> Le 18/07/2017 à 16:54, Taher Alkhateeb a écrit :
>> Hi Nicolas,
>>
>> Great stuff, I'm not sure what everyone thinks but I prefer if we can
>> try to get your work incorporated back into the code base as early as
>> possible and to start completing the work from there.
>>
>> On Tue, Jul 18, 2017 at 5:38 PM, Nicolas Malin
>> <[hidden email]> wrote:
>>> Michael,
>>>
>>> I finished to restore my work on common-theme from ofbiz to
>>> ofbiz-framework
>>> :
>>> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1 
>>>
>>>
>>> Now I will work on the java object to manage the widget theme on user
>>> session.
>>>
>>> Nicolas
>>>
>>> --
>>> logoNrd <https://nereide.fr/>
>>>          Nicolas Malin
>>> The apache way <http://theapacheway.com/> : *Openness* Technical
>>> decisions
>>> are made publicly
>>> [hidden email]
>>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>>
>>> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
>>> <http://theapacheway.com/>|ofbiz-fr
>>> <http://www.ofbiz-fr.org/>|réseau LE
>>> <http://www.libre-entreprise.org/>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Restore common-theme with ofbiz-framework

Nicolas Malin-2
I continue the way and my recent success :
* set the object theme always present for macro rendering
* create a theme that extends common-theme and specially the
htmlFormMacroLibrary with surchage only the renderDisplayField macro
like that

<#include "component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"/>
<#macro renderDisplayField type imageLocation idName description title class alert inPlaceEditorUrl="" inPlaceEditorParams="">
     <#if description?has_content>
     **${description?replace("\n", "<br />")}**<#t/>
     <#else>
         &nbsp;<#t/>
     </#if>
</#macro>

Next step, I will try to surchage only one decorator

All my work has been committed on my git repo
https://github.com/nmalin/ofbiz-framework/tree/common-theme

Nicolas

Le 21/07/2017 à 18:26, Nicolas Malin a écrit :

> [...]
>>>
>>> On Tue, Jul 18, 2017 at 5:38 PM, Nicolas Malin
>>> <[hidden email]> wrote:
>>>> Michael,
>>>>
>>>> I finished to restore my work on common-theme from ofbiz to
>>>> ofbiz-framework
>>>> :
>>>> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1 
>>>>
>>>>
>>>> Now I will work on the java object to manage the widget theme on user
>>>> session.
>>>>
>>>> Nicolas
>>>>
>>>> --
>>>> logoNrd <https://nereide.fr/>
>>>>          Nicolas Malin
>>>> The apache way <http://theapacheway.com/> : *Openness* Technical
>>>> decisions
>>>> are made publicly
>>>> [hidden email]
>>>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>>>
>>>> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
>>>> <http://theapacheway.com/>|ofbiz-fr
>>>> <http://www.ofbiz-fr.org/>|réseau LE
>>>> <http://www.libre-entreprise.org/>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Restore common-theme with ofbiz-framework

Jacques Le Roux
Administrator
Hi Nicolas,

Maybe you can create a Jira (is there one already?) and add patches explaining they should not be committed but only reviewed. Especially when you
feel your work is ready enough to be reviewed/used/tested even if not committed.

Taher does that sometimes, it's convenient for early review and no problems (too early commit by someone else) never happened. Anyway a revert is
always very easy ;)

Thanks

Jacques


Le 26/07/2017 à 00:34, Nicolas Malin a écrit :

> I continue the way and my recent success :
> * set the object theme always present for macro rendering
> * create a theme that extends common-theme and specially the htmlFormMacroLibrary with surchage only the renderDisplayField macro like that
>
> <#include "component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"/>
> <#macro renderDisplayField type imageLocation idName description title class alert inPlaceEditorUrl="" inPlaceEditorParams="">
>     <#if description?has_content>
>     **${description?replace("\n", "<br />")}**<#t/>
>     <#else>
>         &nbsp;<#t/>
>     </#if>
> </#macro>
>
> Next step, I will try to surchage only one decorator
>
> All my work has been committed on my git repo https://github.com/nmalin/ofbiz-framework/tree/common-theme
>
> Nicolas
>
> Le 21/07/2017 à 18:26, Nicolas Malin a écrit :
>> [...]
>>>>
>>>> On Tue, Jul 18, 2017 at 5:38 PM, Nicolas Malin <[hidden email]> wrote:
>>>>> Michael,
>>>>>
>>>>> I finished to restore my work on common-theme from ofbiz to ofbiz-framework
>>>>> :
>>>>> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1
>>>>>
>>>>> Now I will work on the java object to manage the widget theme on user
>>>>> session.
>>>>>
>>>>> Nicolas
>>>>>
>>>>> --
>>>>> logoNrd <https://nereide.fr/>
>>>>>          Nicolas Malin
>>>>> The apache way <http://theapacheway.com/> : *Openness* Technical decisions
>>>>> are made publicly
>>>>> [hidden email]
>>>>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>>>>
>>>>> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
>>>>> <http://theapacheway.com/>|ofbiz-fr <http://www.ofbiz-fr.org/>|réseau LE
>>>>> <http://www.libre-entreprise.org/>
>>>
>>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Restore common-theme with ofbiz-framework

Nicolas Malin-2
Hi Jacques,


Le 26/07/2017 à 19:32, Jacques Le Roux a écrit :
> Hi Nicolas,
>
> Maybe you can create a Jira (is there one already?) and add patches
> explaining they should not be committed but only reviewed. Especially
> when you feel your work is ready enough to be reviewed/used/tested
> even if not committed.
Yes the jira is OFBIZ-9138 - Create a common theme
<https://issues.apache.org/jira/browse/OFBIZ-9138>

For the patch, at the beginning I tried but it's to complicate to manage
and review for both.

It's the reason that I prefer continue only on my github account [1]
where it's more easier to learn commit by commit the way with the
comparison from github apache repo [2]

> Taher does that sometimes, it's convenient for early review and no
> problems (too early commit by someone else) never happened. Anyway a
> revert is always very easy ;)
Sure but before I will continue to consolidate my works and I will
create some diagram to help how the theme will works :)

Cheers,
Nicolas

[1] https://github.com/nmalin/ofbiz-framework/tree/common-theme
[2]
https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1

>
> Thanks
>
> Jacques
>
>
> Le 26/07/2017 à 00:34, Nicolas Malin a écrit :
>> I continue the way and my recent success :
>> * set the object theme always present for macro rendering
>> * create a theme that extends common-theme and specially the
>> htmlFormMacroLibrary with surchage only the renderDisplayField macro
>> like that
>>
>> <#include
>> "component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"/>
>> <#macro renderDisplayField type imageLocation idName description
>> title class alert inPlaceEditorUrl="" inPlaceEditorParams="">
>>     <#if description?has_content>
>>     **${description?replace("\n", "<br />")}**<#t/>
>>     <#else>
>>         &nbsp;<#t/>
>>     </#if>
>> </#macro>
>>
>> Next step, I will try to surchage only one decorator
>>
>> All my work has been committed on my git repo
>> https://github.com/nmalin/ofbiz-framework/tree/common-theme
>>
>> Nicolas
>>
>> Le 21/07/2017 à 18:26, Nicolas Malin a écrit :
>>> [...]
>>>>>
>>>>> On Tue, Jul 18, 2017 at 5:38 PM, Nicolas Malin
>>>>> <[hidden email]> wrote:
>>>>>> Michael,
>>>>>>
>>>>>> I finished to restore my work on common-theme from ofbiz to
>>>>>> ofbiz-framework
>>>>>> :
>>>>>> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1 
>>>>>>
>>>>>>
>>>>>> Now I will work on the java object to manage the widget theme on
>>>>>> user
>>>>>> session.
>>>>>>
>>>>>> Nicolas
>>>>>>
>>>>>> --
>>>>>> logoNrd <https://nereide.fr/>
>>>>>>          Nicolas Malin
>>>>>> The apache way <http://theapacheway.com/> : *Openness* Technical
>>>>>> decisions
>>>>>> are made publicly
>>>>>> [hidden email]
>>>>>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>>>>>
>>>>>> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
>>>>>> <http://theapacheway.com/>|ofbiz-fr
>>>>>> <http://www.ofbiz-fr.org/>|réseau LE
>>>>>> <http://www.libre-entreprise.org/>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Restore common-theme with ofbiz-framework and now it's ready to play

Nicolas Malin-2
It's with a great pleasure that can be announce : common-theme is
operational !

Sure all isn't supported, but now

can by theme surcharge :

  * widget properties
  * ftl template macro
  * common screen

The maximum of image, js, ftl was moved from common to common-theme,
implement a new object ModelTheme to offer the access to theme
properties directly form context and I currently detect no regression.
For a first step, I think it's a good step ^^

So if you want to play with it, it's the time !

Cheers,

Nicolas


Le 27/07/2017 à 20:37, Nicolas Malin a écrit :

> Hi Jacques,
>
>
> Le 26/07/2017 à 19:32, Jacques Le Roux a écrit :
>> Hi Nicolas,
>>
>> Maybe you can create a Jira (is there one already?) and add patches
>> explaining they should not be committed but only reviewed. Especially
>> when you feel your work is ready enough to be reviewed/used/tested
>> even if not committed.
> Yes the jira is OFBIZ-9138 - Create a common theme
> <https://issues.apache.org/jira/browse/OFBIZ-9138>
>
> For the patch, at the beginning I tried but it's to complicate to
> manage and review for both.
>
> It's the reason that I prefer continue only on my github account [1]
> where it's more easier to learn commit by commit the way with the
> comparison from github apache repo [2]
>
>> Taher does that sometimes, it's convenient for early review and no
>> problems (too early commit by someone else) never happened. Anyway a
>> revert is always very easy ;)
> Sure but before I will continue to consolidate my works and I will
> create some diagram to help how the theme will works :)
>
> Cheers,
> Nicolas
>
> [1] https://github.com/nmalin/ofbiz-framework/tree/common-theme
> [2]
> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1
>>
>> Thanks
>>
>> Jacques
>>
>>
>> Le 26/07/2017 à 00:34, Nicolas Malin a écrit :
>>> I continue the way and my recent success :
>>> * set the object theme always present for macro rendering
>>> * create a theme that extends common-theme and specially the
>>> htmlFormMacroLibrary with surchage only the renderDisplayField macro
>>> like that
>>>
>>> <#include
>>> "component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"/>
>>> <#macro renderDisplayField type imageLocation idName description
>>> title class alert inPlaceEditorUrl="" inPlaceEditorParams="">
>>>     <#if description?has_content>
>>>     **${description?replace("\n", "<br />")}**<#t/>
>>>     <#else>
>>>         &nbsp;<#t/>
>>>     </#if>
>>> </#macro>
>>>
>>> Next step, I will try to surchage only one decorator
>>>
>>> All my work has been committed on my git repo
>>> https://github.com/nmalin/ofbiz-framework/tree/common-theme
>>>
>>> Nicolas
>>>
>>> Le 21/07/2017 à 18:26, Nicolas Malin a écrit :
>>>> [...]
>>>>>>
>>>>>> On Tue, Jul 18, 2017 at 5:38 PM, Nicolas Malin
>>>>>> <[hidden email]> wrote:
>>>>>>> Michael,
>>>>>>>
>>>>>>> I finished to restore my work on common-theme from ofbiz to
>>>>>>> ofbiz-framework
>>>>>>> :
>>>>>>> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1 
>>>>>>>
>>>>>>>
>>>>>>> Now I will work on the java object to manage the widget theme on
>>>>>>> user
>>>>>>> session.
>>>>>>>
>>>>>>> Nicolas
>>>>>>>
>>>>>>> --
>>>>>>> logoNrd <https://nereide.fr/>
>>>>>>>          Nicolas Malin
>>>>>>> The apache way <http://theapacheway.com/> : *Openness* Technical
>>>>>>> decisions
>>>>>>> are made publicly
>>>>>>> [hidden email]
>>>>>>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>>>>>>
>>>>>>> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
>>>>>>> <http://theapacheway.com/>|ofbiz-fr
>>>>>>> <http://www.ofbiz-fr.org/>|réseau LE
>>>>>>> <http://www.libre-entreprise.org/>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Restore common-theme with ofbiz-framework and now it's ready to play

Nicolas Malin-2
Hello,

I push some little correction on the common-theme branch [1] (I have
been detected that the specific-template macro used always html, you can
see here [2] all commits)

If you have some time to test it to have any feedback ! It's would be
really appreciate because I prefer don't keep the branch much longer :)
. All is green from my part so if you detect a regression I'm available
to correct it.

Nicolas

[1] https://github.com/nmalin/ofbiz-framework/tree/common-theme
[2]
https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1 


Le 28/07/2017 à 22:50, Nicolas Malin a écrit :

> It's with a great pleasure that can be announce : common-theme is
> operational !
>
> Sure all isn't supported, but now
>
> can by theme surcharge :
>
>  * widget properties
>  * ftl template macro
>  * common screen
>
> The maximum of image, js, ftl was moved from common to common-theme,
> implement a new object ModelTheme to offer the access to theme
> properties directly form context and I currently detect no regression.
> For a first step, I think it's a good step ^^
>
> So if you want to play with it, it's the time !
>
> Cheers,
>
> Nicolas
>
>
> Le 27/07/2017 à 20:37, Nicolas Malin a écrit :
>> Hi Jacques,
>>
>>
>> Le 26/07/2017 à 19:32, Jacques Le Roux a écrit :
>>> Hi Nicolas,
>>>
>>> Maybe you can create a Jira (is there one already?) and add patches
>>> explaining they should not be committed but only reviewed.
>>> Especially when you feel your work is ready enough to be
>>> reviewed/used/tested even if not committed.
>> Yes the jira is OFBIZ-9138 - Create a common theme
>> <https://issues.apache.org/jira/browse/OFBIZ-9138>
>>
>> For the patch, at the beginning I tried but it's to complicate to
>> manage and review for both.
>>
>> It's the reason that I prefer continue only on my github account [1]
>> where it's more easier to learn commit by commit the way with the
>> comparison from github apache repo [2]
>>
>>> Taher does that sometimes, it's convenient for early review and no
>>> problems (too early commit by someone else) never happened. Anyway a
>>> revert is always very easy ;)
>> Sure but before I will continue to consolidate my works and I will
>> create some diagram to help how the theme will works :)
>>
>> Cheers,
>> Nicolas
>>
>> [1] https://github.com/nmalin/ofbiz-framework/tree/common-theme
>> [2]
>> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1
>>>
>>> Thanks
>>>
>>> Jacques
>>>
>>>
>>> Le 26/07/2017 à 00:34, Nicolas Malin a écrit :
>>>> I continue the way and my recent success :
>>>> * set the object theme always present for macro rendering
>>>> * create a theme that extends common-theme and specially the
>>>> htmlFormMacroLibrary with surchage only the renderDisplayField
>>>> macro like that
>>>>
>>>> <#include
>>>> "component://common-theme/template/macro/HtmlFormMacroLibrary.ftl"/>
>>>> <#macro renderDisplayField type imageLocation idName description
>>>> title class alert inPlaceEditorUrl="" inPlaceEditorParams="">
>>>>     <#if description?has_content>
>>>>     **${description?replace("\n", "<br />")}**<#t/>
>>>>     <#else>
>>>>         &nbsp;<#t/>
>>>>     </#if>
>>>> </#macro>
>>>>
>>>> Next step, I will try to surchage only one decorator
>>>>
>>>> All my work has been committed on my git repo
>>>> https://github.com/nmalin/ofbiz-framework/tree/common-theme
>>>>
>>>> Nicolas
>>>>
>>>> Le 21/07/2017 à 18:26, Nicolas Malin a écrit :
>>>>> [...]
>>>>>>>
>>>>>>> On Tue, Jul 18, 2017 at 5:38 PM, Nicolas Malin
>>>>>>> <[hidden email]> wrote:
>>>>>>>> Michael,
>>>>>>>>
>>>>>>>> I finished to restore my work on common-theme from ofbiz to
>>>>>>>> ofbiz-framework
>>>>>>>> :
>>>>>>>> https://github.com/apache/ofbiz-framework/compare/trunk...nmalin:common-theme?expand=1 
>>>>>>>>
>>>>>>>>
>>>>>>>> Now I will work on the java object to manage the widget theme
>>>>>>>> on user
>>>>>>>> session.
>>>>>>>>
>>>>>>>> Nicolas
>>>>>>>>
>>>>>>>> --
>>>>>>>> logoNrd <https://nereide.fr/>
>>>>>>>>          Nicolas Malin
>>>>>>>> The apache way <http://theapacheway.com/> : *Openness*
>>>>>>>> Technical decisions
>>>>>>>> are made publicly
>>>>>>>> [hidden email]
>>>>>>>> 8 rue des Déportés 37000 TOURS, 02 47 50 30 54
>>>>>>>>
>>>>>>>> Apache OFBiz <http://ofbiz.apache.org/>|The Apache Way
>>>>>>>> <http://theapacheway.com/>|ofbiz-fr
>>>>>>>> <http://www.ofbiz-fr.org/>|réseau LE
>>>>>>>> <http://www.libre-entreprise.org/>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>