Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Parameterise export aggregate generation.
Browse files Browse the repository at this point in the history
Take local file locations of production aggregate and generated export
aggregate from properties.
Add a target to fetch a local copy of the production aggregate.
Add a target to generate the export aggregate.
  • Loading branch information
iay committed Jul 15, 2014
1 parent da2f715 commit 3bd9f57
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 11 deletions.
59 changes: 59 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1417,4 +1417,63 @@
</echoproperties>
</target>

<!--
*********************************************
*** ***
*** I N C O M M O N S P E C I F I C ***
*** ***
*********************************************
-->

<!--
Location of most InCommon-specific files.
-->
<property name="mda.incdir" location="mdx/incommon"/>

<!--
Default local file location from which to read the
(not necessarily signed) production aggregate.
This can be overridden in build.properties.
In a development environment, use the inc.fetch.production
target to read a copy of the current real production
aggregate into this location for testing.
-->
<property name="mda.inc.production.xml" value="${mda.incdir}/production.xml"/>

<!--
Default local file location to which to write the export aggregate.
This can be overridden in build.properties.
-->
<property name="mda.inc.exported.xml" value="${mda.incdir}/exported.xml"/>

<!--
inc.fetch.production
This target is for use in a development environment. It reads the
current signed InCommon production aggregate into the local file location
specified by mda.inc.production.xml so that it can be used to test the
inc.generate.export target.
-->
<target name="inc.fetch.production">
<echo>Fetching InCommon production aggregate to ${mda.inc.production.xml}...</echo>
<get src="http://md.incommon.org/InCommon/InCommon-metadata.xml"
dest="${mda.inc.production.xml}"/>
<echo>Fetch complete.</echo>
</target>

<!--
inc.generate.export
Generate the InCommon export aggregate.
-->
<target name="inc.generate.export">
<echo>Generating InCommon export aggregate in ${mda.inc.exported.xml}</echo>
<echo> from production aggregate in ${mda.inc.production.xml}...</echo>
<CHANNEL.do channel="incommon" verb="export"/>
<echo>Generation complete.</echo>
</target>

</project>
1 change: 1 addition & 0 deletions mdx/incommon/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
exported.xml
imported.xml
production.xml
23 changes: 12 additions & 11 deletions mdx/incommon/export.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
p:id="serializeExported">
<property name="outputFile">
<bean class="java.io.File">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/incommon/exported.xml"/>
<constructor-arg value="${inc.exported.xml}"/>
</bean>
</property>
</bean>
Expand All @@ -39,17 +39,18 @@
p:id="export">
<property name="stages">
<list>
<!-- Start with the InCommon production aggregate. -->
<ref bean="us_incommon_productionAggregate"/>

<!--
Check for fatal errors at the aggregate level:
missing or expired validUntil attribute
invalid signature
Start with the InCommon production aggregate.
In a production environment, this will be the *unsigned* aggregate,
so we perform minimal checking on its contents.
-->
<ref bean="check_validUntil"/>
<ref bean="us_incommon_checkSignature"/>
<ref bean="errorTerminatingFilter"/>
<bean id="production_aggregate" parent="DOMResourceSourceStage"
p:id="production_aggregate">
<property name="DOMResource">
<bean parent="ClassPathResource" c:_0="incommon/production.xml"/>
</property>
</bean>

<!-- Break down into individual entities. -->
<ref bean="disassemble"/>
Expand Down Expand Up @@ -92,7 +93,7 @@
p:id="normalise">
<property name="XSLResource">
<bean parent="FileSystemResource">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/incommon/ns_norm_export.xsl"/>
<constructor-arg value="${incdir}/ns_norm_export.xsl"/>
</bean>
</property>
</bean>
Expand Down

0 comments on commit 3bd9f57

Please sign in to comment.