Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • js : Contains  jquery-1.7.2.min.js and jquery-ui-1.8.21.custom.min.js script files
  • css: Contains ui-lightness folder, here are all necessary .css style files and images to display ui-lightness visual theme, (name will vary if we selected another visual theme on jQuery UI page)
Warning
titleFilename changes

Newer versions of jqueryui can contain different filenames that the ones provided in this manual, take care that your downloaded files match the references on your .jsp file

Wiki Markup
We'll create a new folder inside \[dspace-source\]/dspace-jspui/dspace-jspui-webapp/src/main/webapp/static/js/*jqueryui* and copy all previously described files inside it.. Structure will look like this:

...

Code Block
languagehtml/xml
titleadvanced.jsp
collapsetrue
...
<%
 //Add this code on top section
 //Generate JSPUI Solr path url
 String scheme = request.getScheme();             // http
 String serverName = request.getServerName();     //request.getServerName();     // hostname.com
 int serverPort = request.getServerPort();        // 80
 String parentContextPath = "";                   //Change this value if dspace not installed on html root folder
 String contextPath = "/jspui";
 String servletPath = "/searchJSON";
 // Reconstruct original requesting URL
 StringBuffer url =  new StringBuffer();
 url.append(scheme).append("://").append(serverName);
 if (serverPort != 80)
 url.append(":").append(serverPort);
 url.append(parenContextPathparentContextPath).append(contextPath).append(servletPath);
 String solrPath = url.toString();

%>
...
<!-- Add this lines after <dspace:layout> tag-->
<link type="text/css" href="<%=request.getContextPath()%>/static/js/jqueryui/css/smoothness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="<%=request.getContextPath()%>/static/js/jqueryui/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/static/js/jqueryui/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/static/js/autocomplete.js"></script>
<script type="text/javascript">
window.onload = function() {
   monkeyPatchAutocomplete();
   replaceSAXExpression('<%=solrPath %>', 10,'tfield1', 'tquery1');
   replaceSAXExpression('<%=solrPath %>', 10,'tfield2', 'tquery2');
   replaceSAXExpression('<%=solrPath %>', 10,'tfield3', 'tquery3');
}
</script>
...
<!-- Add id field and onchange event call for every search combobox, add id field on search textbox too-->
<select name="field1" id="tfield1" onchange="JavaScript:replaceSAXExpression('<%=solrPath%>', 10 ,'tfield1', 'tquery1');">
<select<input type="text" name="field2query1" id="tfield2" tquery1" value="<%=StringEscapeUtils.escapeHtml(query1)%>" size="30" />
...
<select name="field2" id="tfield2" onchange="JavaScript:replaceSAXExpression('<%=solrPath%>', 10 ,'tfield2', 'tquery2');">
<input type="text" name="query2" id="tquery2" value="<%=StringEscapeUtils.escapeHtml(query2)%>" size="30"/>
...
<select name="field3" id="tfield3" onchange="JavaScript:replaceSAXExpression('<%=solrPath%>', 10 ,'tfield3', 'tquery3');">
<input type="text" name="query3" id="tquery3" value="<%=StringEscapeUtils.escapeHtml(query3)%>" size="30"/>

Adding javascript functions

...