Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/acs/damsel/client/browse/BrowseAction.java


1   package org.acs.damsel.client.browse;
2   
3   import org.apache.struts.action.*;
4   import javax.servlet.http.*;
5   import org.acs.damsel.client.ClientApp;
6   import org.acs.damsel.srvr.search.SearchMgr;
7   import org.acs.damsel.srvr.collection.CollectionView;
8   
9   /**
10   *Action class forwards user from browse page to browse results page when a
11   * browse letter is clicked.
12   *
13   */
14  public class BrowseAction extends Action {
15    public ActionForward execute(ActionMapping actionMapping,
16                                 ActionForm actionForm,
17                                 HttpServletRequest httpServletRequest,
18                                 HttpServletResponse httpServletResponse) {
19  
20      BrowseForm browseForm = (BrowseForm) actionForm;
21  
22      String browseLetter = browseForm.getBrowseLetter();
23      String browseField = browseForm.getBrowseField();
24  
25      if (browseLetter.equals("refresh")) {
26        return actionMapping.findForward("refresh");
27      }
28  
29      String collectionName = browseForm.getCollectionSelect();
30  
31      httpServletRequest.getSession().setAttribute("searchType", "browse");
32      httpServletRequest.getSession().setAttribute("collectionName", collectionName);
33  
34      SearchMgr mgr = ClientApp.instance().getSearchMgr();
35      String browseChar = String.valueOf(browseLetter.charAt(0));
36      CollectionView colView = mgr.browseByKeyField(browseChar, browseField,
37                                                    collectionName);
38  
39      httpServletRequest.getSession().setAttribute("colView", colView);
40  
41      return actionMapping.findForward("browseForward");
42    }
43  }