JHove2 modules - configuration
This page describes the changes required to get JHove2 running in your installation.
In order to get JHove2 running locally in your environment a few things need to be configured correctly.
/config/spring/persist/jhove2-persist-config.xml
Must be set to BerkeleyDB persistence because of several bugs in the InMemory persistence.
You must also change the envHome property in the BerkeleyDbPersistenceManager bean. This path must be valid and readable!
<bean id="BerkeleyDbPersistenceManager" class="org.jhove2.persist.berkeleydpl.BerkeleyDbPersistenceManager" scope="singleton"> <!--property name="envHome" value="C:\"/--> <property name="envHome" value="C:\Java\BerkeleyDb\"/> <!--property name="envHome" value="/tmp/BerkeleyDb/"/--> <property name="entityStoreName" value="JHOVE2_Entity_Store"/> <property name="storeConfig" ref="StoreConfig"/> <property name="envConfig" ref="EnvironmentConfig"/> </bean>
/config/spring/module/format/sgml/jhove2-sgml-config.xml
The SGML module depends on an external program called opensp. In order for the SGML module to function properly it must be configured correctly to reflect the operating system and location of the opensp executables. OpenJade ~= opensp.
First you need to configure which overall execution method is to be used. OpenSpWrapperForWindowsExe for windows or OpenSpWrapper for linux or cygwin installations on Windows.
<!-- SGML: module bean --> <bean id="SgmlModule" class="org.jhove2.module.format.sgml.SgmlModule" scope="prototype"> <constructor-arg ref="SgmlFormat"/> <constructor-arg ref="FormatModuleAccessor"/> <property name="developers"> <list value-type="org.jhove2.core.Agent"> <ref bean="PorticoAgent"/> </list> </property> <property name="wrappedProduct" ref="OpenSgml"/> <!-- Comment out unused sgmlParser property, depending on which OS/exe configuration you employ --> <!-- if using OpenJade unix exe on Unix or via Cygwin on Windows --> <!-- <property name="sgmlParser" ref="OpenSpWrapper"/> --> <!-- if using OpenJade Windows dll and executable --> <property name="sgmlParser" ref="OpenSpWrapperForWindowsExe"/> <property name="shouldFindDoctype" value="true"/> </bean>
As you can see I forgot to change the Windows folder here and it still worked. But you should changed it to a valid location to be sure.
<!-- SGML catalog file path bean: unix or Cygwin on Windows; edit as appropriate for your installation--> <bean id="SgmlCatalogPath" class="java.lang.String"> <constructor-arg type="java.lang.String" value="/usr/local/etc/sgml/catalog"/> </bean> <!-- SGML catalog file path bean: unix or Cywgin on Windows; edit as appropriate for your installation--> <bean id="WindowsSgmlCatalogPath" class="java.lang.String"> <constructor-arg type="java.lang.String" value="C:\PROGRA~1\OpenSp\catalog"/> <!-- <constructor-arg type="java.lang.String" value="C:\cygwin\usr\share\sgml\OpenSP\catalog"/> --> </bean>
Only edit these if your Windows installation is in a different location, ditto for linux.
<!-- Bean for handler to invoke external process for OpenSp utilities: Unix or Cygwin on Windows--> <!-- Edit any paths as appropriate for your installation --> <bean id="ExternalProcessHandler" class="org.jhove2.util.externalprocess.ForkShellHandler" scope="prototype"> <property name="shellEnv" value="c:\cygwin\bin\bash.exe"/> <property name="shellParms" value="-c"/> <property name="shouldQuoteCommand" value="true"/> <property name="shouldSyncAfterExcecution" value="true"/> </bean> <!-- Bean for handler to invoke external process for OpenSp utilities : Windows dll and exe--> <!-- Edit any paths as appropriate for your installation --> <bean id="WindowsExternalProcessHandler" class="org.jhove2.util.externalprocess.ForkShellHandler" scope="prototype"> <property name="shellEnv" value="C:\WINDOWS\system32\cmd.exe"/> <property name="shellParms" value="/C"/> <property name="shouldQuoteCommand" value="false"/> <property name="shouldSyncAfterExcecution" value="false"/> </bean>