You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Loki <el...@users.sourceforge.net> on 2008/10/23 14:19:53 UTC
how to find sub contents
hi at all,
actual I want to write a special standalone servlet which uses ofbiz
business classes. So far so good, with
"org.ofbiz.product.product.ProductWorker.findProduct(...)" I can
access the simple content fields of a product, now I want to get some
values from attached content entities, but I can't find a method to
achieve these neither the GenericValue by the given productId contains
the id's of the inner contents.
Can anyone help me ?
bye
Thomas
PS: we use ofbiz release 4.0
Re: how to find sub contents
Posted by Loki <el...@users.sourceforge.net>.
found it, wrong Data Template Type Id for my testcase
On Mon, Oct 27, 2008 at 10:32 AM, Loki <el...@users.sourceforge.net> wrote:
> Hi,
> if I try to get a related content in in the following way
>
> ProductContentWrapper.getProductContentAsText(genericProduct,
> "UNIQUE_INGREDIENTS", locale, dispatcher);
>
> I get an exception like this one:
>
> java.lang.IllegalArgumentException: Could not find a LocationResolver
> class name for the location type: DataResource
> at org.ofbiz.base.util.template.FreeMarkerWorker.makeReader(FreeMarkerWorker.java:241)
> at org.ofbiz.base.util.template.FreeMarkerWorker.getTemplate(FreeMarkerWorker.java:274)
> at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplate(FreeMarkerWorker.java:160)
> at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplate(FreeMarkerWorker.java:149)
> at org.ofbiz.content.data.DataResourceWorker.renderDataResourceAsText(DataResourceWorker.java:635)
> at org.ofbiz.content.content.ContentWorker.renderContentAsText(ContentWorker.java:219)
> at org.ofbiz.product.product.ProductContentWrapper.getProductContentAsText(ProductContentWrapper.java:171)
> at org.ofbiz.product.product.ProductContentWrapper.getProductContentAsText(ProductContentWrapper.java:109)
> at org.ofbiz.product.product.ProductContentWrapper.getProductContentAsText(ProductContentWrapper.java:90)
> at my servlet ...
>
> but with the, in the first mail addressed, simple content fields it works
>
> ProductContentWrapper.getProductContentAsText(genericProduct,
> "DESCRIPTION", locale, dispatcher);
>
> Where should I add such a "LocationResolver class name" ?
>
> Thanks & Regards
>
> Thomas
>
> On Thu, Oct 23, 2008 at 1:25 PM, Mridul Pathak
> <mr...@hotwaxmedia.com> wrote:
>> Hi, Have a look at org.ofbiz.product.product.ProductContentWrapper class.
>> This is meant to extract Product Content from related content entities.
>>
>> --
>> Thanks & Regards
>> Mridul Pathak
>> Hotwax Media
>> http://www.hotwaxmedia.com
>> mridul.pathak@hotwaxmedia.com
>>
>> On Thu, Oct 23, 2008 at 5:49 PM, Loki <el...@users.sourceforge.net>wrote:
>>
>>> hi at all,
>>>
>>> actual I want to write a special standalone servlet which uses ofbiz
>>> business classes. So far so good, with
>>> "org.ofbiz.product.product.ProductWorker.findProduct(...)" I can
>>> access the simple content fields of a product, now I want to get some
>>> values from attached content entities, but I can't find a method to
>>> achieve these neither the GenericValue by the given productId contains
>>> the id's of the inner contents.
>>>
>>> Can anyone help me ?
>>>
>>> bye
>>>
>>> Thomas
>>>
>>> PS: we use ofbiz release 4.0
>>>
>>
>
Re: how to find sub contents
Posted by Loki <el...@users.sourceforge.net>.
Hi,
if I try to get a related content in in the following way
ProductContentWrapper.getProductContentAsText(genericProduct,
"UNIQUE_INGREDIENTS", locale, dispatcher);
I get an exception like this one:
java.lang.IllegalArgumentException: Could not find a LocationResolver
class name for the location type: DataResource
at org.ofbiz.base.util.template.FreeMarkerWorker.makeReader(FreeMarkerWorker.java:241)
at org.ofbiz.base.util.template.FreeMarkerWorker.getTemplate(FreeMarkerWorker.java:274)
at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplate(FreeMarkerWorker.java:160)
at org.ofbiz.base.util.template.FreeMarkerWorker.renderTemplate(FreeMarkerWorker.java:149)
at org.ofbiz.content.data.DataResourceWorker.renderDataResourceAsText(DataResourceWorker.java:635)
at org.ofbiz.content.content.ContentWorker.renderContentAsText(ContentWorker.java:219)
at org.ofbiz.product.product.ProductContentWrapper.getProductContentAsText(ProductContentWrapper.java:171)
at org.ofbiz.product.product.ProductContentWrapper.getProductContentAsText(ProductContentWrapper.java:109)
at org.ofbiz.product.product.ProductContentWrapper.getProductContentAsText(ProductContentWrapper.java:90)
at my servlet ...
but with the, in the first mail addressed, simple content fields it works
ProductContentWrapper.getProductContentAsText(genericProduct,
"DESCRIPTION", locale, dispatcher);
Where should I add such a "LocationResolver class name" ?
Thanks & Regards
Thomas
On Thu, Oct 23, 2008 at 1:25 PM, Mridul Pathak
<mr...@hotwaxmedia.com> wrote:
> Hi, Have a look at org.ofbiz.product.product.ProductContentWrapper class.
> This is meant to extract Product Content from related content entities.
>
> --
> Thanks & Regards
> Mridul Pathak
> Hotwax Media
> http://www.hotwaxmedia.com
> mridul.pathak@hotwaxmedia.com
>
> On Thu, Oct 23, 2008 at 5:49 PM, Loki <el...@users.sourceforge.net>wrote:
>
>> hi at all,
>>
>> actual I want to write a special standalone servlet which uses ofbiz
>> business classes. So far so good, with
>> "org.ofbiz.product.product.ProductWorker.findProduct(...)" I can
>> access the simple content fields of a product, now I want to get some
>> values from attached content entities, but I can't find a method to
>> achieve these neither the GenericValue by the given productId contains
>> the id's of the inner contents.
>>
>> Can anyone help me ?
>>
>> bye
>>
>> Thomas
>>
>> PS: we use ofbiz release 4.0
>>
>
Re: how to find sub contents
Posted by Mridul Pathak <mr...@hotwaxmedia.com>.
Hi, Have a look at org.ofbiz.product.product.ProductContentWrapper class.
This is meant to extract Product Content from related content entities.
--
Thanks & Regards
Mridul Pathak
Hotwax Media
http://www.hotwaxmedia.com
mridul.pathak@hotwaxmedia.com
On Thu, Oct 23, 2008 at 5:49 PM, Loki <el...@users.sourceforge.net>wrote:
> hi at all,
>
> actual I want to write a special standalone servlet which uses ofbiz
> business classes. So far so good, with
> "org.ofbiz.product.product.ProductWorker.findProduct(...)" I can
> access the simple content fields of a product, now I want to get some
> values from attached content entities, but I can't find a method to
> achieve these neither the GenericValue by the given productId contains
> the id's of the inner contents.
>
> Can anyone help me ?
>
> bye
>
> Thomas
>
> PS: we use ofbiz release 4.0
>