Revision: 14596
          http://gate.svn.sourceforge.net/gate/?rev=14596&view=rev
Author:   valyt
Date:     2011-11-23 15:44:35 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
Started work on the GWT UI, which will be supported by the SearchController.

Modified Paths:
--------------
    mimir/trunk/mimir-web/.classpath
    mimir/trunk/mimir-web/grails-app/conf/BuildConfig.groovy
    
mimir/trunk/mimir-web/grails-app/controllers/gate/mimir/web/SearchController.groovy

Added Paths:
-----------
    mimir/trunk/mimir-web/grails-app/views/search/index.gsp
    mimir/trunk/mimir-web/src/gwt/gate/mimir/web/
    mimir/trunk/mimir-web/src/gwt/gate/mimir/web/UI.gwt.xml
    mimir/trunk/mimir-web/src/gwt/gate/mimir/web/client/
    mimir/trunk/mimir-web/src/gwt/gate/mimir/web/client/UI.java

Modified: mimir/trunk/mimir-web/.classpath
===================================================================
--- mimir/trunk/mimir-web/.classpath    2011-11-23 13:20:06 UTC (rev 14595)
+++ mimir/trunk/mimir-web/.classpath    2011-11-23 15:44:35 UTC (rev 14596)
@@ -13,27 +13,28 @@
        <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="con" 
path="com.springsource.sts.grails.core.CLASSPATH_CONTAINER"/>
        <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
-       <classpathentry 
excluding="BuildConfig.groovy|*DataSource.groovy|UrlMappings.groovy|Config.groovy|BootStrap.groovy|spring/resources.groovy"
 kind="src" path=".link_to_grails_plugins/gwt-0.5.2/grails-app/conf">
+       <classpathentry kind="con" 
path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
+       <classpathentry 
excluding="BuildConfig.groovy|*DataSource.groovy|UrlMappings.groovy|Config.groovy|BootStrap.groovy|spring/resources.groovy"
 kind="src" path=".link_to_grails_plugins/gwt-0.6-SNAPSHOT/grails-app/conf">
                <attributes>
                        <attribute 
name="com.springsource.sts.grails.core.SOURCE_FOLDER" value="true"/>
                </attributes>
        </classpathentry>
-       <classpathentry kind="src" 
path=".link_to_grails_plugins/gwt-0.5.2/grails-app/controllers">
+       <classpathentry kind="src" 
path=".link_to_grails_plugins/gwt-0.6-SNAPSHOT/grails-app/controllers">
                <attributes>
                        <attribute 
name="com.springsource.sts.grails.core.SOURCE_FOLDER" value="true"/>
                </attributes>
        </classpathentry>
-       <classpathentry kind="src" 
path=".link_to_grails_plugins/gwt-0.5.2/grails-app/services">
+       <classpathentry kind="src" 
path=".link_to_grails_plugins/gwt-0.6-SNAPSHOT/grails-app/services">
                <attributes>
                        <attribute 
name="com.springsource.sts.grails.core.SOURCE_FOLDER" value="true"/>
                </attributes>
        </classpathentry>
-       <classpathentry kind="src" 
path=".link_to_grails_plugins/gwt-0.5.2/src/groovy">
+       <classpathentry kind="src" 
path=".link_to_grails_plugins/gwt-0.6-SNAPSHOT/src/groovy">
                <attributes>
                        <attribute 
name="com.springsource.sts.grails.core.SOURCE_FOLDER" value="true"/>
                </attributes>
        </classpathentry>
-       <classpathentry kind="src" 
path=".link_to_grails_plugins/gwt-0.5.2/src/java">
+       <classpathentry kind="src" 
path=".link_to_grails_plugins/gwt-0.6-SNAPSHOT/src/java">
                <attributes>
                        <attribute 
name="com.springsource.sts.grails.core.SOURCE_FOLDER" value="true"/>
                </attributes>

Modified: mimir/trunk/mimir-web/grails-app/conf/BuildConfig.groovy
===================================================================
--- mimir/trunk/mimir-web/grails-app/conf/BuildConfig.groovy    2011-11-23 
13:20:06 UTC (rev 14595)
+++ mimir/trunk/mimir-web/grails-app/conf/BuildConfig.groovy    2011-11-23 
15:44:35 UTC (rev 14596)
@@ -42,7 +42,7 @@
         // runtime 'mysql:mysql-connector-java:5.1.5'
     }
     plugins {
-      compile ':gwt:latest.integration'
+      compile ':gwt:0.6-SNAPSHOT'
       runtime ":webflow:$grailsVersion"
     }
 }

Modified: 
mimir/trunk/mimir-web/grails-app/controllers/gate/mimir/web/SearchController.groovy
===================================================================
--- 
mimir/trunk/mimir-web/grails-app/controllers/gate/mimir/web/SearchController.groovy
 2011-11-23 13:20:06 UTC (rev 14595)
+++ 
mimir/trunk/mimir-web/grails-app/controllers/gate/mimir/web/SearchController.groovy
 2011-11-23 15:44:35 UTC (rev 14596)
@@ -34,6 +34,7 @@
 
 /**
  * A controller for searching mimir indexes known to this instance.
+ * It supports HTML search, XML-over-HTTP, and AJAX-backing RPC actions.
  */
 class SearchController {
   
@@ -85,19 +86,27 @@
   }
 
   /**
-   * By default just run the help action.
-   */
+  * By default just run the help action.
+  */
   static defaultAction = "info"
 
+ 
+// ==================== HTML-GWT Interface ===================================
   
+  /**
+   * Action that supports the GWT-based web UI
+   */
+  def index = {
+    // GWT takes care of the rest
+    return [index:request.theIndex]
+  }
+  
+  
+  
+// ==================== XML-over-HTTP Interface ===============================
+  
   def info = {
-    def indexInstance = Index.findByIndexId(params.indexId)
-    if(!indexInstance) {
-      flash.message = "Index not found with index id ${params.indexId}"
-      redirect(uri:'/')
-      return
-    }
-    [indexInstance:indexInstance]
+    return [indexInstance:request.theIndex]
   }
 
   /**
@@ -493,8 +502,9 @@
     return queryIDs
   }
   
-  /////////////////////////// Binary protocol implementation /////////////////
   
+// ============== Binary protocol (used by remote clients) ===================
+  
   /**
    * Binary version of post query 
    */
@@ -1039,9 +1049,6 @@
       "No value provided for parameter indexId!")
     }
   }
-  
-  ////////////////////////////////////////////////////////////////////////////
-  
 }
 
 

Added: mimir/trunk/mimir-web/grails-app/views/search/index.gsp
===================================================================
--- mimir/trunk/mimir-web/grails-app/views/search/index.gsp                     
        (rev 0)
+++ mimir/trunk/mimir-web/grails-app/views/search/index.gsp     2011-11-23 
15:44:35 UTC (rev 14596)
@@ -0,0 +1,40 @@
+<html>
+<head>
+  <!-- Integrate with Sitemesh layouts           -->
+  <meta name="layout" content="mimir" />
+
+  <title>M&icute;mir Index ${index?.name}</title>
+
+  <!-- Pass some variable to the GWT code -->
+  <g:javascript>
+    var indexId = '${index?.indexId?.encodeAsJavaScript()}';
+    var uriIsLink = '${index?.uriIsExternalLink}';
+  </g:javascript>
+  
+  <!--                                           -->
+  <!-- This script loads your compiled module.   -->
+  <!-- If you add any GWT meta tags, they must   -->
+  <!-- be added before this line.                -->
+  <!--                                           -->
+  <script type="text/javascript" src="${resource(dir: 'gwt/gate.mimir.web.UI', 
file: 'gate.mimir.web.UI.nocache.js')}"></script>
+</head>
+
+<!--                                           -->
+<!-- The body can have arbitrary html, or      -->
+<!-- you can leave the body empty if you want  -->
+<!-- to create a completely dynamic ui         -->
+<!--                                           -->
+<body>
+  <!-- OPTIONAL: include this if you want history support -->
+  <iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
+
+  <!-- Add the rest of the page here, or leave it -->
+  <!-- blank for a completely dynamic interface.  -->
+  
+  <h1>Searching Index ${index?.name}</h1>
+  <div class="searchbox" id="searchBox"> </div>
+  <div class="bluebar" >Results</div>
+  <div id="searchResults">
+  </div>
+</body>
+</html>

Added: mimir/trunk/mimir-web/src/gwt/gate/mimir/web/UI.gwt.xml
===================================================================
--- mimir/trunk/mimir-web/src/gwt/gate/mimir/web/UI.gwt.xml                     
        (rev 0)
+++ mimir/trunk/mimir-web/src/gwt/gate/mimir/web/UI.gwt.xml     2011-11-23 
15:44:35 UTC (rev 14596)
@@ -0,0 +1,18 @@
+<module>
+<!--
+Copyright (c) 1995-2010, The University of Sheffield. See the file
+COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
+
+This file is part of GATE (see http://gate.ac.uk/), and is free
+software, licenced under the GNU Library General Public License,
+Version 2, June 1991 (in the distribution as file licence.html,
+and also available at http://gate.ac.uk/gate/licence.html).
+
+Valentin Tablan, 23 Nov 2011
+-->
+    <!-- Inherit the core Web Toolkit stuff.                  -->
+    <inherits name="com.google.gwt.user.User"/>
+
+    <!-- Specify the module entry point class.                   -->
+    <entry-point class="gate.mimir.web.client.UI"/>
+</module>

Added: mimir/trunk/mimir-web/src/gwt/gate/mimir/web/client/UI.java
===================================================================
--- mimir/trunk/mimir-web/src/gwt/gate/mimir/web/client/UI.java                 
        (rev 0)
+++ mimir/trunk/mimir-web/src/gwt/gate/mimir/web/client/UI.java 2011-11-23 
15:44:35 UTC (rev 14596)
@@ -0,0 +1,71 @@
+/**
+ *  UI.java
+ * 
+ *  Copyright (c) 1995-2010, The University of Sheffield. See the file
+ *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
+ *
+ *  This file is part of GATE (see http://gate.ac.uk/), and is free
+ *  software, licenced under the GNU Library General Public License,
+ *  Version 2, June 1991 (in the distribution as file licence.html,
+ *  and also available at http://gate.ac.uk/gate/licence.html).
+ *
+ *  Valentin Tablan, 23 Nov 2011 
+ */
+
+package gate.mimir.web.client;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.HTMLPanel;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.TextArea;
+
+/**
+ * Entry point classes define <code>onModuleLoad()</code>.
+ */
+public class UI implements EntryPoint {
+  
+  protected TextArea searchBox;
+  
+  protected Button searchButton;
+  
+  
+  /**
+   * This is the entry point method.
+   */
+  public void onModuleLoad() {
+    initGui();
+    initListeners();
+  }
+  
+  protected void initGui() {
+    HTMLPanel searchDiv = 
HTMLPanel.wrap(Document.get().getElementById("searchBox"));
+    
+    searchBox = new TextArea();
+    searchBox.setCharacterWidth(60);
+    searchBox.setVisibleLines(10);
+    searchDiv.add(searchBox);
+    
+    searchButton = new Button();
+    searchButton.setText("Search");
+    searchDiv.add(searchButton);
+  }
+  
+  protected void initListeners() {
+    searchButton.addClickHandler(new ClickHandler() {
+      @Override
+      public void onClick(ClickEvent event) {
+        startSearch();
+      }
+    });
+  }
+  
+  protected void startSearch() {
+    Window.alert("Search pressed");
+  }
+}


Property changes on: mimir/trunk/mimir-web/src/gwt/gate/mimir/web/client/UI.java
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to