Revision: 17346
          http://sourceforge.net/p/gate/code/17346
Author:   valyt
Date:     2014-02-19 16:58:17 +0000 (Wed, 19 Feb 2014)
Log Message:
-----------
Added button to request sync-to-disk on local indexes.

Modified Paths:
--------------
    mimir/branches/5.0/mimir-cloud/.classpath
    mimir/branches/5.0/mimir-cloud/grails-app/views/indexAdmin/admin.gsp
    
mimir/branches/5.0/mimir-web/grails-app/controllers/gate/mimir/web/LocalIndexController.groovy
    mimir/branches/5.0/mimir-web/grails-app/views/indexAdmin/admin.gsp

Modified: mimir/branches/5.0/mimir-cloud/.classpath
===================================================================
--- mimir/branches/5.0/mimir-cloud/.classpath   2014-02-19 16:51:38 UTC (rev 
17345)
+++ mimir/branches/5.0/mimir-cloud/.classpath   2014-02-19 16:58:17 UTC (rev 
17346)
@@ -2,11 +2,6 @@
 <classpath>
        <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="con" 
path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
-       <classpathentry kind="src" path="/mimir-web">
-               <attributes>
-                       <attribute 
name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
-               </attributes>
-       </classpathentry>
        <classpathentry kind="src" path="src/java"/>
        <classpathentry kind="src" path="src/groovy"/>
        <classpathentry kind="src" path="grails-app/conf"/>
@@ -162,6 +157,11 @@
                        <attribute 
name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
                </attributes>
        </classpathentry>
+       <classpathentry exported="true" kind="src" path="/mimir-web">
+               <attributes>
+                       <attribute 
name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
+               </attributes>
+       </classpathentry>
        <classpathentry kind="con" 
path="org.grails.ide.eclipse.core.CLASSPATH_CONTAINER"/>
        <classpathentry kind="output" path="target-eclipse/classes"/>
 </classpath>

Modified: mimir/branches/5.0/mimir-cloud/grails-app/views/indexAdmin/admin.gsp
===================================================================
--- mimir/branches/5.0/mimir-cloud/grails-app/views/indexAdmin/admin.gsp        
2014-02-19 16:51:38 UTC (rev 17345)
+++ mimir/branches/5.0/mimir-cloud/grails-app/views/indexAdmin/admin.gsp        
2014-02-19 16:58:17 UTC (rev 17346)
@@ -110,6 +110,11 @@
             </span></td>
           </g:form>
           <g:if test="${indexInstance instanceof gate.mimir.web.LocalIndex && 
indexInstance.state == Index.READY}">
+            <g:form action="sync" controller="localIndex" 
id="${indexInstance?.id}"  method="POST">
+              <td><span class="button"><input type="submit" class="save" 
value="Sync to Disk" 
+              title="Request all documents in memory are saved to disk ASAP." 
/>
+              </span></td>
+            </g:form>
             <g:form action="download" controller="indexDownload" 
id="${indexInstance?.id}"  method="GET">
               <td><span class="button"><input type="submit" class="download" 
value="Download" 
               title="Click to download this index." />

Modified: 
mimir/branches/5.0/mimir-web/grails-app/controllers/gate/mimir/web/LocalIndexController.groovy
===================================================================
--- 
mimir/branches/5.0/mimir-web/grails-app/controllers/gate/mimir/web/LocalIndexController.groovy
      2014-02-19 16:51:38 UTC (rev 17345)
+++ 
mimir/branches/5.0/mimir-web/grails-app/controllers/gate/mimir/web/LocalIndexController.groovy
      2014-02-19 16:58:17 UTC (rev 17346)
@@ -225,6 +225,24 @@
   }
   
   /**
+   * Ask the index to sync all documents to disk
+   */
+  def sync = {
+    def localIndexInstance = LocalIndex.get( params.id )
+    
+    if(!localIndexInstance) {
+      flash.message = "LocalIndex not found with id ${params.id}"
+      redirect(controller:'indexManagement', action:'home')
+    }
+    else {
+      localIndexService.getIndex(localIndexInstance).requestSyncToDisk()
+      flash.message = "Sync to disk was requested."
+      redirect(controller: 'indexAdmin', action: 'admin', 
+          params: [indexId:localIndexInstance.indexId])
+    }
+  }
+  
+  /**
    * Register an existing index directory to be opened for searching.
    */
   def importIndex = {

Modified: mimir/branches/5.0/mimir-web/grails-app/views/indexAdmin/admin.gsp
===================================================================
--- mimir/branches/5.0/mimir-web/grails-app/views/indexAdmin/admin.gsp  
2014-02-19 16:51:38 UTC (rev 17345)
+++ mimir/branches/5.0/mimir-web/grails-app/views/indexAdmin/admin.gsp  
2014-02-19 16:58:17 UTC (rev 17346)
@@ -104,6 +104,13 @@
             </span>
             </td>
           </g:form>
+          <g:if test="${indexInstance instanceof gate.mimir.web.LocalIndex && 
indexInstance.state == Index.READY}">
+            <g:form action="sync" controller="localIndex" 
id="${indexInstance?.id}"  method="POST">
+              <td><span class="button"><input type="submit" class="save" 
value="Sync to Disk" 
+              title="Request all documents in memory are saved to disk ASAP." 
/>
+              </span></td>
+            </g:form>
+          </g:if>            
         </tr>
       </table>
     </div>

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


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to