How to invoke GiftlistSiteFilterDroplet in Oracle ATG commerce?

881 views Asked by At

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?

1

There are 1 answers

0
Rahul R Nair On

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