Skip to content

Commit 91dadff

Browse files
committed
Merge branch 'master' of ssh://github.com/OpenRefine/CommonsExtension
2 parents 677082e + fe483d3 commit 91dadff

35 files changed

+4804
-16
lines changed

.github/FUNDING.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: [openrefine]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: ['https://donorbox.org/open-refine']

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# MacOS ignored files
2+
.DS_Store
3+
14
# eclipse-related files
25
.classpath
36
.project

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Commons extension (name not final)
2-
==================================
1+
Commons extension
2+
=================
33

44
This is an OpenRefine extension for Wikimedia Commons.
55
It works with OpenRefine 3.6+.
@@ -18,12 +18,12 @@ This creates a zip file in the `target` folder, which can then be [installed in
1818
Developing it
1919
-------------
2020

21-
To avoid having to unzip the extension in the corresponding directory every time you want to test it, you can also use another set up: simply create a symbolic link from your extensions folder in OpenRefine to the local copy of this repository.
22-
You will still need to restart OpenRefine every time you make changes.
21+
To avoid having to unzip the extension in the corresponding directory every time you want to test it, you can also use another set up: simply create a symbolic link from your extensions folder in OpenRefine to the local copy of this repository. With this setup, you do not need to run `mvn package` when making changes to the extension, but you will still to compile it with `mvn compile` if you are making changes to Java files, and restart OpenRefine if you make changes to any files.
2322

2423
Releasing it
2524
------------
2625

26+
- Make sure you are on the `master` branch and it is up to date (`git pull`)
2727
- Open `pom.xml` and set the version to the desired version number, such as `<version>0.1.0</version>`
2828
- Commit and push those changes
2929
- Add a corresponding git tag, with `git tag -a v0.1.0 -m "Version 0.1.0"`

module/MOD-INF/controller.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/*
2+
* Controller for Commons extension.
3+
*
4+
* This is run in the Butterfly (ie Refine) server context using the Rhino
5+
* Javascript interpreter.
6+
*/
7+
8+
var html = "text/html";
9+
var encoding = "UTF-8";
10+
var version = "0.3";
11+
12+
// Register our Javascript (and CSS) files to get loaded
13+
var ClientSideResourceManager = Packages.com.google.refine.ClientSideResourceManager;
114

215
/*
316
* Function invoked to initialize the extension.
@@ -8,4 +21,37 @@ function init() {
821
var CFR = Packages.com.google.refine.grel.ControlFunctionRegistry;
922

1023
CFR.registerFunction("extractCategories", new Packages.org.openrefine.extensions.commons.functions.ExtractCategories());
24+
CFR.registerFunction("extractFromTemplate", new Packages.org.openrefine.extensions.commons.functions.ExtractFromTemplate());
25+
26+
// Register importer and exporter
27+
var IM = Packages.com.google.refine.importing.ImportingManager;
28+
29+
IM.registerController(
30+
module,
31+
"commons-importing-controller",
32+
new Packages.org.openrefine.extensions.commons.importer.CommonsImportingController()
33+
);
34+
35+
// Script files to inject into /index page
36+
ClientSideResourceManager.addPaths(
37+
"index/scripts",
38+
module,
39+
[
40+
"scripts/index/commons-importing-controller.js",
41+
"scripts/index/commons-source-ui.js",
42+
/* add suggest library from core */
43+
"externals/suggest/suggest-4_3a.js",
44+
"scripts/index/category-suggest.js"
45+
]
46+
);
47+
48+
// Style files to inject into /index page
49+
ClientSideResourceManager.addPaths(
50+
"index/styles",
51+
module,
52+
[
53+
"styles/commons-importing-controller.less",
54+
"externals/suggest/css/suggest-4_3.min.css"
55+
]
56+
);
1157
}

module/MOD-INF/module.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name = commons
2+
description = Integration with Wikimedia Commons
3+
templating.macros = macros.vm
4+
requires = core

module/externals/suggest/css/suggest-4_3.min.css

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)