Skip to content

Commit

Permalink
mavenized the project
Browse files Browse the repository at this point in the history
  • Loading branch information
Asger Askov Blekinge committed May 14, 2012
1 parent ec94b60 commit e47c60b
Show file tree
Hide file tree
Showing 14 changed files with 121 additions and 27 deletions.
62 changes: 62 additions & 0 deletions pom.xml
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>dk.statsbiblioteket.sbprojects</groupId>
<artifactId>sbprojects-parent</artifactId>
<version>3</version>
</parent>

<groupId>dk.statsbiblioteket.mediespring</groupId>
<artifactId>SB-yousee-profile-validation</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<scm>
<connection>scm:git:git://github.com/statsbiblioteket/SB-yousee-workflow.git</connection>
<url>scm:git:git://github.com/statsbiblioteket:SB-yousee-workflow.git</url>
<developerConnection>scm:git:git://github.com/statsbiblioteket/SB-yousee-workflow.git</developerConnection>
</scm>

<repositories>
<repository>
<id>sbprojects-nexus</id>
<url>https://sbprojects.statsbiblioteket.dk/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>


<build>
<plugins>

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
<attach>true</attach>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>

27 changes: 0 additions & 27 deletions profileValidator/validateXmlWithProfile.sh

This file was deleted.

21 changes: 21 additions & 0 deletions src/main/assembly/assembly.xml
@@ -0,0 +1,21 @@
<assembly>

<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>


<fileSet>
<outputDirectory></outputDirectory>
<directory>src/main/profileValidator</directory>
</fileSet>

</fileSets>



</assembly>


File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions src/main/profileValidator/validateXmlWithProfile.sh
@@ -0,0 +1,38 @@
#!/bin/bash

XML=$1
PROFILE=$2

pushd . > /dev/null
SCRIPT_PATH="${BASH_SOURCE[0]}";
if ([ -h "${SCRIPT_PATH}" ]) then
while([ -h "${SCRIPT_PATH}" ]) do cd `dirname "$SCRIPT_PATH"`; SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
fi
cd `dirname ${SCRIPT_PATH}` > /dev/null
SCRIPT_PATH=`pwd`;
popd > /dev/null



TEMPDIR=`mktemp -d`

#transform the profile to xslt
xsltproc -o $TEMPDIR/step1.xsl $SCRIPT_PATH/schematron/iso_dsdl_include.xsl $PROFILE
xsltproc -o $TEMPDIR/step2.xsl $SCRIPT_PATH/schematron/iso_abstract_expand.xsl $TEMPDIR/step1.xsl
xsltproc -o $TEMPDIR/step3.xsl $SCRIPT_PATH/schematron/iso_schematron_message.xsl $TEMPDIR/step2.xsl

#evaluate the profile
xsltproc $TEMPDIR/step3.xsl $XML 2> $TEMPDIR/result.xml


if [ -s $TEMPDIR/result.xml ]; then
cat $TEMPDIR/result.xml
rm -r $TEMPDIR
else
echo "{"
echo "\"valid\" : true"
echo "}"
rm -r $TEMPDIR
fi


0 comments on commit e47c60b

Please sign in to comment.