Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Goobi workflow committed Jul 22, 2022
0 parents commit 9fc2357
Show file tree
Hide file tree
Showing 20 changed files with 959 additions and 0 deletions.
46 changes: 46 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
pipeline {

agent {
docker {
image 'maven:3-jdk-11'
args '-v $HOME/.m2:/var/maven/.m2:z -u 1000 -ti -e _JAVA_OPTIONS=-Duser.home=/var/maven -e MAVEN_CONFIG=/var/maven/.m2'
}
}

options {
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '15', daysToKeepStr: '90', numToKeepStr: '')
}



stages {
stage('prepare') {
steps {
sh 'git clean -fdx'
}
}

stage('build') {
steps {
sh 'mvn -f plugin/pom.xml package'
recordIssues enabledForFailure: true, aggregatingResults: true, tools: [java(), javaDoc()]
}
}
}

post {
success {
archiveArtifacts artifacts: '**/target/*.jar, */plugin_*.xml, plugin_*.xml', fingerprint: true, onlyIfSuccessful: true
}
changed {
emailext(
subject: '${DEFAULT_SUBJECT}',
body: '${DEFAULT_CONTENT}',
recipientProviders: [requestor(),culprits()],
attachLog: true
)
}
}
}

/* vim: set ts=2 sw=2 tw=120 et :*/
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Goobi workflow Plugin: goobi-plugin-workflow-sample

<img src="https://goobi.io/wp-content/uploads/logo_goobi_plugin.png" align="right" style="margin:0 0 20px 20px;" alt="Plugin for Goobi workflow" width="175" height="109">

This is the Sample Goobi workflow plugin. It is used as a reference implementation for future workflow plugins. It does contain a configuration file and a simple user interface.

This is a plugin for Goobi workflow, the open source workflow tracking software for digitisation projects. More information about Goobi workflow is available under https://goobi.io. If you want to get in touch with the user community simply go to https://community.goobi.io.

## KICKSTART

To start using this Sample Plugin as template, simply do the following:

### Create the repository

- Open https://gitea.intranda.com/repo/create to create a new repository
- Select as template `goobi-workflow/goobi-plugin-workflow-sample`
- Select as `Owner` the value `goobi-workflow`
- Define a `Repository name` based on convention, e.g. `goobi-plugin-workflow-myPlugin`
- Click in `Template Item` the checkbox `Git Content (Default branch)`
- Click on Button `Create Repository`

### Checkout and rename project

- Open Eclipse and checkout the new created Repository. You will find a new project with the name `A-goobi-plugin-workflow-sample` there.
- Right-click on the new project and refactor/rename it to your plugin name, e.g. `goobi-plugin-workflow-myPlugin`
- Open the ant file `build.xml` and define the plugin name there in the property `name`, e.g. replace `sample` with `myPlugin`
- Save the ant file and right-click in the outline view on the target `rename` to start renaming all configuration files, java classes and GUI files
- Right-click on the project and click `Refresh` to see the renaming results.

### Update Readme file

- The plugin is now created and ready to be used. Remember to commit your changes and don't forget to update the README.md file that is located on folder upwards of the eclipse project. As it does not get committed by Eclipse you can commit it with these commands:

```
cd ~/git/goobi-plugin-workflow-myPlugin
git commit -am "updated readme"
git push
```

## Plugin details

More information about the functionality of this plugin and the complete documentation can be found in the central documentation area at https://docs.goobi.io

Detail | Description
--- | ---
**Plugin identifier** | intranda_workflow_sample
**Plugin type** | Workflow plugin
**Licence** | GPL 2.0 or newer
**Documentation (German)** | - no documentation available -
**Documentation (English)** | - no documentation available -

## Goobi details

Goobi workflow is an open source web application to manage small and large digitisation projects mostly in cultural heritage institutions all around the world. More information about Goobi can be found here:

Detail | Description
--- | ---
**Goobi web site** | https://www.goobi.io
**Twitter** | https://twitter.com/goobi
**Goobi community** | https://community.goobi.io

## Development

This plugin was developed by intranda. If you have any issues, feedback, question or if you are looking for more information about Goobi workflow, Goobi viewer and all our other developments that are used in digitisation projects please get in touch with us.

Contact | Details
--- | ---
**Company name** | intranda GmbH
**Address** | Bertha-von-Suttner-Str. 9, 37085 Göttingen, Germany
**Web site** | https://www.intranda.com
**Twitter** | https://twitter.com/intranda
39 changes: 39 additions & 0 deletions plugin/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
3 changes: 3 additions & 0 deletions plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/bin/
/target/
.DS_Store
23 changes: 23 additions & 0 deletions plugin/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>A-goobi-plugin-workflow-sample</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
15 changes: 15 additions & 0 deletions plugin/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
4 changes: 4 additions & 0 deletions plugin/.settings/org.eclipse.m2e.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
60 changes: 60 additions & 0 deletions plugin/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<project default="devbuild">

<!-- Simply set the name of the plugin here, e.g. "xyz" or "xyz_importer") instead of "sample" -->
<property name="name" value="sample" />

<!-- Use this task to let ant copy the compiled jar files to the target folders for development -->
<target name="devbuild">
<exec executable="mvn">
<arg value="package"/>
</exec>
<copy file="module-main/target/plugin_intranda_workflow_${name}.jar" todir="/opt/digiverso/goobi/plugins/workflow/" overwrite="true"/>
<copy file="module-gui/target/plugin_intranda_workflow_${name}-GUI.jar" todir="/opt/digiverso/goobi/plugins/GUI/" overwrite="true"/>
</target>

<!-- Use this task to let configuration, plugin, user interface files and maven artifact be renamed to your plugin name -->
<target name="rename">
<replace file="pom.xml" token="&lt;artifactId&gt;sample" value="&lt;artifactId&gt;${name}" />

<replace file="module-gui/pom.xml" token="goobi-plugin-workflow-sample" value="goobi-plugin-workflow-${name}" />
<replace file="module-gui/pom.xml" token="&lt;artifactId&gt;sample" value="&lt;artifactId&gt;${name}" />
<replace file="module-gui/pom.xml" token="&lt;jar.name&gt;plugin_intranda_workflow_sample" value="&lt;jar.name&gt;plugin_intranda_workflow_${name}" />

<replace file="module-main/pom.xml" token="goobi-plugin-workflow-sample" value="goobi-plugin-workflow-${name}" />
<replace file="module-main/pom.xml" token="&lt;artifactId&gt;sample" value="&lt;artifactId&gt;${name}" />
<replace file="module-main/pom.xml" token="&lt;jar.name&gt;plugin_intranda_workflow_sample" value="&lt;jar.name&gt;plugin_intranda_workflow_${name}" />

<move file="plugin_intranda_workflow_sample.xml" tofile="plugin_intranda_workflow_${name}.xml" failonerror="false"/>
<move file="src/main/resources/GUI/META-INF/resources/uii/plugin_workflow_sample.xhtml" tofile="src/main/resources/GUI/META-INF/resources/uii/plugin_workflow_${name}.xhtml" failonerror="false"/>
<replace file="src/main/resources/GUI/META-INF/resources/uii/plugin_workflow_${name}.xhtml" token="Plugin_workflow_sample" value="Plugin_workflow_${name}" />

<script language="javascript">
var words = project.getProperty("name").split("_");
var name = "";
for (i = 0; i &lt; words.length; i++) {
name += words[i].replace( /^.|\s\S/g, function(a) { return a.toUpperCase(); });
}
project.setProperty("capitalize", name);
</script>

<move file="src/main/java/de/intranda/goobi/plugins/SampleWorkflowPlugin.java" tofile="src/main/java/de/intranda/goobi/plugins/${capitalize}WorkflowPlugin.java" failonerror="false"/>
<replace file="src/main/java/de/intranda/goobi/plugins/${capitalize}WorkflowPlugin.java" token="SampleWorkflowPlugin" value="${capitalize}WorkflowPlugin" />
<replace file="src/main/java/de/intranda/goobi/plugins/${capitalize}WorkflowPlugin.java" token="intranda_workflow_sample" value="intranda_workflow_${name}" />
<replace file="src/main/java/de/intranda/goobi/plugins/${capitalize}WorkflowPlugin.java" token="plugin_workflow_sample" value="plugin_workflow_${name}" />
<replace file="src/main/java/de/intranda/goobi/plugins/${capitalize}WorkflowPlugin.java" token="Sample workflow plugin" value="${capitalize} workflow plugin" />

<move file="src/test/java/de/intranda/goobi/plugins/SamplePluginTest.java" tofile="src/test/java/de/intranda/goobi/plugins/${capitalize}PluginTest.java" failonerror="false"/>
<replace file="src/test/java/de/intranda/goobi/plugins/${capitalize}PluginTest.java" token="SamplePluginTest" value="${capitalize}PluginTest" />

<replace file="../README.md" token="plugin-workflow-sample" value="plugin-workflow-${name}" />
<replace file="../README.md" token="intranda_workflow_sample" value="intranda_workflow_${name}" />
<replaceregexp file="../README.md" match="This is the(.*?)interface." flags="gs"
replace="This is the ${capitalize} Goobi workflow plugin. A description for this plugin is still missing." />
<replaceregexp file="../README.md" match="## KICKSTART(.*?)## Plugin details" flags="gs" replace="## Plugin details" />

<replace file=".project" token="A-goobi-plugin-workflow-sample" value="goobi-plugin-workflow-${name}" />
<replaceregexp file="build.xml" match="\t&lt;!-- Use this task to let configuration(.*?)&lt;/project&gt;" flags="gs" replace="&lt;/project&gt;" />

</target>

</project>
2 changes: 2 additions & 0 deletions plugin/module-gui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target/
.DS_Store
72 changes: 72 additions & 0 deletions plugin/module-gui/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>de.intranda.goobi.plugins.workflow</groupId>
<artifactId>sample-gui</artifactId>
<version>1.0.0</version>
<properties>
<jar.name>plugin_intranda_workflow_sample-GUI</jar.name>
<dest.folder>/opt/digiverso/goobi/plugins/GUI/</dest.folder>
</properties>
<parent>
<groupId>de.intranda.goobi.plugins.workflow</groupId>
<artifactId>sample</artifactId>
<version>1.0.0</version>
</parent>
<build>
<finalName>${jar.name}</finalName>
<resources>
<resource>
<directory>../src/main/resources/GUI</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<shortRevisionLength>10</shortRevisionLength>
<doCheck>false</doCheck>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifestEntries>
<Build-Time>${maven.build.timestamp}</Build-Time>
</manifestEntries>
<manifestSections>
<manifestSection>
<name>Versions</name>
<manifestEntries>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-SCM-Revision>${buildNumber}</Implementation-SCM-Revision>
<Implementation-SCM-Branch>${scmBranch}</Implementation-SCM-Branch>
<Goobi-Version>${goobi.version}</Goobi-Version>
</manifestEntries>
</manifestSection>
</manifestSections>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<scm>
<url>scm:git:ssh://[email protected]:goobi-workflow/goobi-plugin-workflow-sample.git</url>
<connection>scm:git:ssh://[email protected]:goobi-workflow/goobi-plugin-workflow-sample.git</connection>
</scm>
</project>
2 changes: 2 additions & 0 deletions plugin/module-main/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target/
.DS_Store
Loading

0 comments on commit 9fc2357

Please sign in to comment.