Project

General

Profile

« Previous | Next » 

Revision 3011

Add qformat parameter in call to executeAdvancedSearch() method.

Refactor code to get the relative paths of the resultset XSL and search results JSP from the MetacatHelper class rather than hard-coded.

View differences:

BrowseServlet.java
52 52
   */
53 53
  private static final String CONFIG_DIR = "WEB-INF";
54 54
  private static final String CONFIG_NAME = "metacat.properties";
55
  static final long serialVersionUID = 0;  // Needed for Eclipse warning.
55 56
		   
56 57
  // Instance Variables
57 58
  private String contextString = "";
......
68 69
    RequestDispatcher dispatcher;
69 70
    HttpSession httpSession = request.getSession();
70 71
    Metacat metacat = (Metacat) httpSession.getAttribute("metacat");
72
    MetacatHelper metacatHelper = new MetacatHelper();
71 73
    String metacatURL;
74
    String qformat = (String) httpSession.getAttribute("qformat");
72 75
    String result = "";
73
    final String resultsJSP = "style/skins/default/advancedsearchresults.jsp";
76
    final String resultsJSP = metacatHelper.getResultsJSP();
74 77
    ServletContext servletContext = httpSession.getServletContext();
75
    String stylesheet = (String) httpSession.getAttribute("stylesheet");
76
    String xslPath = servletContext.getRealPath("style/common/resultset.xsl");
78
    String xslPath = metacatHelper.getResultsetXSL(request);
77 79

  
78 80
    // First check whether the metacat URL was set as a context-param.
79 81
    metacatURL = servletContext.getInitParameter("metacatURL");
......
81 83
    // If no metacat URL was configured, then derive the metacat URL from the
82 84
    // server name and server port.
83 85
    if (metacatURL == null || metacatURL.equals("")) {
84
      MetacatHelper metacatHelper = new MetacatHelper();
85 86
      String serverName = request.getServerName();
86 87
      int serverPort = request.getServerPort();
87 88
      metacatURL = 
88
    	  metacatHelper.constructMetacatURL(serverName, serverPort, contextString);
89
    	 metacatHelper.constructMetacatURL(serverName, serverPort, contextString);
89 90
    }
90 91

  
91 92
    // Tell the web server that the response is HTML
......
94 95
    // Fetch the browseValue parameter from the request and execute a search
95 96
    advancedSearch = new AdvancedSearch(null);
96 97
    browseValue = request.getParameter("browseValue");
97
    result = advancedSearch.executeSearch(metacatURL, metacat, xslPath, 
98
                                          browseValue);
98
    result = advancedSearch.executeSearch(metacatURL, metacat, qformat,
99
                                          xslPath, browseValue);
99 100

  
100 101
    // Store the result HTML string in the request for retrieval by
101 102
    // the metacatpathqueryresults.jsp form.

Also available in: Unified diff