You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Ritz123 <ri...@gmail.com> on 2008/03/07 03:01:13 UTC

context object in bsh

Hi,

Can someone point(answer) where is the context and parameters object which
is available in BSH initialized/created? Is it part of the request like
delegator and/or other objects are?

e.g. /ofbiz/applications/order/webapp/ordmgr/.../category.bsh has 

import org.ofbiz.base.util.*;
import org.ofbiz.entity.*;
import org.ofbiz.product.catalog.*;
import org.ofbiz.product.category.CategoryWorker;
import org.ofbiz.product.category.CategoryContentWrapper;

detailScreen = "categorydetail";
catalogName = CatalogWorker.getCatalogName(request);

productCategoryId = request.getAttribute("productCategoryId");
if (productCategoryId == null) {
    productCategoryId = parameters.get("category_id");
}
context.put("productCategoryId", productCategoryId);
-- 
View this message in context: http://www.nabble.com/context-object-in-bsh-tp15885836p15885836.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: context object in bsh

Posted by Pranay Pandey <pr...@hotwaxmedia.com>.
Hi,

I would also like to add one more thing that when we write bsh which one 
should be prefer and when from context and parameters means what are 
scenarios when we should prefer context to put values and when we should 
prefer parameters.

Thanks and Regards
--
Pranay Pandey

Ritz123 wrote:
> Hi,
>
> Can someone point(answer) where is the context and parameters object which
> is available in BSH initialized/created? Is it part of the request like
> delegator and/or other objects are?
>
> e.g. /ofbiz/applications/order/webapp/ordmgr/.../category.bsh has 
>
> import org.ofbiz.base.util.*;
> import org.ofbiz.entity.*;
> import org.ofbiz.product.catalog.*;
> import org.ofbiz.product.category.CategoryWorker;
> import org.ofbiz.product.category.CategoryContentWrapper;
>
> detailScreen = "categorydetail";
> catalogName = CatalogWorker.getCatalogName(request);
>
> productCategoryId = request.getAttribute("productCategoryId");
> if (productCategoryId == null) {
>     productCategoryId = parameters.get("category_id");
> }
> context.put("productCategoryId", productCategoryId);
>   

Re: context object in bsh

Posted by Bilgin Ibryam <bi...@iguanait.com>.
Take a look at ScreenRenderer.populateContextForRequest method.

Bilgin