idok-commit AT lists.psi.ch
Subject: Commit emails of the iDok project
List archive
[idok-commit] idok commit r267 - trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client
Chronological Thread
- From: "AFS account Roman Geus" <geus AT savannah.psi.ch>
- To: idok-commit AT lists.psi.ch
- Subject: [idok-commit] idok commit r267 - trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client
- Date: Tue, 30 Sep 2008 16:42:51 +0200
- List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
- List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>
Author: geus
Date: Tue Sep 30 16:42:51 2008
New Revision: 267
Log:
Implemented advisory note if maximum number of search results have been
returned, added iDok icon
Modified:
trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client/IdokSearchTwikiMashup.java
Modified:
trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client/IdokSearchTwikiMashup.java
==============================================================================
---
trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client/IdokSearchTwikiMashup.java
(original)
+++
trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client/IdokSearchTwikiMashup.java
Tue Sep 30 16:42:51 2008
@@ -44,6 +44,11 @@
static final boolean debug = false;
/**
+ * Number of requested search hits
+ */
+ static final int MAX_HITS = 100;
+
+ /**
* iDok repository to search in, formatted as $PROJECT/$REPOSITORY
*/
String repository = null;
@@ -117,7 +122,7 @@
*/
protected void doRestCall(String repository, String query) {
String url = BASEURL + repository + "?q=" + query
- + "&outputfields=env,meta&num=100";
+ + "&outputfields=env,meta&num=" + MAX_HITS;
GWT.log("Requesting " + url + " using JSONP", null);
JSONRequest.get(URL.encode(url) + "&callback=",
@@ -151,6 +156,8 @@
*/
protected void processQueryResult(String xmlString) {
try {
+ final String idokImgHtml = "<img border=\"0\" height=\"16\"
width=\"16\" align=\"top\" src=\"/twiki/pub/TWiki/TWikiDocGraphics/dms.gif\"
alt=\"dms\"/>";
+
RootPanel idokSearchResultPanel =
RootPanel.get("idokSearchResult");
if (idokSearchResultPanel == null)
Window.alert("Error in HTML: idokSearchResult element
missing");
@@ -317,9 +324,13 @@
url = url.substring(0, hashIndex) + "#idokResultAnchor";
else
url += "#idokResultAnchor";
- idokJumpToResultsPanel.add(new HTML("<a href=\"" + url
- + "\">Jump to iDok search results (" + numHits
- + " documents found)</a>"));
+ idokJumpToResultsPanel.add(new HTML("<p>" + idokImgHtml
+ + " <a href=\"" + url + "\">Jump to iDok search results
("
+ + numHits + " documents found)</a></p>"));
+ if (numHits == MAX_HITS)
+ idokJumpToResultsPanel
+ .add(new HTML(
+ "<p>The maximum possible number of iDok
search results has been returned. There are likely to be more documents that
match your query. Please refine your search criteria to reduce the number of
search results.</p>"));
} catch (Throwable e) {
GWT.log("Error in 'renderQueryResult()' method", e);
- [idok-commit] idok commit r267 - trunk/sites/psi/java/ch/psi/idok/gwt/twiki/client, AFS account Roman Geus, 09/30/2008
Archive powered by MHonArc 2.6.19.