The current Catalog Id in Ofbiz Release 4.0

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

The current Catalog Id in Ofbiz Release 4.0

Heidi Dehaes - Olagos
Hello,

I know that this question is already showed several times but i want
to show in the ecommerce site the current catalogus name or the
current catalogus id. How do i have to do that?

I start from the main.ftl which if i look in the ecommerce controller
file is used for the "/ecommerce/control/main" url.

In the "main.ftl" is used the "main-decorator".

In the "main-decorator" there is the script "EcommerceSetup.bsh" and
also the screen "header.ftl" is used there.

In the "EcommerceSetup.bsh" i write:

CurrentCatalogId = CatalogWorker.getCurrentCatalogId(request);


if (CurrentCatalogId != null) {
    request.setAttribute("CurrentCatalogId", CurrentCatalogId);
}



I use the "header.ftl" to receive and show the "CurrentCatalogId"
request parameter:

<#if (requestAttributes.CurrentCatalogId)?exists><#assign
CurrentCatalogId = requestAttributes.CurrentCatalogId></#if>

I show the variable $CurrentCatalogId further in the header.ftl file.


BUT this doesn't work. What do i do WRONG???

thanks for help,
Heidi
Reply | Threaded
Open this post in threaded view
|

Re: The current Catalog Id in Ofbiz Release 4.0

BJ Freeman
the websiteID in the web.xml starts the chain
create a productStore
then in the content recreate a website with the ID you put in the web.xml
and use the ProductstoreID you created.
Now create a catalog for that productstore.
this is the catalog that will show up in the Ecommerce
you can add more catalogs to the Product store and they will show also.


SPEELGOED VOOR KINDEREN / TOYS FOR CHILDREN / JOUETS POUR ENFANTS sent
the following on 10/10/2008 2:56 PM:

> Hello,
>
> I know that this question is already showed several times but i want
> to show in the ecommerce site the current catalogus name or the
> current catalogus id. How do i have to do that?
>
> I start from the main.ftl which if i look in the ecommerce controller
> file is used for the "/ecommerce/control/main" url.
>
> In the "main.ftl" is used the "main-decorator".
>
> In the "main-decorator" there is the script "EcommerceSetup.bsh" and
> also the screen "header.ftl" is used there.
>
> In the "EcommerceSetup.bsh" i write:
>
> CurrentCatalogId = CatalogWorker.getCurrentCatalogId(request);
>
>
> if (CurrentCatalogId != null) {
>     request.setAttribute("CurrentCatalogId", CurrentCatalogId);
> }
>
>
>
> I use the "header.ftl" to receive and show the "CurrentCatalogId"
> request parameter:
>
> <#if (requestAttributes.CurrentCatalogId)?exists><#assign
> CurrentCatalogId = requestAttributes.CurrentCatalogId></#if>
>
> I show the variable $CurrentCatalogId further in the header.ftl file.
>
>
> BUT this doesn't work. What do i do WRONG???
>
> thanks for help,
> Heidi
>
>
Reply | Threaded
Open this post in threaded view
|

Re: The current Catalog Id in Ofbiz Release 4.0

Scott Gray
In reply to this post by Heidi Dehaes - Olagos
requestAttributes is a convenience map created prior to the screen
being rendered so setting a request attribute in the bsh script has no
effect on that map.  You should use the same method as the other parts
of that script i.e. put the catalogId in the globalContext

Regards
Scott

2008/10/11 SPEELGOED VOOR KINDEREN / TOYS FOR CHILDREN / JOUETS POUR
ENFANTS <[hidden email]>:

> Hello,
>
> I know that this question is already showed several times but i want
> to show in the ecommerce site the current catalogus name or the
> current catalogus id. How do i have to do that?
>
> I start from the main.ftl which if i look in the ecommerce controller
> file is used for the "/ecommerce/control/main" url.
>
> In the "main.ftl" is used the "main-decorator".
>
> In the "main-decorator" there is the script "EcommerceSetup.bsh" and
> also the screen "header.ftl" is used there.
>
> In the "EcommerceSetup.bsh" i write:
>
> CurrentCatalogId = CatalogWorker.getCurrentCatalogId(request);
>
>
> if (CurrentCatalogId != null) {
>    request.setAttribute("CurrentCatalogId", CurrentCatalogId);
> }
>
>
>
> I use the "header.ftl" to receive and show the "CurrentCatalogId"
> request parameter:
>
> <#if (requestAttributes.CurrentCatalogId)?exists><#assign
> CurrentCatalogId = requestAttributes.CurrentCatalogId></#if>
>
> I show the variable $CurrentCatalogId further in the header.ftl file.
>
>
> BUT this doesn't work. What do i do WRONG???
>
> thanks for help,
> Heidi
>
Reply | Threaded
Open this post in threaded view
|

Re: The current Catalog Id in Ofbiz Release 4.0

Surya Kusumakar-3
In reply to this post by Heidi Dehaes - Olagos
Hello ,
You need to create a websiteId in web.xml ,this websiteId gives
information about catalogs.Then create a ProductStore and associate
Website with ProductStore .Now you can create ProductCatalog and
associate it with ProductStore.This catalog will get displayed on
Ecommerce screen.You can take help from data prepared in DemoProduct.xml
file which is  present  in ecommerce  application.
---
Thanks and Regards
Surya Kusumakar
www.hotwaxmedia.com

SPEELGOED VOOR KINDEREN / TOYS FOR CHILDREN / JOUETS POUR ENFANTS wrote:

> Hello,
>
> I know that this question is already showed several times but i want
> to show in the ecommerce site the current catalogus name or the
> current catalogus id. How do i have to do that?
>
> I start from the main.ftl which if i look in the ecommerce controller
> file is used for the "/ecommerce/control/main" url.
>
> In the "main.ftl" is used the "main-decorator".
>
> In the "main-decorator" there is the script "EcommerceSetup.bsh" and
> also the screen "header.ftl" is used there.
>
> In the "EcommerceSetup.bsh" i write:
>
> CurrentCatalogId = CatalogWorker.getCurrentCatalogId(request);
>
>
> if (CurrentCatalogId != null) {
>     request.setAttribute("CurrentCatalogId", CurrentCatalogId);
> }
>
>
>
> I use the "header.ftl" to receive and show the "CurrentCatalogId"
> request parameter:
>
> <#if (requestAttributes.CurrentCatalogId)?exists><#assign
> CurrentCatalogId = requestAttributes.CurrentCatalogId></#if>
>
> I show the variable $CurrentCatalogId further in the header.ftl file.
>
>
> BUT this doesn't work. What do i do WRONG???
>
> thanks for help,
> Heidi
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: The current Catalog Id in Ofbiz Release 4.0

Heidi Dehaes - Olagos
Thanks to all,

Very usefull information !!

But i search in fact how ofbiz passes the value of a java method from
a .java file, for example,

CurrentCatalogId = CatalogWorker.getCurrentCatalogId(request);

into my ecommerce screen. (let's say into my header.ftl file to show
the current catalog anywhere separately in the upper part of my
ecommerce screen)

regards,
Heidi



2008/10/11 Surya Kusumakar <[hidden email]>:

> Hello ,
> You need to create a websiteId in web.xml ,this websiteId gives information
> about catalogs.Then create a ProductStore and associate Website with
> ProductStore .Now you can create ProductCatalog and associate it with
> ProductStore.This catalog will get displayed on Ecommerce screen.You can
> take help from data prepared in DemoProduct.xml file which is  present  in
> ecommerce  application.
> ---
> Thanks and Regards
> Surya Kusumakar
> www.hotwaxmedia.com
>
> SPEELGOED VOOR KINDEREN / TOYS FOR CHILDREN / JOUETS POUR ENFANTS wrote:
>>
>> Hello,
>>
>> I know that this question is already showed several times but i want
>> to show in the ecommerce site the current catalogus name or the
>> current catalogus id. How do i have to do that?
>>
>> I start from the main.ftl which if i look in the ecommerce controller
>> file is used for the "/ecommerce/control/main" url.
>>
>> In the "main.ftl" is used the "main-decorator".
>>
>> In the "main-decorator" there is the script "EcommerceSetup.bsh" and
>> also the screen "header.ftl" is used there.
>>
>> In the "EcommerceSetup.bsh" i write:
>>
>> CurrentCatalogId = CatalogWorker.getCurrentCatalogId(request);
>>
>>
>> if (CurrentCatalogId != null) {
>>    request.setAttribute("CurrentCatalogId", CurrentCatalogId);
>> }
>>
>>
>>
>> I use the "header.ftl" to receive and show the "CurrentCatalogId"
>> request parameter:
>>
>> <#if (requestAttributes.CurrentCatalogId)?exists><#assign
>> CurrentCatalogId = requestAttributes.CurrentCatalogId></#if>
>>
>> I show the variable $CurrentCatalogId further in the header.ftl file.
>>
>>
>> BUT this doesn't work. What do i do WRONG???
>>
>> thanks for help,
>> Heidi
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: The current Catalog Id in Ofbiz Release 4.0

Heidi Dehaes - Olagos
In reply to this post by Scott Gray
Hello,

Thanks for the  good information.

But can you explain me more in detail how the content of a variable
from a .java file is passed into the content of a ecommerce screen?

thanks,
Heidi

2008/10/11 Scott Gray <[hidden email]>:

> requestAttributes is a convenience map created prior to the screen
> being rendered so setting a request attribute in the bsh script has no
> effect on that map.  You should use the same method as the other parts
> of that script i.e. put the catalogId in the globalContext
>
> Regards
> Scott
>
> 2008/10/11 SPEELGOED VOOR KINDEREN / TOYS FOR CHILDREN / JOUETS POUR
> ENFANTS <[hidden email]>:
>> Hello,
>>
>> I know that this question is already showed several times but i want
>> to show in the ecommerce site the current catalogus name or the
>> current catalogus id. How do i have to do that?
>>
>> I start from the main.ftl which if i look in the ecommerce controller
>> file is used for the "/ecommerce/control/main" url.
>>
>> In the "main.ftl" is used the "main-decorator".
>>
>> In the "main-decorator" there is the script "EcommerceSetup.bsh" and
>> also the screen "header.ftl" is used there.
>>
>> In the "EcommerceSetup.bsh" i write:
>>
>> CurrentCatalogId = CatalogWorker.getCurrentCatalogId(request);
>>
>>
>> if (CurrentCatalogId != null) {
>>    request.setAttribute("CurrentCatalogId", CurrentCatalogId);
>> }
>>
>>
>>
>> I use the "header.ftl" to receive and show the "CurrentCatalogId"
>> request parameter:
>>
>> <#if (requestAttributes.CurrentCatalogId)?exists><#assign
>> CurrentCatalogId = requestAttributes.CurrentCatalogId></#if>
>>
>> I show the variable $CurrentCatalogId further in the header.ftl file.
>>
>>
>> BUT this doesn't work. What do i do WRONG???
>>
>> thanks for help,
>> Heidi
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: The current Catalog Id in Ofbiz Release 4.0

Heidi Dehaes - Olagos
Sorry all,

I think i know how it works now.

Thanks a lot.

Heidi

2008/10/11 SPEELGOED VOOR KINDEREN / TOYS FOR CHILDREN / JOUETS POUR
ENFANTS <[hidden email]>:

> Hello,
>
> Thanks for the  good information.
>
> But can you explain me more in detail how the content of a variable
> from a .java file is passed into the content of a ecommerce screen?
>
> thanks,
> Heidi
>
> 2008/10/11 Scott Gray <[hidden email]>:
>> requestAttributes is a convenience map created prior to the screen
>> being rendered so setting a request attribute in the bsh script has no
>> effect on that map.  You should use the same method as the other parts
>> of that script i.e. put the catalogId in the globalContext
>>
>> Regards
>> Scott
>>
>> 2008/10/11 SPEELGOED VOOR KINDEREN / TOYS FOR CHILDREN / JOUETS POUR
>> ENFANTS <[hidden email]>:
>>> Hello,
>>>
>>> I know that this question is already showed several times but i want
>>> to show in the ecommerce site the current catalogus name or the
>>> current catalogus id. How do i have to do that?
>>>
>>> I start from the main.ftl which if i look in the ecommerce controller
>>> file is used for the "/ecommerce/control/main" url.
>>>
>>> In the "main.ftl" is used the "main-decorator".
>>>
>>> In the "main-decorator" there is the script "EcommerceSetup.bsh" and
>>> also the screen "header.ftl" is used there.
>>>
>>> In the "EcommerceSetup.bsh" i write:
>>>
>>> CurrentCatalogId = CatalogWorker.getCurrentCatalogId(request);
>>>
>>>
>>> if (CurrentCatalogId != null) {
>>>    request.setAttribute("CurrentCatalogId", CurrentCatalogId);
>>> }
>>>
>>>
>>>
>>> I use the "header.ftl" to receive and show the "CurrentCatalogId"
>>> request parameter:
>>>
>>> <#if (requestAttributes.CurrentCatalogId)?exists><#assign
>>> CurrentCatalogId = requestAttributes.CurrentCatalogId></#if>
>>>
>>> I show the variable $CurrentCatalogId further in the header.ftl file.
>>>
>>>
>>> BUT this doesn't work. What do i do WRONG???
>>>
>>> thanks for help,
>>> Heidi
>>>
>>
>