1. jhove2
  2. main

Commits

nclarkekb  committed 53f05a5

Fixed some configuration issues so the FileModule identification now works with ARC.

  • Participants
  • Parent commits ec51b1a
  • Branches default

Comments (0)

Files changed (6)

File config/spring/module/display/jhove2-display-config.xml

View file
  • Ignore whitespace
            http://www.springframework.org/schema/context/spring-context-2.5.xsd
 		   http://www.springframework.org/schema/util 
 		   http://www.springframework.org/schema/util/spring-util-2.0.xsd">
-	
+
  	<!-- JSON displayer bean -->
 	<bean id="JSON" class="org.jhove2.module.display.JSONDisplayer" scope="prototype">
 	    <constructor-arg ref="BaseModuleAccessor"/>
 		<property name="showIdentifiers" value="false"/>
 		<property name="showRawProperties" value="true"/>
 	</bean>
-	      	
+
  	<!-- Text displayer bean -->
 	<bean id="Text" class="org.jhove2.module.display.TextDisplayer" scope="prototype">
 	    <constructor-arg ref="BaseModuleAccessor"/>
 		<property name="showIdentifiers" value="false"/>
 		<property name="showRawProperties" value="true"/>
 	</bean>
-	      	
+
  	<!-- XML displayer bean -->
 	<bean id="XML" class="org.jhove2.module.display.XMLDisplayer" scope="prototype">
 	    <constructor-arg ref="BaseModuleAccessor"/>
 		<property name="showDescriptiveProperties" value="true"/>
 		<property name="showRawProperties" value="true"/>
 	</bean>
-	
+
+ 	<!-- Generic XSLT displayer bean configuration -->
+ 	<!-- One non-abstract bean shall be created for each stylesheet,
+ 	     defining the stylesheet property value.
+ 	 -->
+	<bean id="AbstractXSLT" class="org.jhove2.module.display.XSLDisplayer"
+	      abstract="true">
+		<property name="developers">
+			<list value-type="org.jhove2.core.Agent">
+                                <ref bean="NetarkivetAgent"/>
+				<ref bean="BnFAgent"/>
+			</list>
+		</property>
+		<property name="configInfo" ref="ConfigInfo"/>
+		<property name="shouldIndent" value="true"/>
+		<property name="showDescriptiveProperties" value="true"/>
+		<property name="showRawProperties" value="true"/>
+		<!-- property name="stylesheet" value="classpath:xxx.xsl"/ -->
+	</bean>
+
+        <!-- XSL displayer bean -->
+        <bean id="XSL" class="org.jhove2.module.display.XSLDisplayer" scope="prototype" parent="AbstractXSLT">
+            <constructor-arg ref="BaseModuleAccessor"/>
+            <property name="stylesheet" value="classpath:containerMD.xsl"/>
+        </bean>
+
 	<!-- Displayer ConfigInfo bean -->
 	<bean id="ConfigInfo" class="org.jhove2.config.spring.SpringConfigInfo" scope="singleton" />
-</beans>		   
+</beans>

File config/spring/module/format/arc/jhove2-arc-config.xml

View file
  • Ignore whitespace
 	<constructor-arg type="org.jhove2.core.format.Format$Ambiguity" value="Unambiguous"/>
 
 	<property name="aliasIdentifiers">
-  	    <set value-type="org.jhove2.core.I8R">
+	  <set value-type="org.jhove2.core.I8R">
 	    <ref bean="AlexaArchiveFileIdentifier"/>
-	    <!-- ARC PUID x-fmt/219 alias identifier bean -->
-	    <bean class="org.jhove2.core.I8R">
-	      <constructor-arg type="java.lang.String" value="x-fmt/219"/>
-	      <constructor-arg type="org.jhove2.core.I8R$Namespace" value="PUID"/>
-	    </bean>
-	    <!-- ARC MIME alias identifier bean -->
-	    <bean class="org.jhove2.core.I8R">
-	      <constructor-arg type="java.lang.String" value="application/x-ia-arc"/>
-	      <constructor-arg type="org.jhove2.core.I8R$Namespace" value="MIME"/>
-	    </bean>
+	    <ref bean="ArcXFmt219Identifier"/>
+	    <ref bean="ArcMimeIdentifier"/>
 	  </set>
 	</property>
 	<property name="aliasNames">
 
   <!-- Arc identifier bean -->
   <bean id="AlexaArchiveFileIdentifier" class="org.jhove2.core.I8R" scope="singleton">
-    <constructor-arg value="http://jhove2.org/terms/format/arc"
-                     type="java.lang.String"/>
+    <constructor-arg type="java.lang.String" value="http://jhove2.org/terms/format/arc"/>
+  </bean>
+
+  <!-- ARC PUID x-fmt/219 alias identifier bean -->
+  <bean id="ArcXFmt219Identifier" class="org.jhove2.core.I8R" scope="singleton">
+    <constructor-arg type="java.lang.String" value="x-fmt/219"/>
+    <constructor-arg type="org.jhove2.core.I8R$Namespace" value="PUID"/>
+  </bean>
+
+  <!-- ARC MIME alias identifier bean -->
+  <bean id="ArcMimeIdentifier" class="org.jhove2.core.I8R" scope="singleton">
+    <constructor-arg type="java.lang.String" value="application/x-ia-arc"/>
+    <constructor-arg type="org.jhove2.core.I8R$Namespace" value="MIME"/>
   </bean>
 
   <!-- ARC file format version 1.0 specification bean -->

File config/spring/module/format/jhove2-otherFormats-config.xml

View file
  • Ignore whitespace
                      value="PUID"/>
   </bean>
 
-  <bean id="AlexaArchiveFileFormat" class="org.jhove2.core.format.Format"
-        scope="singleton">
-		<constructor-arg type="java.lang.String" value="Alexa Archive File"/>
-		<constructor-arg ref="AlexaArchiveFileIdentifier"/>
-    <constructor-arg type="org.jhove2.core.format.Format$Type"
-                     value="Format"/>
-    <constructor-arg type="org.jhove2.core.format.Format$Ambiguity"
-                     value="Unambiguous"/>
-		<property name="aliasIdentifiers">
-			<set value-type="org.jhove2.core.I8R">
-				<ref bean="AlexaArchiveFileIdentifier"/>
-				<ref bean="AlexaArchiveFilePUID1"/>
-			</set>
-		</property>
-	</bean>
-	<!-- AlexaArchiveFile JHOVE2 identifier bean -->
-	<bean id="AlexaArchiveFileIdentifier" class="org.jhove2.core.I8R" scope="singleton">
-    <constructor-arg type="java.lang.String"
-                     value="http://jhove2.org/terms/format/arc"/>
-	</bean>
-	<!-- AlexaArchiveFile PUID identifier bean -->
-	<bean id="AlexaArchiveFilePUID1" class="org.jhove2.core.I8R" scope="singleton">
-    <constructor-arg type="java.lang.String"
-                     value="x-fmt/219"/>
-    <constructor-arg type="org.jhove2.core.I8R$Namespace"
-                     value="PUID"/>
-  </bean>
-
   <bean id="AMIDrawDrawingFormat" class="org.jhove2.core.format.Format"
         scope="singleton">
 		<constructor-arg type="java.lang.String" value="AMI Draw Drawing"/>
                      value="PUID"/>
   </bean>
 
-  <bean id="GZIPFormatFormat" class="org.jhove2.core.format.Format"
-        scope="singleton">
-		<constructor-arg type="java.lang.String" value="GZIP Format"/>
-		<constructor-arg ref="GZIPFormatIdentifier"/>
-    <constructor-arg type="org.jhove2.core.format.Format$Type"
-                     value="Format"/>
-    <constructor-arg type="org.jhove2.core.format.Format$Ambiguity"
-                     value="Unambiguous"/>
-		<property name="aliasIdentifiers">
-			<set value-type="org.jhove2.core.I8R">
-				<ref bean="GZIPFormatIdentifier"/>
-				<ref bean="GZIPFormatPUID1"/>
-			</set>
-		</property>
-	</bean>
-	<!-- GZIPFormat JHOVE2 identifier bean -->
-	<bean id="GZIPFormatIdentifier" class="org.jhove2.core.I8R" scope="singleton">
-    <constructor-arg type="java.lang.String"
-                     value="http://jhove2.org/terms/format/gzip"/>
-	</bean>
-	<!-- GZIPFormat PUID identifier bean -->
-	<bean id="GZIPFormatPUID1" class="org.jhove2.core.I8R" scope="singleton">
-    <constructor-arg type="java.lang.String"
-                     value="x-fmt/266"/>
-    <constructor-arg type="org.jhove2.core.I8R$Namespace"
-                     value="PUID"/>
-  </bean>
-
   <bean id="HarvardGraphicsChartFormat" class="org.jhove2.core.format.Format"
         scope="singleton">
 		<constructor-arg type="java.lang.String" value="Harvard Graphics Chart"/>

File config/spring/module/format/warc/jhove2-warc-config.xml

View file
  • Ignore whitespace
     <property name="aliasIdentifiers">
       <set value-type="org.jhove2.core.I8R">
 	<ref bean="WarcArchiveFileIdentifier"/>
-	<!-- ARC PUID x-fmt/219 alias identifier bean -->
-	<bean class="org.jhove2.core.I8R">
-	  <constructor-arg type="java.lang.String" value="fmt/289"/>
-	  <constructor-arg type="org.jhove2.core.I8R$Namespace" value="PUID"/>
-	</bean>
-	<!-- WARC MIME alias identifier bean -->
-	<bean class="org.jhove2.core.I8R">
-	  <constructor-arg type="java.lang.String" value="application/warc"/>
-	  <constructor-arg type="org.jhove2.core.I8R$Namespace" value="MIME"/>
-	</bean>
-	<!-- WARC ISO 28500 -->
-	<bean id="WarcISO28500" class="org.jhove2.core.I8R" scope="singleton">
-	  <constructor-arg type="java.lang.String" value="ISO 28500:2009(E)" />
-	  <constructor-arg type="org.jhove2.core.I8R$Namespace" value="ISO" />
-	</bean>
+	<ref bean="WarcXFmt219Identifier"/>
+	<ref bean="WarcMimeIdentifier"/>
+	<ref bean="WarcISO28500"/>
       </set>
     </property>
     <property name="aliasNames">
 
   <!-- WARC identifier bean -->
   <bean id="WarcArchiveFileIdentifier" class="org.jhove2.core.I8R" scope="singleton">
-    <constructor-arg value="http://jhove2.org/terms/format/warc" type="java.lang.String"/>
+    <constructor-arg type="java.lang.String" value="http://jhove2.org/terms/format/warc"/>
+  </bean>
+
+  <!-- ARC PUID x-fmt/219 alias identifier bean -->
+  <bean id="WarcXFmt219Identifier" class="org.jhove2.core.I8R" scope="singleton">
+    <constructor-arg type="java.lang.String" value="fmt/289"/>
+    <constructor-arg type="org.jhove2.core.I8R$Namespace" value="PUID"/>
+  </bean>
+
+  <!-- WARC MIME alias identifier bean -->
+  <bean id="WarcMimeIdentifier" class="org.jhove2.core.I8R" scope="singleton">
+    <constructor-arg type="java.lang.String" value="application/warc"/>
+    <constructor-arg type="org.jhove2.core.I8R$Namespace" value="MIME"/>
+  </bean>
+
+  <!-- WARC ISO 28500 -->
+  <bean id="WarcISO28500" class="org.jhove2.core.I8R" scope="singleton">
+    <constructor-arg type="java.lang.String" value="ISO 28500:2009(E)" />
+    <constructor-arg type="org.jhove2.core.I8R$Namespace" value="ISO" />
   </bean>
 
   <!-- WARC file format version 1.0 specification bean -->

File config/spring/module/identify/jhove2-identify-config.xml

View file
  • Ignore whitespace
 				<ref bean="StanfordAgent"/>
 			</list>
 		</property>
-		<property name="sourceIdentifier" ref="DROIDIdentifier"/>
-		<!-- property name="sourceIdentifier" ref="LibmagicIdentifier"/ -->
+		<!-- property name="sourceIdentifier" ref="DROIDIdentifier"/ -->
+		<property name="sourceIdentifier" ref="LibmagicIdentifier"/>
 		<property name="shouldSkipIdentifyIfPreIdentified" value="true"/>
 	</bean>
 	<!-- DROID identifier bean -->

File src/main/java/org/jhove2/config/spring/SpringConfigInfo.java

View file
  • Ignore whitespace
 			/* Get the JHOVE format identifier for the format */
 			I8R formatID = format.getIdentifier();
 			/* For each aliasIdentifier of the format */
-			for (I8R alias :  format.getAliasIdentifiers()) {
+			for (I8R alias : format.getAliasIdentifiers()) {
 				if (alias.getNamespace().equals(namespace)) {
 					/* Add an entry into the format identifier to module map */
 					map.put(alias.getValue(), formatID.getValue());