You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Si Chen (JIRA)" <ji...@apache.org> on 2006/08/17 03:29:13 UTC

[jira] Created: (OFBIZ-161) Fix contentwrapper locale rendering bug

Fix contentwrapper locale rendering bug
---------------------------------------

                 Key: OFBIZ-161
                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
             Project: OFBiz (The Open for Business Project)
          Issue Type: Bug
          Components: product
            Reporter: Si Chen
         Attachments: content-wrapper-locale.patch

Wanted to check with everybody before committing this to make sure I'm not going down the wrong way.

It seems to me that you should be able to create content for products and categories in different languages in the Catalog Manager by clicking on the [Content] tab of Product or Category, then click on [Prepare Create] for say, Description or Long Description.  Then you should be able to enter a locale, and that content should be the one for that language locale.  However, the Product and Category ContentWrappers were not rendering them.

After a little digging, it seemed to me the problem was that they were both looking for the ProductContent and ProductCategoryContent entities, then getting the first and most recent record of each as the Content to render.  There was no filtering of locale of the Content entity--hence no way to control which locale was being rendered.  

I made this little patch to change the lookup to ProductContentAndInfo and the comparable Categoryentity.  It  fixed it for me, so now I can enter English as en_US and French as fr_FR, and the content for those languages would render separately.

However, one problem is that this content lookup is very strict - if you create your content as en, it will not find it as en_US, or vice versa.  

Is this the right way to use the content manager?

Is there a way to make it so that en_ will work for en_US--other than some fancier searching technique?

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

        

[jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OFBIZ-161?page=comments#action_12429475 ] 
            
Jacques Le Roux commented on OFBIZ-161:
---------------------------------------

Thanks David and Jacopo,

I realize now that's how my patch in OFBIZ-75 is working. I did no notice that Si proposition was not working this way. Too bad it was an easy way to have an UI for i10n of product and categ. So the problem remains...

> Fix contentwrapper locale rendering bug
> ---------------------------------------
>
>                 Key: OFBIZ-161
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: product
>            Reporter: Si Chen
>         Attachments: content-wrapper-locale.patch
>
>
> Wanted to check with everybody before committing this to make sure I'm not going down the wrong way.
> It seems to me that you should be able to create content for products and categories in different languages in the Catalog Manager by clicking on the [Content] tab of Product or Category, then click on [Prepare Create] for say, Description or Long Description.  Then you should be able to enter a locale, and that content should be the one for that language locale.  However, the Product and Category ContentWrappers were not rendering them.
> After a little digging, it seemed to me the problem was that they were both looking for the ProductContent and ProductCategoryContent entities, then getting the first and most recent record of each as the Content to render.  There was no filtering of locale of the Content entity--hence no way to control which locale was being rendered.  
> I made this little patch to change the lookup to ProductContentAndInfo and the comparable Categoryentity.  It  fixed it for me, so now I can enter English as en_US and French as fr_FR, and the content for those languages would render separately.
> However, one problem is that this content lookup is very strict - if you create your content as en, it will not find it as en_US, or vice versa.  
> Is this the right way to use the content manager?
> Is there a way to make it so that en_ will work for en_US--other than some fancier searching technique?

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

        

Re: [jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by David E Jones <jo...@undersunconsulting.com>.
On Aug 23, 2006, at 10:59 AM, Si Chen wrote:

> One other thing that confused me that one has to create the  
> DataResource first, then create a Content which references that  
> dataResourceId.  I had originally thought that the idea was to have  
> the Content serve as a sort of a "master" with many different data  
> resources pointing to it.  Is that no longer the case?

It's the other way around. A DataResource is a lower level entity  
that is referred to by possibly many Content records.

-David


Re: [jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by Si Chen <si...@opensourcestrategies.com>.
Ok.  I guess I was "conditioned" by the UI in the catalog manager to  
think incorrectly that the idea was to have multi contents, each with  
a locale, for the same product.

This does sound like a good way to go -- to group related content  
together if they are of different locales.

One other thing that confused me that one has to create the  
DataResource first, then create a Content which references that  
dataResourceId.  I had originally thought that the idea was to have  
the Content serve as a sort of a "master" with many different data  
resources pointing to it.  Is that no longer the case?

Si


On Aug 21, 2006, at 10:06 PM, David E Jones wrote:

>
> From a content reuse perspective it allows you to package up all of  
> the related content (ie for each locale) and be able to refer to it  
> by a single contentId. With this all you need to know is the "main"  
> contentId and the locale you would prefer to have it rendered in,  
> and you're good to go. That is the real goal of the design.
>
> What you can do with this is put together content that can be used  
> for various things. The same contentId can be referred to in a  
> Content structure for inclusion in a templated/styled document, or  
> with a single ProductContent record (instead of one for each  
> locale) it can all be associated with a Product, or with a  
> ProductCategoryContent record with a category, and so on. There is  
> all sorts of flexibility when you only have one contentId to deal  
> with rather than an arbitrary contentId for each alternate content  
> for other locales, which would be a mess.
>
> It all comes down to the basic principle that you have to have a  
> machine usable structure to know about related Content. Once you  
> have that, why not take advantage of it for other purposes like this?
>
> Now that I right this up it seems a bit too simple and maybe isn't  
> what you were asking about. Is there some concern that you had  
> about this structure or how these things are done?
>
> -David
>
>
> On Aug 21, 2006, at 7:35 PM, Si Chen wrote:
>
>> By the way, David - how does having multiple Contents associated  
>> with primary Content as ALTERNATE_LOCALE give more flexibility  
>> than just associating multiple Content with the Product?  Sorry  
>> but I don't quite see it.
>>
>> Si
>>
>> Begin forwarded message:
>>
>>> From: "David E. Jones (JIRA)" <ji...@apache.org>
>>> Date: August 21, 2006 9:58:15 AM PDT
>>> To: ofbiz-dev@incubator.apache.org
>>> Subject: [jira] Commented: (OFBIZ-161) Fix contentwrapper locale  
>>> rendering bug
>>> Reply-To: ofbiz-dev@incubator.apache.org
>>>
>>>     [ http://issues.apache.org/jira/browse/OFBIZ-161? 
>>> page=comments#action_12429458 ]
>>>
>>> David E. Jones commented on OFBIZ-161:
>>> --------------------------------------
>>>
>>> Please don't commit this.
>>>
>>> The pattern this uses points to multiple ProductContent records  
>>> for different locales and is not how the Content and related  
>>> entities are meant to be used.
>>>
>>> There should be a single Content record that is in turn related  
>>> to other content records through ContentAssoc using  
>>> contentAssocTypeId="ALTERNATE_LOCALE".
>>>
>>> Pointing to a single Content record that is in turn related to  
>>> alternate locale content pushes the logic and structure back into  
>>> the content area which makes it more re-usable, and easier to  
>>> multi-purpose the content.
>>>
>>>> Fix contentwrapper locale rendering bug
>>>> ---------------------------------------
>>>>
>>>>                 Key: OFBIZ-161
>>>>                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
>>>>             Project: OFBiz (The Open for Business Project)
>>>>          Issue Type: Bug
>>>>          Components: product
>>>>            Reporter: Si Chen
>>>>         Attachments: content-wrapper-locale.patch
>>>>
>>>>
>>>> Wanted to check with everybody before committing this to make  
>>>> sure I'm not going down the wrong way.
>>>> It seems to me that you should be able to create content for  
>>>> products and categories in different languages in the Catalog  
>>>> Manager by clicking on the [Content] tab of Product or Category,  
>>>> then click on [Prepare Create] for say, Description or Long  
>>>> Description.  Then you should be able to enter a locale, and  
>>>> that content should be the one for that language locale.   
>>>> However, the Product and Category ContentWrappers were not  
>>>> rendering them.
>>>> After a little digging, it seemed to me the problem was that  
>>>> they were both looking for the ProductContent and  
>>>> ProductCategoryContent entities, then getting the first and most  
>>>> recent record of each as the Content to render.  There was no  
>>>> filtering of locale of the Content entity--hence no way to  
>>>> control which locale was being rendered.
>>>> I made this little patch to change the lookup to  
>>>> ProductContentAndInfo and the comparable Categoryentity.  It   
>>>> fixed it for me, so now I can enter English as en_US and French  
>>>> as fr_FR, and the content for those languages would render  
>>>> separately.
>>>> However, one problem is that this content lookup is very strict  
>>>> - if you create your content as en, it will not find it as  
>>>> en_US, or vice versa.
>>>> Is this the right way to use the content manager?
>>>> Is there a way to make it so that en_ will work for en_US--other  
>>>> than some fancier searching technique?
>>>
>>> -- 
>>> 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
>>>
>>>
>>


Re: [jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by David E Jones <jo...@undersunconsulting.com>.
 From a content reuse perspective it allows you to package up all of  
the related content (ie for each locale) and be able to refer to it  
by a single contentId. With this all you need to know is the "main"  
contentId and the locale you would prefer to have it rendered in, and  
you're good to go. That is the real goal of the design.

What you can do with this is put together content that can be used  
for various things. The same contentId can be referred to in a  
Content structure for inclusion in a templated/styled document, or  
with a single ProductContent record (instead of one for each locale)  
it can all be associated with a Product, or with a  
ProductCategoryContent record with a category, and so on. There is  
all sorts of flexibility when you only have one contentId to deal  
with rather than an arbitrary contentId for each alternate content  
for other locales, which would be a mess.

It all comes down to the basic principle that you have to have a  
machine usable structure to know about related Content. Once you have  
that, why not take advantage of it for other purposes like this?

Now that I right this up it seems a bit too simple and maybe isn't  
what you were asking about. Is there some concern that you had about  
this structure or how these things are done?

-David


On Aug 21, 2006, at 7:35 PM, Si Chen wrote:

> By the way, David - how does having multiple Contents associated  
> with primary Content as ALTERNATE_LOCALE give more flexibility than  
> just associating multiple Content with the Product?  Sorry but I  
> don't quite see it.
>
> Si
>
> Begin forwarded message:
>
>> From: "David E. Jones (JIRA)" <ji...@apache.org>
>> Date: August 21, 2006 9:58:15 AM PDT
>> To: ofbiz-dev@incubator.apache.org
>> Subject: [jira] Commented: (OFBIZ-161) Fix contentwrapper locale  
>> rendering bug
>> Reply-To: ofbiz-dev@incubator.apache.org
>>
>>     [ http://issues.apache.org/jira/browse/OFBIZ-161? 
>> page=comments#action_12429458 ]
>>
>> David E. Jones commented on OFBIZ-161:
>> --------------------------------------
>>
>> Please don't commit this.
>>
>> The pattern this uses points to multiple ProductContent records  
>> for different locales and is not how the Content and related  
>> entities are meant to be used.
>>
>> There should be a single Content record that is in turn related to  
>> other content records through ContentAssoc using  
>> contentAssocTypeId="ALTERNATE_LOCALE".
>>
>> Pointing to a single Content record that is in turn related to  
>> alternate locale content pushes the logic and structure back into  
>> the content area which makes it more re-usable, and easier to  
>> multi-purpose the content.
>>
>>> Fix contentwrapper locale rendering bug
>>> ---------------------------------------
>>>
>>>                 Key: OFBIZ-161
>>>                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
>>>             Project: OFBiz (The Open for Business Project)
>>>          Issue Type: Bug
>>>          Components: product
>>>            Reporter: Si Chen
>>>         Attachments: content-wrapper-locale.patch
>>>
>>>
>>> Wanted to check with everybody before committing this to make  
>>> sure I'm not going down the wrong way.
>>> It seems to me that you should be able to create content for  
>>> products and categories in different languages in the Catalog  
>>> Manager by clicking on the [Content] tab of Product or Category,  
>>> then click on [Prepare Create] for say, Description or Long  
>>> Description.  Then you should be able to enter a locale, and that  
>>> content should be the one for that language locale.  However, the  
>>> Product and Category ContentWrappers were not rendering them.
>>> After a little digging, it seemed to me the problem was that they  
>>> were both looking for the ProductContent and  
>>> ProductCategoryContent entities, then getting the first and most  
>>> recent record of each as the Content to render.  There was no  
>>> filtering of locale of the Content entity--hence no way to  
>>> control which locale was being rendered.
>>> I made this little patch to change the lookup to  
>>> ProductContentAndInfo and the comparable Categoryentity.  It   
>>> fixed it for me, so now I can enter English as en_US and French  
>>> as fr_FR, and the content for those languages would render  
>>> separately.
>>> However, one problem is that this content lookup is very strict -  
>>> if you create your content as en, it will not find it as en_US,  
>>> or vice versa.
>>> Is this the right way to use the content manager?
>>> Is there a way to make it so that en_ will work for en_US--other  
>>> than some fancier searching technique?
>>
>> -- 
>> 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
>>
>>
>


Re: Fwd: [jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by Chris Howe <cj...@yahoo.com>.
Or even in the simple content, supporting variant
products would require the one:many, many:many
relationship as well

--- Chris Howe <cj...@yahoo.com> wrote:

> I don't think it's as aparent with OFBiz's use of
> description, longDescription, etc as those will all
> basically have one to one relationships between
> product and primary content and in turn the primary
> content will have a one to one relationship with the
> alternate_locale.
> 
> Because it's all one to one, you could feasibly
> eliminate the primary content.  However, when you
> get
> into more advanced product content like taglines, or
> product warnings or satisfaction gaurantee
> statements
> you're going to need content:product - one:many and
> many:many relationships.
> 
> Restricting the description, longDescription to the
> approach David suggested makes it much easier than
> handling two seperate approaches that do the same
> thing.
> 
> --- Si Chen <si...@opensourcestrategies.com> wrote:
> 
> > By the way, David - how does having multiple
> > Contents associated with  
> > primary Content as ALTERNATE_LOCALE give more
> > flexibility than just  
> > associating multiple Content with the Product? 
> > Sorry but I don't  
> > quite see it.
> > 
> > Si
> > 
> > Begin forwarded message:
> > 
> > > From: "David E. Jones (JIRA)" <ji...@apache.org>
> > > Date: August 21, 2006 9:58:15 AM PDT
> > > To: ofbiz-dev@incubator.apache.org
> > > Subject: [jira] Commented: (OFBIZ-161) Fix
> > contentwrapper locale  
> > > rendering bug
> > > Reply-To: ofbiz-dev@incubator.apache.org
> > >
> > >     [
> > http://issues.apache.org/jira/browse/OFBIZ-161? 
> > > page=comments#action_12429458 ]
> > >
> > > David E. Jones commented on OFBIZ-161:
> > > --------------------------------------
> > >
> > > Please don't commit this.
> > >
> > > The pattern this uses points to multiple
> > ProductContent records for  
> > > different locales and is not how the Content and
> > related entities  
> > > are meant to be used.
> > >
> > > There should be a single Content record that is
> in
> > turn related to  
> > > other content records through ContentAssoc using
>  
> > > contentAssocTypeId="ALTERNATE_LOCALE".
> > >
> > > Pointing to a single Content record that is in
> > turn related to  
> > > alternate locale content pushes the logic and
> > structure back into  
> > > the content area which makes it more re-usable,
> > and easier to multi- 
> > > purpose the content.
> > >
> > >> Fix contentwrapper locale rendering bug
> > >> ---------------------------------------
> > >>
> > >>                 Key: OFBIZ-161
> > >>                 URL:
> > http://issues.apache.org/jira/browse/OFBIZ-161
> > >>             Project: OFBiz (The Open for
> Business
> > Project)
> > >>          Issue Type: Bug
> > >>          Components: product
> > >>            Reporter: Si Chen
> > >>         Attachments:
> content-wrapper-locale.patch
> > >>
> > >>
> > >> Wanted to check with everybody before
> committing
> > this to make sure  
> > >> I'm not going down the wrong way.
> > >> It seems to me that you should be able to
> create
> > content for  
> > >> products and categories in different languages
> in
> > the Catalog  
> > >> Manager by clicking on the [Content] tab of
> > Product or Category,  
> > >> then click on [Prepare Create] for say,
> > Description or Long  
> > >> Description.  Then you should be able to enter
> a
> > locale, and that  
> > >> content should be the one for that language
> > locale.  However, the  
> > >> Product and Category ContentWrappers were not
> > rendering them.
> > >> After a little digging, it seemed to me the
> > problem was that they  
> > >> were both looking for the ProductContent and  
> > >> ProductCategoryContent entities, then getting
> the
> > first and most  
> > >> recent record of each as the Content to render.
> 
> > There was no  
> > >> filtering of locale of the Content
> entity--hence
> > no way to control  
> > >> which locale was being rendered.
> > >> I made this little patch to change the lookup
> to 
> > 
> > >> ProductContentAndInfo and the comparable
> > Categoryentity.  It   
> > >> fixed it for me, so now I can enter English as
> > en_US and French as  
> > >> fr_FR, and the content for those languages
> would
> > render separately.
> > >> However, one problem is that this content
> lookup
> > is very strict -  
> > >> if you create your content as en, it will not
> > find it as en_US, or  
> > >> vice versa.
> > >> Is this the right way to use the content
> manager?
> > >> Is there a way to make it so that en_ will work
> > for en_US--other  
> > >> than some fancier searching technique?
> > >
> > > -- 
> > > 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
> > >
> > >
> > 
> > 
> 
> 


Re: Fwd: [jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by Chris Howe <cj...@yahoo.com>.
I don't think it's as aparent with OFBiz's use of
description, longDescription, etc as those will all
basically have one to one relationships between
product and primary content and in turn the primary
content will have a one to one relationship with the
alternate_locale.

Because it's all one to one, you could feasibly
eliminate the primary content.  However, when you get
into more advanced product content like taglines, or
product warnings or satisfaction gaurantee statements
you're going to need content:product - one:many and
many:many relationships.

Restricting the description, longDescription to the
approach David suggested makes it much easier than
handling two seperate approaches that do the same
thing.

--- Si Chen <si...@opensourcestrategies.com> wrote:

> By the way, David - how does having multiple
> Contents associated with  
> primary Content as ALTERNATE_LOCALE give more
> flexibility than just  
> associating multiple Content with the Product? 
> Sorry but I don't  
> quite see it.
> 
> Si
> 
> Begin forwarded message:
> 
> > From: "David E. Jones (JIRA)" <ji...@apache.org>
> > Date: August 21, 2006 9:58:15 AM PDT
> > To: ofbiz-dev@incubator.apache.org
> > Subject: [jira] Commented: (OFBIZ-161) Fix
> contentwrapper locale  
> > rendering bug
> > Reply-To: ofbiz-dev@incubator.apache.org
> >
> >     [
> http://issues.apache.org/jira/browse/OFBIZ-161? 
> > page=comments#action_12429458 ]
> >
> > David E. Jones commented on OFBIZ-161:
> > --------------------------------------
> >
> > Please don't commit this.
> >
> > The pattern this uses points to multiple
> ProductContent records for  
> > different locales and is not how the Content and
> related entities  
> > are meant to be used.
> >
> > There should be a single Content record that is in
> turn related to  
> > other content records through ContentAssoc using  
> > contentAssocTypeId="ALTERNATE_LOCALE".
> >
> > Pointing to a single Content record that is in
> turn related to  
> > alternate locale content pushes the logic and
> structure back into  
> > the content area which makes it more re-usable,
> and easier to multi- 
> > purpose the content.
> >
> >> Fix contentwrapper locale rendering bug
> >> ---------------------------------------
> >>
> >>                 Key: OFBIZ-161
> >>                 URL:
> http://issues.apache.org/jira/browse/OFBIZ-161
> >>             Project: OFBiz (The Open for Business
> Project)
> >>          Issue Type: Bug
> >>          Components: product
> >>            Reporter: Si Chen
> >>         Attachments: content-wrapper-locale.patch
> >>
> >>
> >> Wanted to check with everybody before committing
> this to make sure  
> >> I'm not going down the wrong way.
> >> It seems to me that you should be able to create
> content for  
> >> products and categories in different languages in
> the Catalog  
> >> Manager by clicking on the [Content] tab of
> Product or Category,  
> >> then click on [Prepare Create] for say,
> Description or Long  
> >> Description.  Then you should be able to enter a
> locale, and that  
> >> content should be the one for that language
> locale.  However, the  
> >> Product and Category ContentWrappers were not
> rendering them.
> >> After a little digging, it seemed to me the
> problem was that they  
> >> were both looking for the ProductContent and  
> >> ProductCategoryContent entities, then getting the
> first and most  
> >> recent record of each as the Content to render. 
> There was no  
> >> filtering of locale of the Content entity--hence
> no way to control  
> >> which locale was being rendered.
> >> I made this little patch to change the lookup to 
> 
> >> ProductContentAndInfo and the comparable
> Categoryentity.  It   
> >> fixed it for me, so now I can enter English as
> en_US and French as  
> >> fr_FR, and the content for those languages would
> render separately.
> >> However, one problem is that this content lookup
> is very strict -  
> >> if you create your content as en, it will not
> find it as en_US, or  
> >> vice versa.
> >> Is this the right way to use the content manager?
> >> Is there a way to make it so that en_ will work
> for en_US--other  
> >> than some fancier searching technique?
> >
> > -- 
> > 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
> >
> >
> 
> 


Fwd: [jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by Si Chen <si...@opensourcestrategies.com>.
By the way, David - how does having multiple Contents associated with  
primary Content as ALTERNATE_LOCALE give more flexibility than just  
associating multiple Content with the Product?  Sorry but I don't  
quite see it.

Si

Begin forwarded message:

> From: "David E. Jones (JIRA)" <ji...@apache.org>
> Date: August 21, 2006 9:58:15 AM PDT
> To: ofbiz-dev@incubator.apache.org
> Subject: [jira] Commented: (OFBIZ-161) Fix contentwrapper locale  
> rendering bug
> Reply-To: ofbiz-dev@incubator.apache.org
>
>     [ http://issues.apache.org/jira/browse/OFBIZ-161? 
> page=comments#action_12429458 ]
>
> David E. Jones commented on OFBIZ-161:
> --------------------------------------
>
> Please don't commit this.
>
> The pattern this uses points to multiple ProductContent records for  
> different locales and is not how the Content and related entities  
> are meant to be used.
>
> There should be a single Content record that is in turn related to  
> other content records through ContentAssoc using  
> contentAssocTypeId="ALTERNATE_LOCALE".
>
> Pointing to a single Content record that is in turn related to  
> alternate locale content pushes the logic and structure back into  
> the content area which makes it more re-usable, and easier to multi- 
> purpose the content.
>
>> Fix contentwrapper locale rendering bug
>> ---------------------------------------
>>
>>                 Key: OFBIZ-161
>>                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
>>             Project: OFBiz (The Open for Business Project)
>>          Issue Type: Bug
>>          Components: product
>>            Reporter: Si Chen
>>         Attachments: content-wrapper-locale.patch
>>
>>
>> Wanted to check with everybody before committing this to make sure  
>> I'm not going down the wrong way.
>> It seems to me that you should be able to create content for  
>> products and categories in different languages in the Catalog  
>> Manager by clicking on the [Content] tab of Product or Category,  
>> then click on [Prepare Create] for say, Description or Long  
>> Description.  Then you should be able to enter a locale, and that  
>> content should be the one for that language locale.  However, the  
>> Product and Category ContentWrappers were not rendering them.
>> After a little digging, it seemed to me the problem was that they  
>> were both looking for the ProductContent and  
>> ProductCategoryContent entities, then getting the first and most  
>> recent record of each as the Content to render.  There was no  
>> filtering of locale of the Content entity--hence no way to control  
>> which locale was being rendered.
>> I made this little patch to change the lookup to  
>> ProductContentAndInfo and the comparable Categoryentity.  It   
>> fixed it for me, so now I can enter English as en_US and French as  
>> fr_FR, and the content for those languages would render separately.
>> However, one problem is that this content lookup is very strict -  
>> if you create your content as en, it will not find it as en_US, or  
>> vice versa.
>> Is this the right way to use the content manager?
>> Is there a way to make it so that en_ will work for en_US--other  
>> than some fancier searching technique?
>
> -- 
> 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
>
>


[jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by "David E. Jones (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OFBIZ-161?page=comments#action_12429458 ] 
            
David E. Jones commented on OFBIZ-161:
--------------------------------------

Please don't commit this.

The pattern this uses points to multiple ProductContent records for different locales and is not how the Content and related entities are meant to be used.

There should be a single Content record that is in turn related to other content records through ContentAssoc using contentAssocTypeId="ALTERNATE_LOCALE".

Pointing to a single Content record that is in turn related to alternate locale content pushes the logic and structure back into the content area which makes it more re-usable, and easier to multi-purpose the content.

> Fix contentwrapper locale rendering bug
> ---------------------------------------
>
>                 Key: OFBIZ-161
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: product
>            Reporter: Si Chen
>         Attachments: content-wrapper-locale.patch
>
>
> Wanted to check with everybody before committing this to make sure I'm not going down the wrong way.
> It seems to me that you should be able to create content for products and categories in different languages in the Catalog Manager by clicking on the [Content] tab of Product or Category, then click on [Prepare Create] for say, Description or Long Description.  Then you should be able to enter a locale, and that content should be the one for that language locale.  However, the Product and Category ContentWrappers were not rendering them.
> After a little digging, it seemed to me the problem was that they were both looking for the ProductContent and ProductCategoryContent entities, then getting the first and most recent record of each as the Content to render.  There was no filtering of locale of the Content entity--hence no way to control which locale was being rendered.  
> I made this little patch to change the lookup to ProductContentAndInfo and the comparable Categoryentity.  It  fixed it for me, so now I can enter English as en_US and French as fr_FR, and the content for those languages would render separately.
> However, one problem is that this content lookup is very strict - if you create your content as en, it will not find it as en_US, or vice versa.  
> Is this the right way to use the content manager?
> Is there a way to make it so that en_ will work for en_US--other than some fancier searching technique?

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

        

[jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OFBIZ-161?page=comments#action_12429381 ] 
            
Jacques Le Roux commented on OFBIZ-161:
---------------------------------------

Si,

I tried this morning, and yes, it works. I will see how to adapt my modifications in OFBIZ-75 (some are still needed). So after your commit we will have an usable UI to change i10n of categories and products :o). And after mine this will be visible in some places where it's not now.

Jacques


> Fix contentwrapper locale rendering bug
> ---------------------------------------
>
>                 Key: OFBIZ-161
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: product
>            Reporter: Si Chen
>         Attachments: content-wrapper-locale.patch
>
>
> Wanted to check with everybody before committing this to make sure I'm not going down the wrong way.
> It seems to me that you should be able to create content for products and categories in different languages in the Catalog Manager by clicking on the [Content] tab of Product or Category, then click on [Prepare Create] for say, Description or Long Description.  Then you should be able to enter a locale, and that content should be the one for that language locale.  However, the Product and Category ContentWrappers were not rendering them.
> After a little digging, it seemed to me the problem was that they were both looking for the ProductContent and ProductCategoryContent entities, then getting the first and most recent record of each as the Content to render.  There was no filtering of locale of the Content entity--hence no way to control which locale was being rendered.  
> I made this little patch to change the lookup to ProductContentAndInfo and the comparable Categoryentity.  It  fixed it for me, so now I can enter English as en_US and French as fr_FR, and the content for those languages would render separately.
> However, one problem is that this content lookup is very strict - if you create your content as en, it will not find it as en_US, or vice versa.  
> Is this the right way to use the content manager?
> Is there a way to make it so that en_ will work for en_US--other than some fancier searching technique?

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

        

[jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OFBIZ-161?page=comments#action_12428587 ] 
            
Jacques Le Roux commented on OFBIZ-161:
---------------------------------------

Si,

I have no time yet to think about that but it seems related fo OFBIZ-75

> Fix contentwrapper locale rendering bug
> ---------------------------------------
>
>                 Key: OFBIZ-161
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: product
>            Reporter: Si Chen
>         Attachments: content-wrapper-locale.patch
>
>
> Wanted to check with everybody before committing this to make sure I'm not going down the wrong way.
> It seems to me that you should be able to create content for products and categories in different languages in the Catalog Manager by clicking on the [Content] tab of Product or Category, then click on [Prepare Create] for say, Description or Long Description.  Then you should be able to enter a locale, and that content should be the one for that language locale.  However, the Product and Category ContentWrappers were not rendering them.
> After a little digging, it seemed to me the problem was that they were both looking for the ProductContent and ProductCategoryContent entities, then getting the first and most recent record of each as the Content to render.  There was no filtering of locale of the Content entity--hence no way to control which locale was being rendered.  
> I made this little patch to change the lookup to ProductContentAndInfo and the comparable Categoryentity.  It  fixed it for me, so now I can enter English as en_US and French as fr_FR, and the content for those languages would render separately.
> However, one problem is that this content lookup is very strict - if you create your content as en, it will not find it as en_US, or vice versa.  
> Is this the right way to use the content manager?
> Is there a way to make it so that en_ will work for en_US--other than some fancier searching technique?

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

        

[jira] Commented: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by "Jacopo Cappellato (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/OFBIZ-161?page=comments#action_12429460 ] 
            
Jacopo Cappellato commented on OFBIZ-161:
-----------------------------------------

I think that this link can be useful to help understand the whole picture:

http://ofbizwiki.go-integral.com/Wiki.jsp?page=LocalizedProductDescriptions



> Fix contentwrapper locale rendering bug
> ---------------------------------------
>
>                 Key: OFBIZ-161
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: product
>            Reporter: Si Chen
>         Attachments: content-wrapper-locale.patch
>
>
> Wanted to check with everybody before committing this to make sure I'm not going down the wrong way.
> It seems to me that you should be able to create content for products and categories in different languages in the Catalog Manager by clicking on the [Content] tab of Product or Category, then click on [Prepare Create] for say, Description or Long Description.  Then you should be able to enter a locale, and that content should be the one for that language locale.  However, the Product and Category ContentWrappers were not rendering them.
> After a little digging, it seemed to me the problem was that they were both looking for the ProductContent and ProductCategoryContent entities, then getting the first and most recent record of each as the Content to render.  There was no filtering of locale of the Content entity--hence no way to control which locale was being rendered.  
> I made this little patch to change the lookup to ProductContentAndInfo and the comparable Categoryentity.  It  fixed it for me, so now I can enter English as en_US and French as fr_FR, and the content for those languages would render separately.
> However, one problem is that this content lookup is very strict - if you create your content as en, it will not find it as en_US, or vice versa.  
> Is this the right way to use the content manager?
> Is there a way to make it so that en_ will work for en_US--other than some fancier searching technique?

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

        

[jira] Closed: (OFBIZ-161) Fix contentwrapper locale rendering bug

Posted by "Si Chen (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/OFBIZ-161?page=all ]

Si Chen closed OFBIZ-161.
-------------------------

    Resolution: Invalid

Ok, thanks for your comments everybody.  I put some screenshots on that wiki page so people can see exactly how to do it.

> Fix contentwrapper locale rendering bug
> ---------------------------------------
>
>                 Key: OFBIZ-161
>                 URL: http://issues.apache.org/jira/browse/OFBIZ-161
>             Project: OFBiz (The Open for Business Project)
>          Issue Type: Bug
>          Components: product
>            Reporter: Si Chen
>         Attachments: content-wrapper-locale.patch
>
>
> Wanted to check with everybody before committing this to make sure I'm not going down the wrong way.
> It seems to me that you should be able to create content for products and categories in different languages in the Catalog Manager by clicking on the [Content] tab of Product or Category, then click on [Prepare Create] for say, Description or Long Description.  Then you should be able to enter a locale, and that content should be the one for that language locale.  However, the Product and Category ContentWrappers were not rendering them.
> After a little digging, it seemed to me the problem was that they were both looking for the ProductContent and ProductCategoryContent entities, then getting the first and most recent record of each as the Content to render.  There was no filtering of locale of the Content entity--hence no way to control which locale was being rendered.  
> I made this little patch to change the lookup to ProductContentAndInfo and the comparable Categoryentity.  It  fixed it for me, so now I can enter English as en_US and French as fr_FR, and the content for those languages would render separately.
> However, one problem is that this content lookup is very strict - if you create your content as en, it will not find it as en_US, or vice versa.  
> Is this the right way to use the content manager?
> Is there a way to make it so that en_ will work for en_US--other than some fancier searching technique?

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