1 Reply Latest reply on Sep 23, 2013 7:16 AM by Nitin Khare

    Refreshing Slots Based on User Interaction




      Currently we are using slots and creating them using properties files, just like in this documentation Slots:




      I am trying to make it so that these slots refresh according to the scenario based on when a user submits a modal on a specific page,possible solutions which I want to avoid

      1. Changing the scope to request: These slots are included on nearly every single page of the website, for efficiency reasons I would live to avoid this.
      2. Invalidating the session: cart would be cleared, user would get logged out etc... too many unwanted drawbacks to this approach.


      Ideally I would like to programmatically re-execute the slot service or scenario I have tried the following without success:


      DynamoHttpServletRequest dynamoRequest =UtilClass..getCurrentRequest();
        RepositoryItemSlot promo = (RepositoryItemSlot) dynamoRequest.resolveName( "/atg/registry/Slots/promo" );
      ServiceEvent ev = new ServiceEvent (dynamoRequest,promo,dynamoRequest.getNucleus(),null);
      //also tried this, not sure what doStartService and doStopService do


      Is this type of approach supposed to work? Or is something like this not possible? Any advise would be appreciated.


      Thanks in advance.

        • 1. Re: Refreshing Slots Based on User Interaction
          Nitin Khare

          I don't think you need to start and stop the slot component programmatically. doStartService() is called internally after a service (component) has been created, placed into the Nucleus naming hierarchy and initialized with its configured property values. We generally override doStartService() method in our component class to do any additional processing that we may require when it starts. Similar concept applies to doStopService() when a component shuts down.


          Using ATG Scenario, you can populate slot content using a targeter. A lot would depend that how you designed your scenario and what events you are trying to capture. For your requirement of refreshing the slot content you try making use of other slot component properties for limiting number of items in slot, event generation, item retrieval settings etc.


          Oracle ATG Web Commerce - Event Generation