Skip to content

Commit

Permalink
restored from master, added ODR.getLocale
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLeoni committed Aug 26, 2013
1 parent 205b828 commit b97f1ea
Show file tree
Hide file tree
Showing 147 changed files with 1,384 additions and 1,365 deletions.
4 changes: 1 addition & 3 deletions extensions/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
<echo message="Building extensions" />
<ant dir="sample/" target="build" />
<ant dir="jython/" target="build" />
<ant dir="rdf-extension/" target="build" />
<ant dir="odrext/" target="build" />
<ant dir="odrext/" target="build" />
</target>

<target name="clean">
<echo message="cleaning extensions" />
<ant dir="sample/" target="clean" />
<ant dir="jython/" target="clean" />
<ant dir="rdf-extension/" target="clean" />
<ant dir="odrext/" target="clean" />
</target>
</project>
46 changes: 2 additions & 44 deletions extensions/odrext/module/MOD-INF/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ var ClientSideResourceManager = Packages.com.google.refine.ClientSideResourceMan
var davProject = Packages.com.google.refine.model.Project;
var PO = Packages.eu.trentorise.opendata.opendatarise.OdrProjectOverlay;
var ODR = Packages.eu.trentorise.opendata.opendatarise.ODR;
var VelocityHelper = Packages.eu.trentorise.opendata.opendatarise.VelocityHelper;
var Catalogs = Packages.eu.trentorise.opendata.opendatarise.Catalogs;
var logger = ODR.logger;
var OperationRegistry = Packages.com.google.refine.operations.OperationRegistry;
var RefineServlet = Packages.com.google.refine.RefineServlet;
Expand Down Expand Up @@ -39,7 +37,6 @@ function init() {
module,
[
"scripts/widgets/helpbox-widget.js"
//,"scripts/index/ckan-importing-controller.js"
]);


Expand All @@ -58,8 +55,7 @@ function init() {
module,
[
"scripts/ODR.js",
"scripts/widgets/helpbox-widget.js"

"scripts/widgets/helpbox-widget.js"
]
);

Expand All @@ -74,34 +70,12 @@ function init() {
);


ClientSideResourceManager.addPaths(
"index/scripts",
module,
[
// "scripts/ODRCKAN.js"
]
);

ClientSideResourceManager.addPaths(
"index/styles",
module,
[
// "styles/ODRCKAN.less"
]
);



logger.debug("Registering overlay model");
davProject.registerOverlayModel(
"OdrProjectOverlay",
PO);

logger.debug("Initalizing Catalogs");
Catalogs.init();

// logger.debug(CKANalyzeRawStats.cip);

logger.info("Finished initializing.");

}
Expand All @@ -111,29 +85,13 @@ function init() {
*/

function process(path, request, response) {
var context = {};
// Analyze path and handle this request yourself.

if (path === "/" || path === "") {

var context = {};

send(request, response, "index.vt", context);
} else
logger.debug("Received request for path: " + path);

if (path === "ckanalyze-raw.vt") {

context = {ckanStats: CKANalyzeRawStats.getStats(),
catalogStats: CKANalyzeRawStats.getStats().getCatalogStats(),
// Velocity doesn't like static classes. Screw it.
vh: new VelocityHelper()};

send(request, response, "ckanalyze-raw.vt", context);
//send(request, response, "index.vt", context);
} else {
send(request, response, path, context);
}

}


Expand Down
2 changes: 1 addition & 1 deletion extensions/odrext/module/index.vt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@


</body>
</html>
</html>
3 changes: 1 addition & 2 deletions extensions/odrext/module/langs/translation-default.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@

},
"step-1": {
"ckan" : "CKAN",
"name": "Selection",
"help-1-title": "",
"help-1-descr": ""
"help-1-descr": ""
},
"step-2": {
"name": "Schema matching",
Expand Down
73 changes: 73 additions & 0 deletions extensions/odrext/module/langs/translation-en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

{
"navigation": {
"step": "Step",
"more-help": "More help"
},
"step-0": {
"name": "BAD STEP",
"help-1-title": "ERROR: I shouldn't be in this step",
"help-1-descr": "ERROR: I shouldn't be in this step"

},
"step-1": {
"name": "Selection",
"help-1-title": "",
"help-1-descr": ""
},
"step-2": {
"name": "Schema matching",
"help-1-title": "Match types in the source fields with types in the target entity type",
"help-2-title": "You can preview the data in the left area of the screen",
"help-3-title": "When done, click NEXT to proceed to Data Validation step"
},
"step-3": {
"name": "Data validation",
"help-1-title": "Columns with a red title require attention",
"help-1-descr": "Columns with a red title and a progress bar contain an amount of of cells not respecting the column type indicated by the progress bar",
"help-2-title": "Each cell content must respect its column type",
"help-2-descr": "When values respect the type indicated in their column they are displayed in green, otherwise they are displayed in black",
"help-3-title": "When done, click NEXT to go to the enrichment step"
},
"step-4": {
"name": "Enrichment",
"help-1-title": "Enrich columns with relational attributes",
"help-1-descr": "In columns with a red title, for relational attiributes select Reconcile->Start reconciling from the column menu to link names in the cells to entities",
"help-2-title": "Enrich columns of type SemantifiedText",
"help-2-descr": "In columns of type SemantifiedText with a red title, select Perform NLP from the column menu to enrich the text",
"help-3-title": "When all bars are green, click NEXT",
"help-3-descr": "By clicking NEXT you will proceed to the Reconciliation (at row level) step."
},
"step-5": {
"name": "Reconciliation",
"help-1-title": "Each row represents an entity",
"help-2-title": "Choose the service to link rows to entities",
"help-3-title": "Choose on which attributes perform the search",
"help-4-title": "click RECONCILE to start horizontal reconciciliation"
},
"step-5-automatic-reconcile": {
"help-1-title": "Assign to each row a unique id in the first column",
"help-2-title": "Create new entities or update existing ones",
"help-3-title": "Click NEXT button to proceed to Export step"
},
"step-6": {
"name": "Exporting",
"help-1-title": "Commit changes to Entitypedia",
"help-2-title": "Download the RDF version of the dataset",
"help-3-title": "Click NEXT button to proceed to Publish step"
},
"step-7": {
"name": "Publishing",
"help-1-title": "A new RDF dataset resource will be now created on CKAN",
"help-2-title": "Enter the metadata values to associate to the resource on CKAN",
"help-3-title": "Click Upload",
"help-4-title": "Clic NEXT to proceed to visualization step"
},
"step-8": {
"name": "Visualization",
"help-1-title": "Todo - Yet to be decided"
}



}
5 changes: 2 additions & 3 deletions extensions/odrext/module/scripts/ODR.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $.ajax({
type : "POST",
async : false,
data : {
module : "odrext"
module : "odrext",
// lang : lang
},
success : function(data) {
Expand Down Expand Up @@ -109,8 +109,7 @@ var ODR = {
/**
* Fills an helpbox with string taken from the language dictionary
* @param {string} id id of the helpbox to fill in. ie 'myHelpbox'
* @param {number} nElements number of elements to fill
* @param {string} dict Dictionary where to find helpbox contents
* @param {number} nElements number of elements to fill
*/
fillHelpBox : function(id, dict, nElements){
var helpbox = $("#"+id);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package eu.trentorise.opendata.opendatarise.tests;

import org.testng.annotations.Test;

/**
*
* @author David Leoni
*/
@Test
public class LoadProjectTest {
@Test
public void trial(){
assert true;
}
}
1 change: 1 addition & 0 deletions extensions/rdf-extension/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ module/MOD-INF/classes/*
tmp/
test-output/
#odr end

2 changes: 1 addition & 1 deletion extensions/rdf-extension/module/MOD-INF/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,4 @@ function process(path, request, response) {
if (path == "/" || path == "") {
butterfly.redirect(request, response, "index.html");
}
}
}
4 changes: 3 additions & 1 deletion extensions/rdf-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
</parent>


<groupId>org.deri.grefine</groupId>

<artifactId>rdf-extension</artifactId>
<version>0.8-684b4ecf35</version>
<packaging>jar</packaging>




</project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
52 changes: 5 additions & 47 deletions main/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>


Expand Down Expand Up @@ -106,7 +106,7 @@
<includes>
<include>**/*.tsv</include>
</includes>
<preservePath>true</preservePath>
<preservePath>true</preservePath>
</resource>
<!-- copy other resources -->
<resource>
Expand Down Expand Up @@ -142,18 +142,7 @@
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>


</plugins>
</build>
Expand Down Expand Up @@ -342,7 +331,7 @@
<!-- ********************** LOCAL REPO DEPENDENCIES **************************** -->

<!-- used this in the cmd windows shell. in Powershell it doesn't work!!!!
C:\Users\david_2\Da\prj\opendatarise\OpenDataRise\prj\main>mvn deploy:deploy-file -DgroupId=eu.trentorise.opendata.deps -Dpackaging=jar -Durl=file:repo/ -DartifactId=butterfly -Dversion=trunk -Dsources=webapp/WEB-INF/lib-src/butterfly-trunk-sources.jar -Dfile=webapp/WEB-INF/lib/butterfly-trunk.jar -->
C:\Users\david_2\Da\prj\opendatarise\OpenDataRise\prj\main> mvn deploy:deploy-file -DgroupId=eu.trentorise.opendata.deps -DartifactId=arith-code -Dpackaging=jar -Dversion=1.1 -Dfile=///C:/Users/david_2/Da/prj/opendatarise/OpenDataRise/prj/main/webapp/WEB-INF/lib/arithcode-1.1.jar -Durl=file://C:/Users/david_2/Da/prj/opendatarise/OpenDataRise/prj/main/repo/ -->

<dependency>
<groupId>org.openrefine.deps</groupId>
Expand Down Expand Up @@ -533,37 +522,6 @@ C:\Users\david_2\Da\prj\opendatarise\OpenDataRise\prj\main>mvn deploy:deploy-fil

<!-- in theory there would be a test dependency for jackson-core-asl-1.5.6 and jackson-mapper-asl-1.5.6 -->
<!-- ************ END FROM RDF-EXTENSION -->
<!-- ************ for ckanlayze *************** -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.12</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.12</version>
</dependency>
<!-- ************ end for ckanalyze ************ -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<version>2.0.1</version>
</dependency>

</dependencies>
</project>
2 changes: 1 addition & 1 deletion main/src/com/google/refine/RefineServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -383,4 +383,4 @@ static public void setUserAgent(HttpURLConnection httpConnection) {
static public String getUserAgent() {
return "OpenRefine/" + FULL_VERSION;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ public void doPost(HttpServletRequest request, HttpServletResponse response)
response.getWriter().flush();
response.getWriter().close();
loaded = true;

// odr start
eu.trentorise.opendata.opendatarise.ODR.setLocale(lang);
// odr end

break;
} catch (FileNotFoundException e1) {
json = null;
Expand Down
Loading

0 comments on commit b97f1ea

Please sign in to comment.