Deleted old empty protograph dirs. Use a default assign version even if running from trunk; this is so that we have at least some clue about an imported project file.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@1598 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
8b8e9f1c1b
commit
e7184ec9ab
@ -24,9 +24,11 @@ import edu.mit.simile.butterfly.Butterfly;
|
|||||||
import edu.mit.simile.butterfly.ButterflyModule;
|
import edu.mit.simile.butterfly.ButterflyModule;
|
||||||
|
|
||||||
public class RefineServlet extends Butterfly {
|
public class RefineServlet extends Butterfly {
|
||||||
|
static private String ASSIGNED_VERSION = "2.0";
|
||||||
|
|
||||||
static public String VERSION = "";
|
static public String VERSION = "";
|
||||||
static public String REVISION = "";
|
static public String REVISION = "";
|
||||||
|
static public String FULL_VERSION = "";
|
||||||
static public String FULLNAME = "Google Refine ";
|
static public String FULLNAME = "Google Refine ";
|
||||||
|
|
||||||
static public final String AGENT_ID = "/en/google_refine";
|
static public final String AGENT_ID = "/en/google_refine";
|
||||||
@ -67,7 +69,16 @@ public class RefineServlet extends Butterfly {
|
|||||||
|
|
||||||
VERSION = getInitParameter("refine.version");
|
VERSION = getInitParameter("refine.version");
|
||||||
REVISION = getInitParameter("refine.revision");
|
REVISION = getInitParameter("refine.revision");
|
||||||
FULLNAME += VERSION + " [" + REVISION + "]";
|
|
||||||
|
if (VERSION.equals("$VERSION")) {
|
||||||
|
VERSION = ASSIGNED_VERSION;
|
||||||
|
}
|
||||||
|
if (REVISION.equals("$REVISION")) {
|
||||||
|
REVISION = "TRUNK";
|
||||||
|
}
|
||||||
|
|
||||||
|
FULL_VERSION = VERSION + " [" + REVISION + "]";
|
||||||
|
FULLNAME += FULL_VERSION;
|
||||||
|
|
||||||
logger.info("Starting " + FULLNAME + "...");
|
logger.info("Starting " + FULLNAME + "...");
|
||||||
|
|
||||||
|
@ -6,6 +6,9 @@ import javax.servlet.ServletException;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import com.google.refine.RefineServlet;
|
import com.google.refine.RefineServlet;
|
||||||
|
|
||||||
public class GetVersionCommand extends Command {
|
public class GetVersionCommand extends Command {
|
||||||
@ -13,12 +16,17 @@ public class GetVersionCommand extends Command {
|
|||||||
@Override
|
@Override
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||||
try {
|
try {
|
||||||
|
JSONObject o = new JSONObject();
|
||||||
|
o.put("version", RefineServlet.VERSION);
|
||||||
|
o.put("revision", RefineServlet.REVISION);
|
||||||
|
o.put("full_version", RefineServlet.FULL_VERSION);
|
||||||
|
o.put("full_name", RefineServlet.FULLNAME);
|
||||||
|
|
||||||
response.setCharacterEncoding("UTF-8");
|
response.setCharacterEncoding("UTF-8");
|
||||||
response.setHeader("Content-Type", "text/plain");
|
response.setHeader("Content-Type", "application/json");
|
||||||
response.getWriter().write(RefineServlet.VERSION);
|
respond(response, o.toString());
|
||||||
} catch (Exception e) {
|
} catch (JSONException e) {
|
||||||
respondException(response, e);
|
e.printStackTrace(response.getWriter());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,6 @@ function init() {
|
|||||||
"externals/jquery-ui/jquery-ui-1.8.custom.min.js",
|
"externals/jquery-ui/jquery-ui-1.8.custom.min.js",
|
||||||
"externals/date.js",
|
"externals/date.js",
|
||||||
"scripts/util/string.js",
|
"scripts/util/string.js",
|
||||||
"scripts/version.js",
|
|
||||||
"scripts/index.js"
|
"scripts/index.js"
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -209,6 +209,42 @@ function openWorkspaceDir() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var GoogleRefineVersion;
|
||||||
|
function showVersion() {
|
||||||
|
$.getJSON(
|
||||||
|
"/command/core/get-version",
|
||||||
|
null,
|
||||||
|
function(data) {
|
||||||
|
GoogleRefineVersion = data;
|
||||||
|
|
||||||
|
$("#google-refine-version").text("Version " + GoogleRefineVersion.full_version);
|
||||||
|
|
||||||
|
var script = $('<script></script>')
|
||||||
|
.attr("src", "http://google-refine.googlecode.com/svn/support/releases.js")
|
||||||
|
.attr("type", "text/javascript")
|
||||||
|
.appendTo(document.body);
|
||||||
|
|
||||||
|
var poll = function() {
|
||||||
|
if ("releases" in window) {
|
||||||
|
if (isThereNewRelease()) {
|
||||||
|
var div = $('<div id="version-message">')
|
||||||
|
.text('New version "' + releases.releases[0].description + '" ')
|
||||||
|
.appendTo(document.body)
|
||||||
|
|
||||||
|
$('<a>')
|
||||||
|
.attr("href", releases.homepage)
|
||||||
|
.text("available for download here")
|
||||||
|
.appendTo(div);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
window.setTimeout(poll, 1000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.setTimeout(poll, 1000);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function onLoad() {
|
function onLoad() {
|
||||||
fetchProjects();
|
fetchProjects();
|
||||||
|
|
||||||
@ -217,27 +253,8 @@ function onLoad() {
|
|||||||
$("#more-options-controls").hide();
|
$("#more-options-controls").hide();
|
||||||
$("#more-options").show();
|
$("#more-options").show();
|
||||||
});
|
});
|
||||||
|
|
||||||
var version = (GoogleRefineVersion.version != "$VERSION") ? "Version " + GoogleRefineVersion.version + " [" + GoogleRefineVersion.revision + "]" : "Version <trunk>";
|
showVersion();
|
||||||
$("#google-refine-version").text(version);
|
|
||||||
|
|
||||||
var script = $('<script></script>')
|
|
||||||
.attr("src", "http://google-refine.googlecode.com/svn/support/releases.js")
|
|
||||||
.attr("type", "text/javascript")
|
|
||||||
.appendTo(document.body);
|
|
||||||
|
|
||||||
var poll = function() {
|
|
||||||
if ("releases" in window) {
|
|
||||||
if (isThereNewRelease()) {
|
|
||||||
$('<div id="version-message">' +
|
|
||||||
'New version "' + releases.releases[0].description + '" <a href="' + releases.homepage + '">available for download here</a>.' +
|
|
||||||
'</div>').appendTo(document.body);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
window.setTimeout(poll, 1000);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
window.setTimeout(poll, 1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(onLoad);
|
$(onLoad);
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
var GoogleRefineVersion = {
|
|
||||||
description: "Google Refine $VERSION",
|
|
||||||
version: "$VERSION",
|
|
||||||
revision: "$REVISION"
|
|
||||||
};
|
|
@ -129,4 +129,15 @@
|
|||||||
top: 12px;
|
top: 12px;
|
||||||
right: 10px;
|
right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#version-message {
|
||||||
|
position: fixed;
|
||||||
|
top: -1px;
|
||||||
|
padding: @padding_loose;
|
||||||
|
left: 40%;
|
||||||
|
width: 20%;
|
||||||
|
background: @fill_primary;
|
||||||
|
border: 1px solid @chrome_primary;
|
||||||
|
|
||||||
|
.rounded_corners_bottom(10px);
|
||||||
|
}
|
@ -48,3 +48,12 @@
|
|||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
border-bottom-left-radius: 0;
|
border-bottom-left-radius: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rounded_corners_bottom (@radius: 10px) {
|
||||||
|
-webkit-border-bottom-left-radius: @radius;
|
||||||
|
-webkit-border-bottom-right-radius: @radius;
|
||||||
|
-moz-border-radius-bottomleft: @radius;
|
||||||
|
-moz-border-radius-bottomright: @radius;
|
||||||
|
border-bottom-left-radius: @radius;
|
||||||
|
border-bottom-right-radius: @radius;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user