Skip to content

Commit

Permalink
Format & indent
Browse files Browse the repository at this point in the history
  • Loading branch information
joewiz committed Mar 16, 2024
1 parent 01306ff commit 473e61d
Show file tree
Hide file tree
Showing 64 changed files with 7,112 additions and 5,503 deletions.
41 changes: 22 additions & 19 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="travels" basedir=".">
<xmlproperty file="build.properties.xml" semanticAttributes="true" keepRoot="false"/>
<project basedir="." default="xar" name="travels">
<xmlproperty file="build.properties.xml" keepRoot="false" semanticAttributes="true"/>
<property name="build.dir" value="build"/>
<property name="git.repo.path" value="${basedir}/.git"/>
<available file="${git.repo.path}" type="dir" property="git.present"/>
<available file="${git.repo.path}" property="git.present" type="dir"/>

<target name="clean">
<echo message="Deleting xar files..."/>
<delete dir="${build.dir}" failonerror="false"/>
<delete file="${basedir}/expath-pkg.xml" failonerror="false"/>
<delete file="${basedir}/repo.xml" failonerror="false"/>
<delete failonerror="false" file="${basedir}/expath-pkg.xml"/>
<delete failonerror="false" file="${basedir}/repo.xml"/>
</target>
<target name="xar" depends="clean,git.revision" description="create xar file">

<target depends="clean,git.revision" description="create xar file" name="xar">
<echo message="Creating build folder..."/>
<mkdir dir="${build.dir}"/>

<echo message="Apply values to expath-pkg.xml..."/>
<copy todir="${basedir}" overwrite="true" verbose="true">
<copy overwrite="true" todir="${basedir}" verbose="true">
<fileset file="*.xml.tmpl"/>
<filterchain>
<replacetokens>
Expand All @@ -39,34 +39,37 @@
<echo message="------------------------------------------------------------"/>
<echo message="Creating xar file..."/>
<echo message="------------------------------------------------------------"/>

<zip basedir="${basedir}" destfile="${build.dir}/${app.name}-${app.version}.xar">
<exclude name="${build.dir}/**"/>
<exclude name="*.tmpl"/>
</zip>
</zip>
</target>

<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<target description="Store git revision in ${repository.version}" if="git.present"
name="git.revision">
<exec errorproperty="" executable="git" failifexecutionfails="false"
outputproperty="git.revision">
<arg value="--git-dir=${git.repo.path}"/>
<arg value="rev-parse"/>
<arg value="rev-parse"/>
<arg value="HEAD"/>
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<condition else="unknown" property="repository.version" value="${git.revision}">
<and>
<isset property="git.revision"/>
<length string="${git.revision}" trim="yes" length="0" when="greater"/>
<length length="0" string="${git.revision}" trim="yes" when="greater"/>
</and>
</condition>
<echo>Git repo: ${repository.version}</echo>

<exec executable="git" outputproperty="git.time" failifexecutionfails="false" errorproperty="">

<exec errorproperty="" executable="git" failifexecutionfails="false"
outputproperty="git.time">
<arg value="--git-dir=${git.repo.path}"/>
<arg value="show"/>
<arg value="-s"/>
<arg value="--format=%ct"/>
<arg value="${git.revision}"/>
</exec>
<echo>Git time: ${git.time}</echo>
</target>
</project>
</target>
</project>
2 changes: 1 addition & 1 deletion code-tables/travel-role-codes.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<code-table>
<name>travel-role-code</name>
<description>This is a description of codes used in the role element of a trip in the Travels
Expand Down
3 changes: 2 additions & 1 deletion expath-pkg.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="http://history.state.gov/ns/data/travels" abbrev="travels" version="0.4" spec="1.0">
<package abbrev="travels" name="http://history.state.gov/ns/data/travels" spec="1.0" version="0.4"
xmlns="http://expath.org/ns/pkg">
<title>Travels (data)</title>
</package>
3 changes: 2 additions & 1 deletion expath-pkg.xml.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="@url@" abbrev="@name@" version="@version@" spec="1.0">
<package abbrev="@name@" name="@url@" spec="1.0" version="@version@"
xmlns="http://expath.org/ns/pkg">
<title>@title@</title>
</package>
21 changes: 11 additions & 10 deletions pre-install.xql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
xquery version "1.0";

import module namespace xdb="http://exist-db.org/xquery/xmldb";
import module namespace xdb = "http://exist-db.org/xquery/xmldb";

(: The following external variables are set by the repo:deploy function :)

Expand All @@ -14,10 +14,11 @@ declare variable $target external;
declare function local:mkcol-recursive($collection, $components) {
if (exists($components)) then
let $newColl := concat($collection, "/", $components[1])
return (
return
(
xdb:create-collection($collection, $components[1]),
local:mkcol-recursive($newColl, subsequence($components, 2))
)
)
else
()
};
Expand All @@ -33,12 +34,12 @@ local:mkcol("/db/system/config", $target),
(: store the collection configurations :)
for $xconf in file:directory-list($dir, "*.xconf")/file:file/@name
let $data-dir := substring-before($xconf, ".xconf")
return
return
(
local:mkcol-recursive(concat("/db/system/config/", $target), $data-dir),
xmldb:store-files-from-pattern(
concat("/db/system/config", $target, "/", $data-dir),
$dir,
$xconf
)
local:mkcol-recursive(concat("/db/system/config/", $target), $data-dir),
xmldb:store-files-from-pattern(
concat("/db/system/config", $target, "/", $data-dir),
$dir,
$xconf
)
)
18 changes: 11 additions & 7 deletions president-travels.xconf
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:frus="http://history.state.gov/frus/ns/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<index xmlns:frus="http://history.state.gov/frus/ns/1.0" xmlns:tei="http://www.tei-c.org/ns/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<lucene>
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer">
<!-- Specify stop words - or remove them entirely -->
<param name="stopwords" type="org.apache.lucene.analysis.util.CharArraySet">
<!--<value>the</value>-->
</param>
</analyzer>
<text qname="trips" index="no">
<text index="no" qname="trips">
<!-- start required facets and fields -->
<facet dimension="hsg-category" expression="'department'"/>
<facet dimension="hsg-publication" expression="'travels'"/>
<field name="hsg-fulltext" store="no" expression="trip/name, trip/country, trip/remarks, trip/locale"/>
<field name="hsg-url" expression="'/departmenthistory/travels/president/' || util:document-name(.) =&gt; substring-before('.xml')"/>
<field expression="trip/name, trip/country, trip/remarks, trip/locale"
name="hsg-fulltext" store="no"/>
<field
expression="'/departmenthistory/travels/president/' || util:document-name(.) =&gt; substring-before('.xml')"
name="hsg-url"/>
<!-- end required facets and fields -->
</text>
</lucene>
<range>
<create match="//trip">
<field name="trip-who" match="@who" type="xs:string"/>
<field match="@who" name="trip-who" type="xs:string"/>
</create>
<create qname="country" type="xs:string"/>

</range>
</index>
</collection>
</collection>
Loading

0 comments on commit 473e61d

Please sign in to comment.