Re: how to find sub contents

2008-10-27 Thread Loki
found it, wrong Data Template Type Id for my testcase

On Mon, Oct 27, 2008 at 10:32 AM, Loki <[EMAIL PROTECTED]> 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
> <[EMAIL PROTECTED]> 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
>> [EMAIL PROTECTED]
>>
>> On Thu, Oct 23, 2008 at 5:49 PM, Loki <[EMAIL PROTECTED]>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

2008-10-27 Thread Loki
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
<[EMAIL PROTECTED]> 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
> [EMAIL PROTECTED]
>
> On Thu, Oct 23, 2008 at 5:49 PM, Loki <[EMAIL PROTECTED]>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

2008-10-23 Thread Mridul Pathak
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
[EMAIL PROTECTED]

On Thu, Oct 23, 2008 at 5:49 PM, Loki <[EMAIL PROTECTED]>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
>


how to find sub contents

2008-10-23 Thread Loki
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