Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Oct 6, 2020
2 parents 7095e4d + ca058a6 commit 290667b
Show file tree
Hide file tree
Showing 60 changed files with 1,906 additions and 1,697 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,24 @@ on:
pull_request:
branches: [ master, develop ]

workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
services:
eXist:
image: existdb/teipublisher:6.0.0
ports:
- 8080:8080

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Build docker image
run: docker build -t exist-db -f Dockerfile .
- name: Start docker image
run: docker run --publish 8080:8080 --detach exist-db
- name: npm install, build, and test
run: |
npm install -q
Expand Down
87 changes: 87 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
ARG PUBLISHER_LIB_VERSION=v2.8.9
ARG PUBLISHER_VERSION=feature/open-api
ARG SHAKESPEARE_VERSION=1.1.2
ARG VANGOGH_VERSION=1.0.6
ARG EXIST_VERSION=5.2.0

# START STAGE 1
FROM openjdk:8-jdk-slim as builder

USER root

ENV ANT_VERSION 1.10.9
ENV ANT_HOME /etc/ant-${ANT_VERSION}

WORKDIR /tmp

RUN apt-get update && apt-get install -y \
wget \
git \
curl

RUN wget http://www-us.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz \
&& mkdir ant-${ANT_VERSION} \
&& tar -zxvf apache-ant-${ANT_VERSION}-bin.tar.gz \
&& mv apache-ant-${ANT_VERSION} ${ANT_HOME} \
&& rm apache-ant-${ANT_VERSION}-bin.tar.gz \
&& rm -rf ant-${ANT_VERSION} \
&& rm -rf ${ANT_HOME}/manual \
&& unset ANT_VERSION

ENV PATH ${PATH}:${ANT_HOME}/bin

FROM builder as tei
# add key
RUN mkdir -p ~/.ssh && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts

# Build tei-publisher-lib
RUN git clone https://github.com/eeditiones/tei-publisher-lib.git \
&& cd tei-publisher-lib \
&& git checkout ${PUBLISHER_LIB_VERSION} \
&& ant

RUN git clone https://github.com/eeditiones/oas-router.git \
&& cd oas-router \
&& ant

# Build tei-publisher-app
RUN git clone https://github.com/eeditiones/tei-publisher-app.git \
&& cd tei-publisher-app \
&& git checkout feature/open-api

WORKDIR /tmp/tei-publisher-app

RUN ant

FROM existdb/existdb:${EXIST_VERSION}

COPY --from=tei /tmp/tei-publisher-lib/build/*.xar /exist/autodeploy
COPY --from=tei /tmp/oas-router/build/*.xar /exist/autodeploy
COPY --from=tei /tmp/tei-publisher-app/build/*.xar /exist/autodeploy

ENV DATA_DIR /exist-data

ENV JAVA_TOOL_OPTIONS \
-Dfile.encoding=UTF8 \
-Dsun.jnu.encoding=UTF-8 \
-Djava.awt.headless=true \
-Dorg.exist.db-connection.cacheSize=${CACHE_MEM:-256}M \
-Dorg.exist.db-connection.pool.max=${MAX_BROKER:-20} \
-Dlog4j.configurationFile=/exist/etc/log4j2.xml \
-Dexist.home=/exist \
-Dexist.configurationFile=/exist/etc/conf.xml \
-Djetty.home=/exist \
-Dexist.jetty.config=/exist/etc/jetty/standard.enabled-jetty-configs \
-XX:+UnlockExperimentalVMOptions \
-XX:+UseCGroupMemoryLimitForHeap \
-XX:+UseG1GC \
-XX:+UseStringDeduplication \
-XX:MaxRAMFraction=1 \
-XX:+ExitOnOutOfMemoryError \
-Dorg.exist.db-connection.files=${DATA_DIR} \
-Dorg.exist.db-connection.recovery.journal-dir=${DATA_DIR}

# pre-populate the database by launching it once
RUN [ "java", \
"org.exist.start.Main", "client", "-l", \
"--no-gui", "--xpath", "system:get-version()" ]
4 changes: 4 additions & 0 deletions demo/dts-client.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<script>
// configuration for the DTS endpoints
const dtsConfig = [
{
"url": "http://localhost:8080/exist/apps/tei-publisher/api/dts",
"title": "Local TEI Publisher"
},
{
"url": "http://teipublisher.com/exist/apps/vangogh/api/dts",
"title": "Van Gogh Letters"
Expand Down
6 changes: 1 addition & 5 deletions demo/pb-autocomplete.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@ <h2>Suggestion list passed in a property</h2>
<h2>Suggestion list supplied by remote XQuery</h2>
<!--pb-autocomplete name="autocomplete2" placeholder="query" source="modules/autocomplete.xql"></pb-autocomplete-->
<pb-autocomplete name="autocomplete2" placeholder="query" source="api/search/autocomplete"></pb-autocomplete>
<h2>Suggestion list supplied by remote XQuery with initial value set</h2>
<!--pb-autocomplete name="autocomplete2" placeholder="query" source="modules/autocomplete.xql"></pb-autocomplete-->
<pb-autocomplete name="autocomplete3" placeholder="query" value="baalams"
source="api/search/autocomplete"></pb-autocomplete>
<h2>Combine with other form fields whose value is passed on</h2>
<!--pb-autocomplete name="autocomplete3" placeholder="query" source="modules/autocomplete.xql"-->
<pb-autocomplete name="autocomplete4" placeholder="query" source="api/search/autocomplete">
<pb-autocomplete name="autocomplete3" placeholder="query" source="api/search/autocomplete">
<select name="field">
<option value="title">Title</option>
<option value="author">Author</option>
Expand Down
3 changes: 2 additions & 1 deletion demo/pb-autocomplete2.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ <h1>Using pb-autocomplete with remote suggestions</h1>
<p>pb-autocomplete used with a pb-repeat:</p>
<pb-repeat>
<template>
<pb-autocomplete placeholder="Title" name="title" source="modules/autocomplete.xql"></pb-autocomplete>
<!--pb-autocomplete placeholder="Title" name="title" source="modules/autocomplete.xql"></pb-autocomplete-->
<pb-autocomplete placeholder="Title" name="title" source="api/search/autocomplete"></pb-autocomplete>
</template>
</pb-repeat>
<p>If suggestions are an array of objects with properties "text" and "value", the "value" will be used
Expand Down
3 changes: 2 additions & 1 deletion demo/pb-browse-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@
<pb-restricted login="login" can-write>
<pb-upload id="upload" emit="docs" subscribe="docs" accept=".xml, .tei, .odd, .docx"></pb-upload>
</pb-restricted>
<pb-browse-docs id="document-list" url="collection/" fix-links
<!-- use just `collection/` for new API @url-->
<pb-browse-docs id="document-list" url="api/collection" fix-links
sort-options='[{"label": "browse.title", "value": "title"},{"label": "browse.author", "value": "author"},{"label": "browse.modificationDate", "value": "default"}]'
sort-by="title"
filter-options='[{"label": "browse.title", "value": "title"},{"label": "browse.author", "value": "author"},{"label": "browse.file", "value": "file"}]'
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-browse-docs2.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<pb-custom-form id="testForm" url="modules/testForm.xql" event="pb-results-received" subscribe="docs" emit="docs"/>
</section>
<main>
<pb-browse-docs id="document-list" url="collection/test" fix-links
<pb-browse-docs id="document-list" url="api/collection/test" fix-links
sort-options='[{"label": "browse.title", "value": "title"},{"label": "browse.author", "value": "author"},{"label": "browse.modificationDate", "value": "default"}]'
sort-by="title"
filter-options='[{"label": "browse.title", "value": "title"},{"label": "browse.author", "value": "author"},{"label": "browse.file", "value": "file"}]'
Expand Down
6 changes: 5 additions & 1 deletion demo/pb-code-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@
pb-code-editor { margin-bottom: 32px; }
</style>
<pb-page>
<!-- using old API endpoint for linter; old API is due for deprecation with Publisher 8
<pb-code-editor label="XQuery code, ambiance theme" code="for $i in (1, 2) return $i * 6" mode="xquery"
theme="ambiance"
linter="http://localhost:8080/exist/apps/tei-publisher/modules/editor.xql"></pb-code-editor> -->
<pb-code-editor label="XQuery code, ambiance theme" code="for $i in (1, 2) return $i * 6" mode="xquery"
theme="ambiance"
linter="http://localhost:8080/exist/apps/tei-publisher/modules/editor.xql"></pb-code-editor>
linter="http://localhost:8080/exist/apps/tei-publisher/api/lint"></pb-code-editor>
<pb-code-editor label="CSS, oceanic-next theme" code="color: blue;
font-decoration: underline;" mode="css" theme="oceanic-next"></pb-code-editor>
<pb-code-editor label="XML, material theme" code='&lt;elementSpec ident="correspDesc" mode="add"&gt;
Expand Down
30 changes: 23 additions & 7 deletions demo/pb-download.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<script type="module" src="../src/pb-download.js"></script>
<script type="module" src="../src/pb-ajax.js"></script>
<script type="module" src="../src/pb-progress.js"></script>
<script type="module" src="../src/pb-login.js"></script>
<script type="module" src="../src/pb-restricted.js"></script>
<!--/scripts-->
</head>

Expand All @@ -30,20 +32,34 @@

<pb-progress></pb-progress>
<main>
<pb-download type="pdf" src="document1" dialog="downloadDialog" title="Download PDF" full>
<pb-login id="loginElem"></pb-login>

<pb-download type="pdf" src="document1" dialog="downloadDialog" title="Download PDF">
<paper-button raised>Documentation: PDF</paper-button>
</pb-download>
<pb-download type="pdf" src="document1" title="Download PDF" full
<pb-download type="pdf" src="document1" title="Download PDF"
source download>
<paper-button raised>Documentation: FO source</paper-button>
</pb-download>
<pb-download type="pdf" url="test/graves6.xml" dialog="downloadDialog" title="Download PDF"
odd="graves.odd" full>
<!-- old api: -->
<!--pb-download type="pdf" url="test/graves6.xml" dialog="downloadDialog" title="Download PDF"
odd="graves.odd" -->
<pb-download type="pdf" url="api/document/test%2Fgraves6.xml/pdf" dialog="downloadDialog" title="Download PDF"
odd="graves.odd">
<paper-button raised>Letter: PDF</paper-button>
</pb-download>
<pb-ajax url="modules/lib/regenerate.xql?odd=graves.odd">
<paper-button raised>Recompile ODD</paper-button><span slot="title">Recompile ODD</span>
</pb-ajax>

<pb-restricted login="loginElem">
<!-- old api: -->
<!--pb-ajax url="modules/lib/regenerate.xql?odd=graves.odd"-->
<pb-ajax url="api/odd?odd=graves.odd" method="post">
<paper-button raised>Recompile ODD</paper-button><span slot="title">Recompile ODD</span>
</pb-ajax>
</pb-restricted>

<pb-download url="odd-editor.html" src="document1">
<paper-button raised>Edit ODD</paper-button>
</pb-download>
</main>
</pb-page>
<paper-dialog id="downloadDialog">
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-drawer.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<h3>
<pb-i18n key="document.contents">Contents</pb-i18n>
</h3>
<pb-load url="templates/toc.html?target=transcription&icons=true" src="document1" subscribe="toc" load-once>Loading...</pb-load>
<pb-load url="api/document/{doc}/contents?target=transcription&icons=true" src="document1" expand subscribe="toc" load-once>Loading...</pb-load>
</div>
</pb-drawer>
<main>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-load.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<pb-document id="document1" path="test/kant_rvernunft_1781.TEI-P5.xml" odd="dta"></pb-document>

<main>
<pb-load url="templates/toc.html?target=transcription&icons=true" src="document1" auto>Loading table of
<pb-load url="api/document/{doc}/contents?target=transcription&icons=true" expand src="document1" auto>Loading table of
contents...</pb-load>
<div class="transcription">
<pb-view src="document1" subscribe="transcription" view="page"></pb-view>
Expand Down
3 changes: 2 additions & 1 deletion demo/pb-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
</div>
</pb-search>
<pb-paginate per-page="10" range="5"></pb-paginate>
<pb-load url="templates/search-results.html"></pb-load>
<!--pb-load url="templates/search-results.html"></pb-load-->
<pb-load url="api/search"></pb-load>
</main>
</pb-page>
</template>
Expand Down
3 changes: 2 additions & 1 deletion demo/pb-search2.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
</pb-select>
</pb-search>
<pb-paginate per-page="10" range="5"></pb-paginate>
<pb-load url="templates/search-results.html"></pb-load>
<!--pb-load url="templates/search-results.html"></pb-load-->
<pb-load url="api/search"></pb-load>
</main>
</pb-page>
</template>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-select-feature3.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1>Using pb-select-feature with pb-load</h1>
]' subscribe="loader" emit="loader"></pb-select-feature>
</div>
<main>
<pb-load id="load" url="modules/lib/components.xql?debug=yes&xpath=//text[@type='source']&view=single"
<pb-load id="load" url="api/parts/{doc}/html?xpath=//text[@type='source']&view=single" expand
src="document1" auto subscribe="loader" emit="loader">Loading document ...</pb-load>
</main>
</pb-page>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-select3.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1>Using pb-select with a remote data source</h1>
<pb-page locales="../i18n/{{ns}}/{{lng}}.json" endpoint="http://localhost:8080/exist/apps/tei-publisher">
<iron-form id="form">
<form action="">
<pb-select label="Title" name="title" source="modules/autocomplete.xql?query=s">
<pb-select label="Title" name="title" source="api/search/autocomplete?query=s">
<pb-select label="Field" name="field" slot="subform" value="title">
<paper-item value="title">Title</paper-item>
<paper-item value="author">Author</paper-item>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-toggle-feature3.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h1>Using pb-toggle-feature with pb-load</h1>
</div>
<main>
<!-- call components.xql to retrieve the full source text -->
<pb-load url="modules/lib/components.xql?debug=yes&xpath=//text[@type='source']&view=single"
<pb-load url="api/parts/{doc}/html?xpath=//text[@type='source']&view=single" expand
src="document3" auto subscribe="loader" emit="loader">Loading document ...</pb-load>
</main>
</pb-page>
Expand Down
2 changes: 1 addition & 1 deletion demo/pb-view2.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<pb-progress></pb-progress>
<main>
<aside class="toc">
<pb-load url="templates/toc.html?target=transcription&amp;collapse=true" src="document1" auto="auto"><pb-i18n key="dialogs.loading">Loading</pb-i18n></pb-load>
<pb-load url="api/document/{doc}/contents?target=transcription&icons=false" expand src="document1" auto="auto"><pb-i18n key="dialogs.loading">Loading</pb-i18n></pb-load>
</aside>
<pb-view class="breadcrumbs" src="document1" load-css="odd/docbook.css">
<pb-param name="mode" value="breadcrumbs"/>
Expand Down
1 change: 1 addition & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = config => {
// if you are using 'bare module imports' you will need this option
nodeResolve: true
},
concurrency: 1,
client: {
endpoint: config.endpoint ? config.endpoint : 'http://localhost:8080/exist/apps/tei-publisher/',
passwd: config.passwd ? config.passwd : 'simple',
Expand Down
Loading

0 comments on commit 290667b

Please sign in to comment.