Skip to content

Commit 0d621db

Browse files
authored
Merge pull request majlis-erc#758 from evolvedbinary/cleanup-build
Cleanup build and autogenerate forms
2 parents baaf3df + 104c805 commit 0d621db

767 files changed

Lines changed: 1402 additions & 425958 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
name: Build and Test
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [ubuntu-latest, macos-latest, windows-latest]
11+
jdk: [8,11,17,21]
12+
runs-on: ${{ matrix.os }}
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Setup Java
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: 'liberica'
19+
java-version: ${{ matrix.jdk }}
20+
- run: mvn clean package
21+
- name: Persist built XAR
22+
if: matrix.os == 'ubuntu-latest' && matrix.jdk == '8'
23+
uses: actions/upload-artifact@v4
24+
with:
25+
name: xar
26+
path: target/manuforma-*.xar
27+
if-no-files-found: error
28+
retention-days: 1
29+
overwrite: true
30+
- name: Persist built ci-resources
31+
if: matrix.os == 'ubuntu-latest' && matrix.jdk == '8'
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: ci-resources
35+
path: target/classes/ci-resources/*
36+
if-no-files-found: error
37+
retention-days: 1
38+
overwrite: true
39+
40+
deploy:
41+
needs: build
42+
name: Deploy
43+
runs-on: ubuntu-latest
44+
environment: manuforma-dev
45+
steps:
46+
- name: Retrieve built XAR
47+
uses: actions/download-artifact@v4
48+
with:
49+
name: xar
50+
- name: Retrieve built ci-resources
51+
uses: actions/download-artifact@v4
52+
with:
53+
name: ci-resources
54+
- name: Set scripts as executable
55+
run: chmod +x upload-remote-tmp-xar.sh redeploy-xar-package.sh delete-remote-tmp-xar.sh
56+
- name: Upload temp XAR to Remote Database Server
57+
env:
58+
REMOTE_EDB_SERVER_USERNAME: ${{ secrets.REMOTE_EDB_SERVER_USERNAME }}
59+
REMOTE_EDB_SERVER_PASSWORD: ${{ secrets.REMOTE_EDB_SERVER_PASSWORD }}
60+
REMOTE_EDB_SERVER_URL: ${{ secrets.REMOTE_EDB_SERVER_URL }}
61+
run: ./upload-remote-tmp-xar.sh
62+
- name: Redeploy XAR on Remote Database Server
63+
env:
64+
REMOTE_EDB_SERVER_USERNAME: ${{ secrets.REMOTE_EDB_SERVER_USERNAME }}
65+
REMOTE_EDB_SERVER_PASSWORD: ${{ secrets.REMOTE_EDB_SERVER_PASSWORD }}
66+
REMOTE_EDB_SERVER_URL: ${{ secrets.REMOTE_EDB_SERVER_URL }}
67+
run: ./redeploy-xar-package.sh
68+
- name: Delete temp XAR from Remote Database Server
69+
env:
70+
REMOTE_EDB_SERVER_USERNAME: ${{ secrets.REMOTE_EDB_SERVER_USERNAME }}
71+
REMOTE_EDB_SERVER_PASSWORD: ${{ secrets.REMOTE_EDB_SERVER_PASSWORD }}
72+
REMOTE_EDB_SERVER_URL: ${{ secrets.REMOTE_EDB_SERVER_URL }}
73+
run: ./delete-remote-tmp-xar.sh

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Ignore .DS_Store files
21
.DS_Store
3-
4-
#ignore .xar files
5-
*.xar
2+
target/
3+
.idea/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

README.md

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# manuForma [BETA]
22

3+
[![Build Status](https://github.com/majlis-erc/manuForma/actions/workflows/ci.yml/badge.svg)](https://github.com/majlis-erc/manuForma/actions/workflows/ci.yml)
4+
[![Java 8+](https://img.shields.io/badge/java-8+-blue.svg)](https://bell-sw.com/pages/downloads/)
35
[![DOI](https://zenodo.org/badge/474991717.svg)](https://zenodo.org/badge/latestdoi/474991717)
46

57
The manuForma application is designed to make TEI data creation and distributed editing faster and easier. The application features easy to use multi-step forms, Github interactions and more.
68

79
Custom XForms are built using an XSLT stylesheet, a custom XML configuration file, and a custom XML Schema. The schema is used to define the elements and attributes required for your project. The schema must define all of the elements and attributes you would like in your forms. All controlled values, labels, language, and available elements and attributes will be defined in your custom schema. The more restrictive your schema is the faster your forms will perform.
810

9-
TEI is a complex and large schema, so it is necessary to break the forms up into subforms. The subforms make for easier data entry and faster form load and processing time. We recommend breaking your TEI files up into the smallest meaningful blocks that you can. The application comes bundled with a few example forms, including TEI manuscripts. Use these example forms as templates to build your own custom forms.
11+
TEI is a complex and large schema, so it is necessary to break the forms up into sub-forms. The sub-forms make for easier data entry and faster form load and processing time. We recommend breaking your TEI files up into the smallest meaningful blocks that you can. The application comes bundled with a few example forms, including TEI manuscripts. Use these example forms as templates to build your own custom forms.
1012

11-
We use our manuscripts forms as an exmple for the documentation, there are also, forms for person and place records. The manuscript forms are broken up into 8 different subforms as shown below.
13+
We use our manuscripts forms as an example for the documentation, there are also, forms for person and place records. The manuscript forms are broken up into 8 different sub-forms as shown below.
1214

1315
## Building the forms
14-
Structure of the configuration file, forms/formGenerator/config.xml
16+
Structure of the configuration file: [`forms/formGenerator/config.xml`](src/main/xar-resources/forms/formGenerator/config.xml)
1517

1618
General settings including Application Name, a base url for generating working navigation once the application has been deployed. Form titles, and descriptions.
1719
```
@@ -49,4 +51,63 @@ The forms use a two step process, a ‘local schema’ which should be a very re
4951

5052
To create usable and quick forms it is important to be as restrictive as possible when designing your local shema. For example, only reference child elements that you will use, avoid broad classes or module references such as pLike. Instead for a paragraph, simply use a textNode as the only child. The XForms do not do well with mixed content nodes, so you will have to avoid this in your data design.
5153

52-
To build the form you will simply need to run the XSLT, it will use the values defined in your config.xml file to generate the necessary files to create all the form components necessary. Once the form is built, ant can be run and the applicaiton can be deployed to eXist-db. Forms were built and tested with eXist-db 5.3.1 and up.
54+
To build the form you will simply need to run the XSLT, it will use the values defined in your config.xml file to generate the necessary files to create all the form components necessary. Once the form is built, ant can be run and the application can be deployed to Elemental (or eXist-db). Forms were built and tested with eXist-db 6.3.0 and up.
55+
56+
## Building the manuForma EXPath Package
57+
58+
The manuForma application can be compiled into an EXPath Package for deployment to an Elemental (or eXist-db) server.
59+
60+
Build Requirements:
61+
* [Java JDK](https://bell-sw.com/pages/downloads/) version 8 (or newer)
62+
63+
To build the manuForma application:
64+
65+
### macOS / Linux / Unix Platforms
66+
Run the following from a Terminal/Shell:
67+
68+
```shell
69+
./mvnw clean package
70+
```
71+
72+
### Microsoft Windows Platforms
73+
Run the following from a Command Prompt:
74+
```cmd
75+
mvnw.cmd clean package
76+
```
77+
78+
You can then find the EXPath Package file in the `target/` folder, it will be named like `manuforma-X.Y.Z-SNAPSHOT.xar`. You can take this file and upload it into Elemental (or eXist-db) via its `autodeploy` folder or its Package Manager application.
79+
80+
## Docker Image
81+
The manuForma application can also be compiled into a Docker Image where its EXPath Package is already deployed to Elemental.
82+
83+
If you would like to build the Docker Image, you simply need to make sure you have Docker installed,
84+
and then include the build argument `-Pdocker`, for example:
85+
86+
### macOS / Linux / Unix Platforms
87+
Run the following from a Terminal/Shell:
88+
89+
```shell
90+
./mvnw -Pdocker clean package
91+
```
92+
93+
### Microsoft Windows Platforms
94+
Run the following from a Command Prompt:
95+
```cmd
96+
mvnw.cmd -Pdocker clean package
97+
```
98+
99+
### Running manuForma with Docker
100+
You should first create a Docker Volume to hold your Elemental database files. You need do this only once:
101+
```shell
102+
docker volume create manuforma-database
103+
```
104+
105+
Once you have built (or obtained) the Docker Image, you can run manuForma in Docker like so:
106+
107+
```shell
108+
docker run -it -p 8080:8080 --mount type=volume,src=manuforma-database,dst=/elemental/data majlis/manuforma:latest
109+
```
110+
111+
manuForma will then be available in your web-browser at `http://localhost:8080/exist/apps/manuForma/index.html`
112+
NOTE: The first time you use the Docker Image, you will need to deploy the [Majlis Data Package](https://github.com/majlis-erc/majlis-data/blob/main/build/majlis-data-0.01.xar).
113+

build.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

controller.xql

Lines changed: 0 additions & 141 deletions
This file was deleted.

expath-pkg.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)