Added Java code to sample extension.
git-svn-id: http://google-refine.googlecode.com/svn/trunk@979 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
parent
ffbe7c9c76
commit
1f67cca3eb
@ -2,5 +2,5 @@
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="output" path="module/MOD-INF/classes"/>
|
||||
<classpathentry kind="output" path="sample-extension/MOD-INF/classes"/>
|
||||
</classpath>
|
||||
|
@ -36,7 +36,10 @@ function process(path, request, response) {
|
||||
|
||||
if (path == "/" || path == "") {
|
||||
var context = {};
|
||||
context.someVar = "foo"; // here's how to pass things into the .vt templates
|
||||
// here's how to pass things into the .vt templates
|
||||
context.someList = ["Superior","Michigan","Huron","Erie","Ontario"];
|
||||
context.someString = "foo";
|
||||
context.someInt = Packages.com.metaweb.gridworks.sampleExtension.SampleUtil.stringArrayLength(context.someList);
|
||||
|
||||
send(request, response, "index.vt", context);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
and styles into the /project page.
|
||||
</p>
|
||||
|
||||
<p>Here is someVar: $someVar.</p>
|
||||
<p>Here is someString: $someString, and someInt: $someInt</p>
|
||||
|
||||
<p>Here is a sample list using a veloci-macro:</p>
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
package com.metaweb.gridworks.sampleExtension;
|
||||
|
||||
|
||||
public class SampleUtil {
|
||||
static public int stringArrayLength(String[] a) {
|
||||
return a.length;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user