Skip to content

Commit 2d4df96

Browse files
authored
Initial commit
0 parents  commit 2d4df96

File tree

16 files changed

+488
-0
lines changed

16 files changed

+488
-0
lines changed

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Documentation for all configuration options:
2+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
# For java deps
7+
- package-ecosystem: maven
8+
directory: "/"
9+
schedule:
10+
interval: daily
11+
open-pull-requests-limit: 15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Taken from https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions
2+
3+
name: Dependabot auto-merge
4+
on: pull_request
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
10+
jobs:
11+
dependabot:
12+
runs-on: ubuntu-latest
13+
if: github.actor == 'dependabot[bot]'
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Dependabot metadata
17+
id: metadata
18+
uses: dependabot/fetch-metadata@v2
19+
with:
20+
github-token: "${{ secrets.GITHUB_TOKEN }}"
21+
- name: Approve a PR if not already approved
22+
run: |
23+
gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status`
24+
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ];
25+
then gh pr review --approve "$PR_URL"
26+
else echo "PR already approved, skipping additional approvals to minimize emails/notification noise.";
27+
fi
28+
env:
29+
PR_URL: ${{github.event.pull_request.html_url}}
30+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
31+

.github/workflows/ci.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
3+
4+
name: Java CI
5+
6+
on:
7+
push:
8+
branches: [ "master" ]
9+
pull_request:
10+
branches: [ "master" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
cache: maven
25+
- name: Build with Maven
26+
run: mvn -B package --file pom.xml
27+

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# compilation artifacts
2+
module/MOD-INF/classes/
3+
module/MOD-INF/lib/
4+
target/
5+
test-output/
6+
7+
# editor files
8+
.idea/
9+
.classpath
10+
.project
11+
.settings/
12+
*.log
13+
logs
14+
*~
15+
\#*#
16+
.*.swp
17+
*.DS_Store
18+
*.class
19+
*.patch
20+
.vscode/

LICENSE.txt

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright 2010, Google Inc. All rights reserved.
2+
Copyright 2010, OpenRefine contributors.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Sample OpenRefine extension
2+
===========================
3+
4+
This repository contains a scaffold of an OpenRefine extension, which you can use as a basis to write your own.
5+
See [our guide to writing extensions](https://openrefine.org/docs/technical-reference/writing-extensions) for more information about the process.
6+
7+
### Getting started
8+
9+
To start your own extension, click the "Use this template" button in the top right corner of this page.
10+
This will create a copy of this repository, where you can then change:
11+
* The extension name and description in `module/MOD-INF/module.properties`
12+
* The `groupId`, `artifactId`, `name` and `description` fields in `pom.xml`
13+
* Edit this `README.md` file to describe your extension to potential users and contributors instead of the sample extension's own instructions
14+

module/MOD-INF/controller.js

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
3+
Copyright 2010, Google Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are
8+
met:
9+
10+
* Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above
13+
copyright notice, this list of conditions and the following disclaimer
14+
in the documentation and/or other materials provided with the
15+
distribution.
16+
* Neither the name of Google Inc. nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
32+
*/
33+
34+
var html = "text/html";
35+
var encoding = "UTF-8";
36+
var ClientSideResourceManager = Packages.com.google.refine.ClientSideResourceManager;
37+
38+
/*
39+
* Function invoked to initialize the extension.
40+
*/
41+
function init() {
42+
// Script files to inject into /project page
43+
ClientSideResourceManager.addPaths(
44+
"project/scripts",
45+
module,
46+
[
47+
"scripts/project-injection.js"
48+
]
49+
);
50+
51+
// Style files to inject into /project page
52+
ClientSideResourceManager.addPaths(
53+
"project/styles",
54+
module,
55+
[
56+
"styles/project-injection.css"
57+
]
58+
);
59+
60+
// Here you can register all sorts of server-side components following the extension points listed in:
61+
// https://openrefine.org/docs/technical-reference/writing-extensions#server-side-ajax-commands
62+
}
63+
64+

module/MOD-INF/module.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name = openrefine-sample-extension
2+
description = OpenRefine Sample Extension - place your description here
3+
templating.macros = macros.vm
4+
requires = core

module/index.vt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#*
2+
* Access this page at the URL /extension/sample/
3+
*#
4+
<html>
5+
<head>
6+
<title>Sample Extension</title>
7+
</head>
8+
<body>
9+
<h1>Sample Extension</h1>
10+
11+
<p>If an extension needs its own page, then this is such an example.
12+
However, mostly, extensions only need to inject their own scripts
13+
and styles into the /project page.
14+
</p>
15+
16+
<p>Here is someString: $someString, and someInt: $someInt</p>
17+
18+
<p>Here is a sample list using a veloci-macro:</p>
19+
20+
#set( $greatlakes = ["Superior","Michigan","Huron","Erie","Ontario"] )
21+
#makeAList( $greatlakes )
22+
</body>
23+
</html>

module/macros.vm

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#*
2+
This file contains common velocity macros used in all .vt files.
3+
For Velocity documentation, see:
4+
5+
http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html
6+
*#
7+
8+
#macro( makeAList $list )
9+
<ul>
10+
#foreach($item in $list)
11+
<li>$item</li>
12+
#end
13+
</ul>
14+
#end

module/scripts/project-injection.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
3+
Copyright 2010, Google Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are
8+
met:
9+
10+
* Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above
13+
copyright notice, this list of conditions and the following disclaimer
14+
in the documentation and/or other materials provided with the
15+
distribution.
16+
* Neither the name of Google Inc. nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
32+
*/
33+
34+
// This file is added to the /project page
35+
36+
var SampleExtension = {};

module/styles/project-injection.css

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
3+
Copyright 2010, Google Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are
8+
met:
9+
10+
* Redistributions of source code must retain the above copyright
11+
notice, this list of conditions and the following disclaimer.
12+
* Redistributions in binary form must reproduce the above
13+
copyright notice, this list of conditions and the following disclaimer
14+
in the documentation and/or other materials provided with the
15+
distribution.
16+
* Neither the name of Google Inc. nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
32+
*/
33+
34+
/* CSS styles */
35+
36+
:root {
37+
--color: blue;
38+
}

0 commit comments

Comments
 (0)