简体   繁体   中英

How to invoke GiftlistSiteFilterDroplet in Oracle ATG commerce?

I know how to invoke an ATG droplet from a jsp page. Below code snippet calls the GiftListSiteFilterDroplet.

 <dsp:droplet name="GiftlistSiteFilterDroplet">
    <dsp:param name="collection"  bean="/atg/userprofiling/Profile.giftlists"/>
     <dsp:oparam name="output">
      <dsp:getvalueof var="giftlists" param="filteredCollection" />

Above code will invoke the GiftlistSiteFilterDroplet. However, I'm trying to findout how to invoke the same droplet from a java class. There is a DropletInvoker class from ATG DUST. Example code is as below for calling Switch component.

Nucleus mNucleus = NucleusTestUtils.startNucleusWithModules(
new String[] {"DAS","DafEar"}, this.getClass(),"/atg/dynamo/droplet/Switch");
DropletInvoker invoker = new DropletInvoker(mNucleus);
DynamoHttpServletRequest request = invoker.getRequest();
DropletResult result = null;
request.setParameter("value", "foo");
result = invoker.invokeDroplet("/atg/dynamo/droplet/Switch");

However, GiftListSiteFilterDroplet has a bean parameter. I would like to know if we can pass this bean parameter using this DropletInvoker.

I would also like to know if there is anyway we can call droplet without using ATG DUST component. Is there any generic way of calling any droplet and pass the input parameters to it?

atg.service.collections.filter.droplet.CollectionFilter is the class for the component /atg/commerce/collections/filter/droplet/GiftlistSiteFilterDroplet

Just invoke the getFilter() method in the class

Refer:- https://docs.oracle.com/cd/E23095_01/Platform.93/apidoc/atg/service/collections/filter/droplet/CollectionFilter.html

https://docs.oracle.com/cd/E26180_01/Platform.94/ATGCommStoreGuide/html/s1712collectionfilter01.html

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM