1 Reply Latest reply: Sep 23, 2013 2:16 AM by Nitin Khare RSS

    Refreshing Slots Based on User Interaction

    Tactis

      Hello,

       

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

       

      $class=atg.scenario.targeting.RepositoryItemSlot
      $scope=session
      ......
      

       

      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" );
      promo.stopService();
      ServiceEvent ev = new ServiceEvent (dynamoRequest,promo,dynamoRequest.getNucleus(),null);
      promo.startService(ev);
      
      //also tried this, not sure what doStartService and doStopService do
      
      promo.doStopService();
      promo.doStartService();
      

       

      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