Skip to content

Commit

Permalink
Simplify most uses of ClassPathResource.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Jan 9, 2016
1 parent 6bd7cde commit 20c9b53
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 81 deletions.
18 changes: 4 additions & 14 deletions mdx/common-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1032,13 +1032,8 @@
A pipeline stage that removes all XML comments from items.
-->

<bean id="stripComments" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="strip-comments.xsl"/>
</bean>
</property>
</bean>
<bean id="stripComments" parent="XSLTransformationStage"
p:XSLResource="classpath:strip-comments.xsl"/>

<!--
everythingSelector
Expand Down Expand Up @@ -1075,13 +1070,8 @@
presented, for example by removing redundant attributes or elements which only have
meaning when added by the UK federation registrar.
-->
<bean id="cleanImport" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="clean-import.xsl"/>
</bean>
</property>
</bean>
<bean id="cleanImport" parent="XSLTransformationStage"
p:XSLResource="classpath:clean-import.xsl"/>

<!--
trimImportElementWhitespace
Expand Down
43 changes: 10 additions & 33 deletions mdx/uk/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,8 @@
This transform can be run on individual EntityDescriptors or on an
aggregate EntitiesDescriptor.
-->
<bean id="uk_processScopes" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/scopes.xsl"/>
</bean>
</property>
<bean id="uk_processScopes" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/scopes.xsl">
<property name="transformParameters">
<map>
<entry key="members" value-ref="uk_members"/>
Expand Down Expand Up @@ -197,13 +193,8 @@
Adds "mailto:" to md:EmailAddress elements which don't already have it.
-->
<bean id="uk_fix_mailto" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/fix_mailto.xsl"/>
</bean>
</property>
</bean>
<bean id="uk_fix_mailto" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/fix_mailto.xsl"/>


<!--
Expand Down Expand Up @@ -278,13 +269,8 @@
This stage performs any standard cleanup required for UK federation fragment files.
-->
<bean id="uk_processFragment" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/fragment.xsl"/>
</bean>
</property>
</bean>
<bean id="uk_processFragment" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/fragment.xsl"/>


<!--
Expand Down Expand Up @@ -428,13 +414,8 @@
Strip those UK federation extensions which we never publish.
-->
<bean id="uk_stripExtensions" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/strip_extensions.xsl"/>
</bean>
</property>
</bean>
<bean id="uk_stripExtensions" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/strip_extensions.xsl"/>


<!--
Expand Down Expand Up @@ -523,12 +504,8 @@
Input is an aggregate of all registered entities, output is the HTML statistics.
-->
<bean id="uk_generateStatistics" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/statistics.xsl"/>
</bean>
</property>
<bean id="uk_generateStatistics" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/statistics.xsl">
<property name="transformParameters">
<map>
<entry key="memberDocument" value-ref="uk_membersDocument"/>
Expand Down
26 changes: 6 additions & 20 deletions mdx/uk/generate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,17 @@
Remove entity-level Scope elements, leaving only the ones associated
with role descriptors.
-->
<bean id="stripEntityScopes" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/entity_scopes.xsl"/>
</bean>
</property>
</bean>
<bean id="stripEntityScopes" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/entity_scopes.xsl"/>

<!--
finalise_parent
Template for a stage used in each output pipeline which performs
final tweaks on the document.
-->
<bean id="finalise_parent" abstract="true" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/final_tweak.xsl"/>
</bean>
</property>
<bean id="finalise_parent" abstract="true" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/final_tweak.xsl">
<property name="transformParameters">
<map>
<entry key="publisher" value-ref="uk_federation_uri"/>
Expand Down Expand Up @@ -101,13 +92,8 @@
Patch any @use-less KeyName descriptors in IdP roles
for the benefit of Shib SPs pre-1.3.1.
-->
<bean id="fixup_keyuse" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/fixup_keyuse.xsl"/>
</bean>
</property>
</bean>
<bean id="fixup_keyuse" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/fixup_keyuse.xsl"/>

<!--
check_fixup_keyuse
Expand Down
18 changes: 4 additions & 14 deletions mdx/uk/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,8 @@
<list>
<ref bean="uk_registeredEntities"/>
<ref bean="assemble"/>
<bean id="process" parent="XSLTransformationStage">
<property name="xslResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/sp_mdui_test.xsl"/>
</bean>
</property>
</bean>
<bean id="process" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/sp_mdui_test.xsl"/>
<bean id="serialize" parent="SerializationStage">
<property name="outputFile">
<bean class="java.io.File">
Expand Down Expand Up @@ -239,13 +234,8 @@
<ref bean="uk_fix_mailto"/>

<!-- transform into a fragment using our local conventions -->
<bean id="importTransform" parent="XSLTransformationStage">
<property name="XSLResource">
<bean parent="ClassPathResource">
<constructor-arg value="uk/import.xsl"/>
</bean>
</property>
</bean>
<bean id="importTransform" parent="XSLTransformationStage"
p:XSLResource="classpath:uk/import.xsl"/>

<!-- normalise namespaces in a specific way -->
<bean id="normalizeFragment" parent="XSLTransformationStage">
Expand Down

0 comments on commit 20c9b53

Please sign in to comment.