Skip to content

Commit

Permalink
SERVLET_NAME env param
Browse files Browse the repository at this point in the history
Admin dataset fixes
web.xsl stylesheet that makes changes to web.xml
`FROM --platform=$BUILDPLATFORM`
  • Loading branch information
namedgraph committed Sep 28, 2023
1 parent d4cbb35 commit 56a6755
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 4 deletions.
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM maven:3.8.4-openjdk-17 as maven
FROM --platform=$BUILDPLATFORM maven:3.8.4-openjdk-17 as maven

# download and extract Jena

Expand Down Expand Up @@ -42,6 +42,10 @@ WORKDIR $CATALINA_HOME

COPY platform/context.xsl conf/context.xsl

# add XSLT stylesheet that makes changes to web.xml

COPY platform/web.xsl /usr/local/tomcat/webapps/ROOT/WEB-INF/web.xsl

ENV CACHE_MODEL_LOADS=true

ENV STYLESHEET=static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/layout.xsl
Expand Down Expand Up @@ -108,6 +112,8 @@ ENV GOOGLE_CLIENT_ID=

ENV GOOGLE_CLIENT_SECRET=

ENV SERVLET_NAME=

ENV GENERATE_SITEMAP=true

# remove default Tomcat webapps and install xmlstarlet (used for XPath queries) and envsubst (for variable substitution)
Expand Down
3 changes: 1 addition & 2 deletions platform/datasets/admin.trig
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ WHERE

}


<apps/>
{

Expand Down Expand Up @@ -354,7 +353,7 @@ WHERE
<acl/authorizations/> a dh:Container ;
sioc:has_parent <acl/> ;
dct:title "Authorizations" ;
dct:description "Manage who has access to which resources" ;
dct:description "Manage requests for access" ;
rdf:_1 <acl/authorizations/#select-children> .

<acl/authorizations/#select-children> a ldh:Content ;
Expand Down
1 change: 0 additions & 1 deletion platform/datasets/end-user.trig
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ WHERE

}


<apps/>
{

Expand Down
12 changes: 12 additions & 0 deletions platform/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,18 @@ transform="xsltproc \

eval "$transform"

# change webapp (servlet) configuration

if [ -n "$SERVLET_NAME" ]; then
SERVLET_NAME_PARAM="--stringparam jee:servlet-name '$SERVLET_NAME' "
fi

transform="xsltproc \
--output /usr/local/tomcat/webapps/ROOT/WEB-INF/web.xml \
$SERVLET_NAME_PARAM \
/usr/local/tomcat/webapps/ROOT/WEB-INF/web.xsl \
/usr/local/tomcat/webapps/ROOT/WEB-INF/web.xml"

# print Java's memory settings

java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
Expand Down
28 changes: 28 additions & 0 deletions platform/web.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:jee="https://jakarta.ee/xml/ns/jakartaee"
>

<xsl:output method="xml" indent="yes"/>

<xsl:param name="jee:servlet-name"/>

<xsl:template match="jee:servlet-name/text()">
<xsl:choose>
<xsl:when test="$jee:servlet-name">
<xsl:value-of select="$jee:servlet-name"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 56a6755

Please sign in to comment.