Revision: 16489
http://sourceforge.net/p/gate/code/16489
Author: valyt
Date: 2013-01-24 16:13:11 +0000 (Thu, 24 Jan 2013)
Log Message:
-----------
- removed mimir-demo
- started work on changing mimir-cloud into more of a general demo.
Modified Paths:
--------------
mimir/trunk/build.xml
mimir/trunk/mimir-cloud/grails-app/conf/BootStrap.groovy
mimir/trunk/mimir-cloud/grails-app/conf/Config.groovy
mimir/trunk/mimir-cloud/grails-app/conf/DataSource.groovy
mimir/trunk/mimir-cloud/grails-app/conf/MimirConfig.groovy
mimir/trunk/mimir-cloud/grails-app/views/layouts/mimir.gsp
mimir/trunk/mimir-cloud/grails-app/views/mimirStaticPages/admin.gsp
mimir/trunk/mimir-web/.classpath
mimir/trunk/mimir-web/.project
mimir/trunk/mimir-web/grails-app/conf/BuildConfig.groovy.template
mimir/trunk/mimir-web/grails-app/views/layouts/mimir.gsp
Removed Paths:
-------------
mimir/trunk/mimir-cloud/grails-app/views/mimirStaticPages/index.gsp
Modified: mimir/trunk/build.xml
===================================================================
--- mimir/trunk/build.xml 2013-01-24 16:10:40 UTC (rev 16488)
+++ mimir/trunk/build.xml 2013-01-24 16:13:11 UTC (rev 16489)
@@ -6,12 +6,9 @@
<property name="mimir-client.dir" location="${mimir-client.dirname}" />
<property name="plugins.dir" location="${plugins.dirname}" />
<property name="grails-plugin.dir" location="${grails-plugin.dirname}" />
- <property name="grails-demo-webapp.dir"
- location="${grails-demo-webapp.dirname}" />
<property name="grails-cloud-webapp.dir"
location="${grails-cloud-webapp.dirname}" />
<property name="mimir-guide.dir" location="doc" />
- <property file="mimir-web/application.properties" prefix="mimir.web." />
<property name="generated-header.java" location="etc/generated-header.java"
/>
<property name="generated-header.tex" location="etc/generated-header.tex" />
@@ -138,84 +135,7 @@
<arg value="set-version ${app.version}" />
</grails>
</target>
-
- <target name="check-demo-app">
- <!-- If the directory already exists, exit -->
- <available property="app-exists" file="${grails-demo-webapp.dir}" />
- </target>
- <target name="fail-if-exists" if="app-exists" depends="check-demo-app">
-<echo>===========================================================
-
-Target directory already exists:
- ${grails-demo-webapp.dir}
-Please delete/move it manually and try again!
-
-===========================================================</echo>
- <fail message="Application already exists."/>
- </target>
-
- <target name="mimir-demo" depends="grails.command, fail-if-exists">
- <echo>This will create a new Grails application at
${grails-demo-webapp.dir}...</echo>
-
- <xmlproperty prefix="mimir.web" file="${grails-plugin.dir}/plugin.xml" />
-
- <grails dir=".">
- <arg value="create-app" />
- <arg value="${grails-demo-webapp.name}" />
- </grails>
-
- <replace
file="${grails-demo-webapp.dir}/grails-app/conf/BuildConfig.groovy"
- token="//mavenCentral()" value="mavenCentral()" />
-
- <echo file="${grails-demo-webapp.dir}/grails-app/conf/UrlMappings.groovy"
- >class UrlMappings { static mappings = {} }</echo>
- <echo file="${grails-demo-webapp.dir}/grails-app/conf/BuildConfig.groovy"
- append="true">
-
-// version of GWT to use - this will be downloaded automatically using ivy
-gwt.version = "${gwt.version}"
-</echo>
-
- <grails dir="${grails-demo-webapp.dir}">
- <arg value="clean" />
- </grails>
-
- <grails dir="${grails-demo-webapp.dir}">
- <arg value="set-version" />
- <arg value="${app.version}" />
- </grails>
-
- <grails dir="${grails-demo-webapp.dir}">
- <arg value="install-plugin" />
- <arg
file="${grails-plugin.dir}/grails-${mimir.web.plugin(name)}-${mimir.web.plugin(version)}.zip"
/>
- </grails>
-
- <!-- The first compile always fails due to GWT classes being added to the
- classpath too late. When that happens, we need to run compile a second
time.
- -->
- <trycatch>
- <try>
- <grails dir="${grails-demo-webapp.dir}">
- <arg value="compile" />
- </grails>
- </try>
- <catch>
- <echo>First Grails compilation failed (GWT not on the classpath?);
re-trying...</echo>
- <grails dir="${grails-demo-webapp.dir}">
- <arg value="compile" />
- </grails>
- </catch>
- </trycatch>
-
- <echo>
- A new Grails application was created at ${grails-demo-webapp.name}.
- Please edit the configuration according to your local set-up (see in
- particular /grails-app/conf/MimirConfig.groovy). Check the user manual (in
- doc/mimir-guide.pdf) for details of what the various configuration options
- mean.</echo>
- </target>
-
<target name="all"
depends="core, plugins, grails-plugin, prepare-cloud-app,
resolve-tex-templates" />
Modified: mimir/trunk/mimir-cloud/grails-app/conf/BootStrap.groovy
===================================================================
--- mimir/trunk/mimir-cloud/grails-app/conf/BootStrap.groovy 2013-01-24
16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-cloud/grails-app/conf/BootStrap.groovy 2013-01-24
16:13:11 UTC (rev 16489)
@@ -67,10 +67,7 @@
'/*/manage/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
'/*/search/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
'/': ['IS_AUTHENTICATED_ANONYMOUSLY'],
- '/plugins/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
- '/css/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
- '/js/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
- '/images/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
+ '/static/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
'/login/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
'/logout/**': ['IS_AUTHENTICATED_ANONYMOUSLY'],
'/j_spring_security_check': ['IS_AUTHENTICATED_ANONYMOUSLY'],
Modified: mimir/trunk/mimir-cloud/grails-app/conf/Config.groovy
===================================================================
--- mimir/trunk/mimir-cloud/grails-app/conf/Config.groovy 2013-01-24
16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-cloud/grails-app/conf/Config.groovy 2013-01-24
16:13:11 UTC (rev 16489)
@@ -61,6 +61,8 @@
}
}
+gate.mimir.runningOnCloud = false
+
// If supplied, this value is used to override the scheme, server name, and
port
// parts of the index URL. This can be used to make cloud-based installations
// show their private URl here instead of the one obtained from the current
Modified: mimir/trunk/mimir-cloud/grails-app/conf/DataSource.groovy
===================================================================
--- mimir/trunk/mimir-cloud/grails-app/conf/DataSource.groovy 2013-01-24
16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-cloud/grails-app/conf/DataSource.groovy 2013-01-24
16:13:11 UTC (rev 16489)
@@ -26,7 +26,7 @@
production {
dataSource {
dbCreate = "update"
- url = "jdbc:hsqldb:file:/data/home/gate/mimir-db;shutdown=true"
+ url = "jdbc:hsqldb:file:prodDb;shutdown=true"
}
}
}
Modified: mimir/trunk/mimir-cloud/grails-app/conf/MimirConfig.groovy
===================================================================
--- mimir/trunk/mimir-cloud/grails-app/conf/MimirConfig.groovy 2013-01-24
16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-cloud/grails-app/conf/MimirConfig.groovy 2013-01-24
16:13:11 UTC (rev 16489)
@@ -37,13 +37,17 @@
// you can redefine the queryTokeniser Spring bean in resources.groovy
queryTokeniserGapp = "WEB-INF/gate-home/default-query-tokeniser.xgapp"
-// the base directory in which newly created local indexes will
-// be put.
-indexBaseDirectory = "/data/home/gate/mimir-indexes"
+// The base directory in which newly created local indexes will be put.
+// This value can be set interactively from the administration pages, so you
+// don't have to set it here. If you do, the value here will be used to
+// initialise to configuration databse record. Once a value exists in the DB,
+// the one set here _is ignored_ (so changes in the admin UI take precedence)!
+// indexBaseDirectory = "mimir-indexes"
+
// this directory is used for storing temporary files (such as index archives
// prepared for download)
-tempDir="/data/home/gate/mimir-archives"
+tempDir="mimir-archives"
// The set of scorers available. Each scorer has a name and is defined by a
// closure that returns a fully configured instance of
Modified: mimir/trunk/mimir-cloud/grails-app/views/layouts/mimir.gsp
===================================================================
--- mimir/trunk/mimir-cloud/grails-app/views/layouts/mimir.gsp 2013-01-24
16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-cloud/grails-app/views/layouts/mimir.gsp 2013-01-24
16:13:11 UTC (rev 16489)
@@ -42,7 +42,7 @@
<div id="content">
<g:layoutBody />
<div align="center">
- <p>Mímir <mimir:version />, © <a
href="http://gate.ac.uk">GATE</a> 2012.
+ <p>Mímir <mimir:version />, © <a
href="http://gate.ac.uk">GATE</a> 2013.
</p>
</div>
</div>
Modified: mimir/trunk/mimir-cloud/grails-app/views/mimirStaticPages/admin.gsp
===================================================================
--- mimir/trunk/mimir-cloud/grails-app/views/mimirStaticPages/admin.gsp
2013-01-24 16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-cloud/grails-app/views/mimirStaticPages/admin.gsp
2013-01-24 16:13:11 UTC (rev 16489)
@@ -2,6 +2,7 @@
<%@ page import="gate.mimir.web.LocalIndex" %>
<%@ page import="gate.mimir.web.RemoteIndex" %>
<%@ page import="gate.mimir.web.FederatedIndex" %>
+<%@ page import="gate.mimir.web.MimirConfiguration" %>
<%@ page import="gate.mimir.cloud.IndexDownloadController" %>
<g:set var="localIdxCnt" value="${LocalIndex.count()}" />
@@ -31,6 +32,17 @@
</div>
</g:if>
+ <g:if test="${MimirConfiguration.count() == 0}">
+ <h2>Configuration</h2>
+ <p>You need to <g:link controller="mimirConfiguration" action="edit"
id="">configure</g:link> your local Mímir instance.</p>
+ </g:if>
+ <g:else>
+ <g:if test="${!grailsApplication.config.gate.mimir.runningOnCloud}">
+ <h2>Configuration</h2>
+ <p><g:link controller="mimirConfiguration" action="show"
id="">Show/edit</g:link>
+ the configuration for your Mímir instance.</p>
+ </g:if>
+
<h2>
Indexes <span style="font-size: small;"
title="Click for more
information!">(<mimir:revealAnchor
@@ -164,25 +176,28 @@
</p>
<%
- File dataPartition = new File("/data");
- if(dataPartition.isDirectory()) {
- try {
- long total = dataPartition.getTotalSpace();
- long free = dataPartition.getFreeSpace();
- long used = total - free;
- %><h2>Data volume details</h2>
- <table border="0">
- <tr><td>Total
size</td><td>${IndexDownloadController.fileSize(total)}</td></tr>
- <tr><td>Free
space</td><td>${IndexDownloadController.fileSize(free)}</td></tr>
- <tr><td>Usage</td><td><%= (int)(((double)used) / total * 100)
%>%</td></tr>
- </table>
- <%
- }
- catch(Exception e) {
- e.printStackTrace();
- }
- }
+ if(grailsApplication.config.gate.mimir.runningOnCloud){
+ File dataPartition = new File("/data");
+ if(dataPartition.isDirectory()) {
+ try {
+ long total = dataPartition.getTotalSpace();
+ long free = dataPartition.getFreeSpace();
+ long used = total - free;
+ %><h2>Data volume details</h2>
+ <table border="0">
+ <tr><td>Total
size</td><td>${IndexDownloadController.fileSize(total)}</td></tr>
+ <tr><td>Free
space</td><td>${IndexDownloadController.fileSize(free)}</td></tr>
+ <tr><td>Usage</td><td><%= (int)(((double)used) /
total * 100) %>%</td></tr>
+ </table>
+ <%
+ }
+ catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
%>
+ </g:else>
</div>
</body>
</html>
Deleted: mimir/trunk/mimir-cloud/grails-app/views/mimirStaticPages/index.gsp
===================================================================
--- mimir/trunk/mimir-cloud/grails-app/views/mimirStaticPages/index.gsp
2013-01-24 16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-cloud/grails-app/views/mimirStaticPages/index.gsp
2013-01-24 16:13:11 UTC (rev 16489)
@@ -1,30 +0,0 @@
-<%@ page import="gate.mimir.web.Index" %>
-<%@ page import="gate.mimir.web.LocalIndex" %>
-<%@ page import="gate.mimir.web.RemoteIndex" %>
-<%@ page import="gate.mimir.web.FederatedIndex" %>
-
-<g:set var="localIdxCnt" value="${LocalIndex.count()}" />
-<g:set var="remoteIdxCnt" value="${RemoteIndex.count()}" />
-<g:set var="fedIdxCnt" value="${FederatedIndex.count()}" />
-
-<html>
- <head>
- <title>
- Welcome to Mimir (<mimir:createRootUrl />)
- </title>
- <meta name="layout" content="mimir" />
- <mimir:load />
- </head>
- <body>
- <div class="body">
- <h1>Welcome to Mímir (<mimir:createRootUrl />)</h1>
-
- <g:if test="${flash.message}">
- <div class="message">${flash.message}</div>
- </g:if>
- <p>
- You can administer your Mímir instance on <g:link
action="admin">this page</g:link>.
- </p>
- </div>
- </body>
-</html>
Modified: mimir/trunk/mimir-web/.classpath
===================================================================
--- mimir/trunk/mimir-web/.classpath 2013-01-24 16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-web/.classpath 2013-01-24 16:13:11 UTC (rev 16489)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/java"/>
- <classpathentry kind="src" path="src/gwt"/>
<classpathentry kind="src" path="src/groovy"/>
<classpathentry kind="src" path="grails-app/conf"/>
<classpathentry kind="src" path="grails-app/controllers"/>
@@ -12,7 +11,6 @@
<classpathentry kind="src" path="test/integration"/>
<classpathentry kind="src" path="test/unit"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <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.8/grails-app/conf">
<attributes>
<attribute
name="org.grails.ide.eclipse.core.SOURCE_FOLDER" value="true"/>
@@ -109,5 +107,18 @@
</attributes>
</classpathentry>
<classpathentry kind="con"
path="org.grails.ide.eclipse.core.CLASSPATH_CONTAINER"/>
+ <classpathentry kind="lib"
path="/home/valyt/apps/gwt-2.5.0/gwt-user.jar">
+ <attributes>
+ <attribute name="javadoc_location"
value="file:/home/valyt/apps/gwt-2.5.0/doc/javadoc/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib"
path="/home/valyt/apps/gwt-2.5.0/gwt-dev.jar">
+ <attributes>
+ <attribute name="javadoc_location"
value="file:/home/valyt/apps/gwt-2.5.0/doc/javadoc/"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="lib"
path="/home/valyt/apps/gwt-2.5.0/validation-api-1.0.0.GA.jar"
sourcepath="/home/valyt/apps/gwt-2.5.0/validation-api-1.0.0.GA-sources.jar"/>
+ <classpathentry kind="lib"
path="/home/valyt/apps/gwt-2.5.0/validation-api-1.0.0.GA-sources.jar"/>
+ <classpathentry kind="con"
path="com.google.gwt.eclipse.core.GWT_CONTAINER/gwt-2.4.0"/>
<classpathentry kind="output" path="target-eclipse/classes"/>
</classpath>
Modified: mimir/trunk/mimir-web/.project
===================================================================
--- mimir/trunk/mimir-web/.project 2013-01-24 16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-web/.project 2013-01-24 16:13:11 UTC (rev 16489)
@@ -10,22 +10,11 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
-
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
-
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.grails.ide.eclipse.core.nature</nature>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
- <nature>com.google.gwt.eclipse.core.gwtNature</nature>
</natures>
<linkedResources>
<link>
Modified: mimir/trunk/mimir-web/grails-app/conf/BuildConfig.groovy.template
===================================================================
--- mimir/trunk/mimir-web/grails-app/conf/BuildConfig.groovy.template
2013-01-24 16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-web/grails-app/conf/BuildConfig.groovy.template
2013-01-24 16:13:11 UTC (rev 16489)
@@ -46,7 +46,9 @@
}
compile(":hibernate:$grailsVersion")
compile(":webflow:2.0.0")
- compile(":gwt:0.8")
+ compile(":gwt:0.8") {
+ excludes 'resources'
+ }
}
}
Modified: mimir/trunk/mimir-web/grails-app/views/layouts/mimir.gsp
===================================================================
--- mimir/trunk/mimir-web/grails-app/views/layouts/mimir.gsp 2013-01-24
16:10:40 UTC (rev 16488)
+++ mimir/trunk/mimir-web/grails-app/views/layouts/mimir.gsp 2013-01-24
16:13:11 UTC (rev 16489)
@@ -27,7 +27,7 @@
<div id="content">
<g:layoutBody />
<div align="center">
- <p>Mímir <mimir:version />, ©
<a href="http://gate.ac.uk">GATE</a> 2012.</p>
+ <p>Mímir <mimir:version />, ©
<a href="http://gate.ac.uk">GATE</a> 2013.</p>
</div>
</div>
<r:layoutResources/>
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs