Skip to content

Commit 7088b59

Browse files
committed
add catalog file
for locally resolving configure_9_3.dtd
1 parent 2b7adf3 commit 7088b59

File tree

5 files changed

+267
-8
lines changed

5 files changed

+267
-8
lines changed

Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,21 @@ WORKDIR ${EXIST_HOME}
3030
# adding expath packages to the autodeploy directory
3131
ADD http://exist-db.org/exist/apps/public-repo/public/functx-1.0.1.xar ${EXIST_HOME}/autodeploy/
3232

33-
# adding the entrypoint script
34-
COPY entrypoint.sh ${EXIST_HOME}/
33+
# adding the entrypoint script and XML catalog
34+
COPY entrypoint.sh catalog.xml ${EXIST_HOME}/
35+
COPY configure_9_3.dtd /etc/
3536

3637
# adding some scripts/configuration files for fine tuning
37-
COPY adjust-conf-files.xsl ${EXIST_HOME}/
38-
COPY log4j2.xml ${EXIST_HOME}/
38+
COPY adjust-conf-files.xsl log4j2.xml ${EXIST_HOME}/
39+
40+
# can't use the packaged version from libxml-commons-resolver1.1-java
41+
# for this is compiled with JAVA11 and eXist still runs on JAVA8
42+
COPY xml-resolver-1.2.jar ${EXIST_HOME}/lib/
3943

4044
# main installation put into one RUN to squeeze image size
41-
RUN apt update \
42-
&& apt dist-upgrade -y \
43-
&& apt install -y curl pwgen zip \
45+
RUN apt-get update \
46+
&& apt-get dist-upgrade -y \
47+
&& apt-get install -y --no-install-recommends curl pwgen zip \
4448
&& echo "INSTALL_PATH=${EXIST_HOME}" > "/tmp/options.txt" \
4549
&& echo "MAX_MEMORY=${MAX_MEMORY}" >> "/tmp/options.txt" \
4650
&& echo "dataDir=${EXIST_DATA_DIR}" >> "/tmp/options.txt" \

catalog.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0"?>
2+
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
3+
<system systemId="http://www.eclipse.org/jetty/configure_9_3.dtd" uri="file:///etc/configure_9_3.dtd"/>
4+
<system systemId="https://www.eclipse.org/jetty/configure_9_3.dtd" uri="file:///etc/configure_9_3.dtd"/>
5+
</catalog>

configure_9_3.dtd

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
This is the document type descriptor for the
4+
org.eclipse.jetty.xml.XmlConfiguration class. It allows a java object to be
5+
configured by with a sequence of Set, Put and Call elements. These tags are
6+
mapped to methods on the object to be configured as follows:
7+
<Set name="Test">value</Set> == obj.setTest("value");
8+
<Put name="Test">value</Put> == obj.put("Test","value");
9+
<Call name="test"><Arg>value</Arg></Call> == obj.test("value");
10+
Values themselves may be configured objects that are created with the
11+
<New> tag or returned from a <Call> tag.
12+
Values are matched to arguments on a best effort approach, but types
13+
my be specified if a match is not achieved.
14+
-->
15+
<!ENTITY % CONFIG "Set|Get|Put|Call|New|Ref|Array|Map|Property">
16+
<!ENTITY % VALUE "#PCDATA|Get|Call|New|Ref|Array|Map|SystemProperty|Env|Property">
17+
<!ENTITY % TYPEATTR "type CDATA #IMPLIED " > <!-- String|Character|Short|Byte|Integer|Long|Boolean|Float|Double|char|short|byte|int|long|boolean|float|double|URL|InetAddress|InetAddrPort| #classname -->
18+
<!ENTITY % IMPLIEDCLASSATTR "class CDATA #IMPLIED" >
19+
<!ENTITY % CLASSATTR "class CDATA #REQUIRED" >
20+
<!ENTITY % NAMEATTR "name CDATA #REQUIRED" >
21+
<!ENTITY % IMPLIEDNAMEATTR "name CDATA #IMPLIED" >
22+
<!ENTITY % DEPRECATEDATTR "deprecated CDATA #IMPLIED" >
23+
<!ENTITY % DEFAULTATTR "default CDATA #IMPLIED" >
24+
<!ENTITY % IDATTR "id ID #IMPLIED" >
25+
<!ENTITY % ARGATTR "arg CDATA #IMPLIED" >
26+
<!ENTITY % ITEMATTR "item CDATA #IMPLIED" >
27+
<!ENTITY % REFATTR "refid CDATA #IMPLIED" >
28+
<!ENTITY % REQUIREDIDATTR "id ID #REQUIRED" >
29+
<!--
30+
Configure Element.
31+
This is the root element that specifies the class of object that
32+
can be configured:
33+
<Configure class="com.acme.MyClass"> ... </Configure>
34+
-->
35+
<!ELEMENT Configure (Arg*,(%CONFIG;)*) >
36+
<!ATTLIST Configure %IMPLIEDCLASSATTR; %IDATTR; >
37+
<!--
38+
Set Element.
39+
This element maps to a call to a setter method or field on the current object.
40+
The name and optional type attributes are used to select the setter
41+
method. If the name given is xxx, then a setXxx method is used, or
42+
the xxx field is used of setXxx cannot be found.
43+
A Set element can contain value text and/or the value objects returned
44+
by other elements such as Call, New, SystemProperty, etc.
45+
If no value type is specified, then white
46+
space is trimmed out of the value. If it contains multiple value
47+
elements they are added as strings before being converted to any
48+
specified type.
49+
A Set with a class attribute is treated as a static set method invocation.
50+
-->
51+
<!ELEMENT Set (%VALUE;)* >
52+
<!ATTLIST Set %NAMEATTR; %TYPEATTR; %IMPLIEDCLASSATTR; >
53+
<!--
54+
Get Element.
55+
This element maps to a call to a getter method or field on the current object.
56+
The name attribute is used to select the get method.
57+
If the name given is xxx, then a getXxx method is used, or
58+
the xxx field is used if getXxx cannot be found.
59+
A Get element can contain other elements such as Set, Put, Call, etc.
60+
which act on the object returned by the get call.
61+
A Get with a class attribute is treated as a static get method or field.
62+
-->
63+
<!ELEMENT Get (%CONFIG;)* >
64+
<!ATTLIST Get %NAMEATTR; %IMPLIEDCLASSATTR; %IDATTR; >
65+
<!--
66+
Put Element.
67+
This element maps to a call to a put method on the current object,
68+
which must implement the Map interface. The name attribute is used
69+
as the put key and the optional type attribute can force the type
70+
of the value.
71+
A Put element can contain value text and/or value elements such as Call,
72+
New, SystemProperty, etc. If no value type is specified, then white
73+
space is trimmed out of the value. If it contains multiple value
74+
elements they are added as strings before being converted to any
75+
specified type.
76+
-->
77+
<!ELEMENT Put (%VALUE;)* >
78+
<!ATTLIST Put %NAMEATTR; %TYPEATTR; >
79+
<!--
80+
Id Element.
81+
This element is the equivalent of the id attribute.
82+
-->
83+
<!ELEMENT Id (%VALUE;)* >
84+
<!--
85+
Name element.
86+
This element is the equivalent of the name attribute.
87+
-->
88+
<!ELEMENT Name (%VALUE;)* >
89+
<!--
90+
Deprecated element.
91+
This element is the equivalent of the deprecated attribute.
92+
-->
93+
<!ELEMENT Deprecated (%VALUE;)* >
94+
<!--
95+
Default element.
96+
This element is the equivalent of the default attribute.
97+
-->
98+
<!ELEMENT Default (%VALUE;)* >
99+
<!--
100+
Class element.
101+
This element is the equivalent of the class attribute.
102+
-->
103+
<!ELEMENT Class (%VALUE;)* >
104+
<!--
105+
Type element.
106+
This element is the equivalent of the type attribute.
107+
-->
108+
<!ELEMENT Type (%VALUE;)* >
109+
<!--
110+
Call Element.
111+
This element maps to an arbitrary call to a method on the current object,
112+
The name attribute and Arg elements are used to select the method.
113+
A Call element can contain a sequence of Arg elements followed by
114+
a sequence of other elements such as Set, Put, Call, etc. which act on any object
115+
returned by the original call:
116+
<Call id="o2" name="test">
117+
<Arg>value1</Arg>
118+
<Set name="Test">Value2</Set>
119+
</Call>
120+
This is equivalent to:
121+
Object o2 = o1.test("value1");
122+
o2.setTest("value2");
123+
A Call with a class attribute is treated as a static call.
124+
-->
125+
<!ELEMENT Call (Id?,Name?,Class?,Arg*,(%CONFIG;)*) >
126+
<!ATTLIST Call %ARGATTR; %IMPLIEDNAMEATTR; %IMPLIEDCLASSATTR; %IDATTR; >
127+
<!--
128+
Arg Element.
129+
This element defines a positional or optional named argument for the
130+
Call and New elements. The optional type attribute can force the type
131+
of the value.
132+
An Arg element can contain value text and/or value elements such as Call,
133+
New, SystemProperty, etc. If no value type is specified, then white
134+
space is trimmed out of the value. If it contains multiple value
135+
elements they are added as strings before being converted to any
136+
specified type.
137+
-->
138+
<!ELEMENT Arg (%VALUE;)* >
139+
<!ATTLIST Arg %TYPEATTR; %IMPLIEDNAMEATTR; >
140+
<!--
141+
New Element.
142+
This element allows the creation of a new object as part of a
143+
value for elements such as Set, Put, Arg, etc. The class attribute
144+
determines the type of the new object and the contained Arg elements
145+
are used to select the constructor for the new object.
146+
A New element can contain a sequence of Arg elements followed by
147+
a sequence of elements such as Set, Put, Call, etc. elements
148+
which act on the new object:
149+
<New id="o" class="com.acme.MyClass">
150+
<Arg>value1</Arg>
151+
<Set name="test">Value2</Set>
152+
</New>
153+
This is equivalent to:
154+
Object o = new com.acme.MyClass("value1");
155+
o.setTest("Value2");
156+
-->
157+
<!ELEMENT New (Id?,Name?,Class?,Arg*,(%CONFIG;)*) >
158+
<!ATTLIST New %IDATTR; %IMPLIEDCLASSATTR; %ARGATTR; >
159+
<!--
160+
Ref Element.
161+
This element allows a previously created object to be referenced by id. The
162+
attribute refid is used to specify the id of another object (the attribute id can
163+
also be used, but it's use is deprecated).
164+
A Ref element can contain a sequence of elements such as Set, Put, Call, etc.
165+
which act on the referenced object.
166+
<Ref refid="myobject">
167+
<Set name="Test">Value2</Set>
168+
</New>
169+
-->
170+
<!ELEMENT Ref (%CONFIG;)* >
171+
<!ATTLIST Ref %IDATTR; %REFATTR;>
172+
<!--
173+
Array Element.
174+
This element allows the creation of a new array as part of a
175+
value of elements such as Set, Put, Arg, etc. The type attribute determines
176+
the type of the new array and the contained Item elements
177+
are used for each element of the array:
178+
<Array type="java.lang.String">
179+
<Item>value0</Item>
180+
<Item><New class="java.lang.String"><Arg>value1</Arg></New></Item>
181+
</Array>
182+
This is equivalent to:
183+
String[] a = new String[] { "value0", new String("value1") };
184+
-->
185+
<!ELEMENT Array (Id?,Type?,Item*) >
186+
<!ATTLIST Array %IDATTR;%TYPEATTR;%ITEMATTR; >
187+
<!--
188+
Map Element.
189+
This element allows the creation of a new map as part of a
190+
value of elements such as Set, Put, Arg, etc. The type attribute determines
191+
the type of the new array and the contained Item elements
192+
are used for each element of the array:
193+
<Map>
194+
<Entry>
195+
<Item>keyName</Item>
196+
<Item><New class="java.lang.String"><Arg>value1</Arg></New></Item>
197+
</Entry>
198+
</Map>
199+
This is equivalent to:
200+
Map m = new HashMap();
201+
m.put("keyName", new String("value1"));
202+
-->
203+
<!ELEMENT Map (Id?,Entry*) >
204+
<!ATTLIST Map %IDATTR; >
205+
<!ELEMENT Entry (Item,Item) >
206+
<!--
207+
Item Element.
208+
This element defines an entry for the Array or Map Entry elements.
209+
The optional type attribute can force the type of the value.
210+
An Item element can contain value text and/or the value object of
211+
elements such as Call, New, SystemProperty, etc. If no value type
212+
is specified, then white space is trimmed out of the value.
213+
If it contains multiple value elements they are added as strings
214+
before being converted to any specified type.
215+
-->
216+
<!ELEMENT Item (%VALUE;)* >
217+
<!ATTLIST Item %TYPEATTR; %IDATTR; >
218+
<!--
219+
System Property Element.
220+
This element allows JVM System properties to be retrieved as
221+
part of the value of elements such as Set, Put, Arg, etc.
222+
The name attribute specifies the property name and the optional
223+
default argument provides a default value.
224+
<SystemProperty name="Test" default="value" />
225+
This is equivalent to:
226+
System.getProperty("Test","value");
227+
-->
228+
<!ELEMENT SystemProperty (Id?,Name?,Deprecated*,Default?) >
229+
<!ATTLIST SystemProperty %IMPLIEDNAMEATTR; %DEFAULTATTR; %DEPRECATEDATTR; %IDATTR; >
230+
<!--
231+
Environment variable Element.
232+
This element allows OS Environment variables to be retrieved as
233+
part of the value of elements such as Set, Put, Arg, etc.
234+
The name attribute specifies the env variable name and the optional
235+
default argument provides a default value.
236+
<Env name="Test" default="value" />
237+
This is equivalent to:
238+
String v=System.getEnv("Test");
239+
if (v==null) v="value";
240+
-->
241+
<!ELEMENT Env (Id?,Name?,Deprecated*,Default?) >
242+
<!ATTLIST Env %IMPLIEDNAMEATTR; %DEFAULTATTR; %DEPRECATEDATTR; %IDATTR; >
243+
<!--
244+
Property Element.
245+
This element allows arbitrary properties to be retrieved by name.
246+
The name attribute specifies the property name and the optional
247+
default argument provides a default value.
248+
-->
249+
<!ELEMENT Property (Id?,Name?,Deprecated*,Default?) >
250+
<!ATTLIST Property %IMPLIEDNAMEATTR; %DEFAULTATTR; %DEPRECATEDATTR; %IDATTR; >

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
SAXON="java ${JAVA_OPTIONS} -jar ${SAXON_JAR} env=${EXIST_ENV} context_path=${EXIST_CONTEXT_PATH} default_app_path=${EXIST_DEFAULT_APP_PATH} -xsl:${EXIST_HOME}/adjust-conf-files.xsl"
3+
SAXON="java ${JAVA_OPTIONS} -cp ${SAXON_JAR}:${EXIST_HOME}/lib/xml-resolver-1.2.jar net.sf.saxon.Transform env=${EXIST_ENV} context_path=${EXIST_CONTEXT_PATH} default_app_path=${EXIST_DEFAULT_APP_PATH} -xsl:${EXIST_HOME}/adjust-conf-files.xsl -catalog:${EXIST_HOME}/catalog.xml"
44

55
##############################################
66
# function for adjusting configuration files for eXist versions >= 5

xml-resolver-1.2.jar

82.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)