Finished changes to LexRepository that ended the practice of storing database connections.
This commit is contained in:
parent
b9b0b8feed
commit
39753a477f
5 changed files with 177 additions and 12 deletions
26
build.xml
26
build.xml
|
@ -1,3 +1,23 @@
|
|||
<!--
|
||||
This build file requires a build.properties file with the following properties:
|
||||
|
||||
#Configure properties to access the Manager application user/pass combo should be in $TOMCAT_HOME/conf/tomcat-users.xml with manager role.
|
||||
catalina.home=/usr/local/tomcat
|
||||
catalina.base=/usr/local/tomcat
|
||||
url=http://localhost:2020/manager
|
||||
username=
|
||||
password=
|
||||
|
||||
#provide location of working copy of lex-context-config.xml
|
||||
lex.context.config=lex-context-config-working.xml
|
||||
|
||||
#These properties need to be set to run the unit tests. They are your login to the dictionary
|
||||
lex.username=
|
||||
lex.password=
|
||||
jmeterhome=../jmeter
|
||||
|
||||
-->
|
||||
|
||||
<project name="Lex" default="compile" basedir=".">
|
||||
|
||||
<!-- Configure the directory into which the web application is built -->
|
||||
|
@ -10,9 +30,9 @@
|
|||
<!-- Configure the context path for this application -->
|
||||
<property name="path" value="/lex"/>
|
||||
|
||||
<!-- <property file="${user.home}/.${ant.project.name}-build.properties"/>
|
||||
<property file="${user.home}/.build.properties"/> -->
|
||||
<property file="working.build.properties"/>
|
||||
<property file="${user.home}/.${ant.project.name}-build.properties"/>
|
||||
<property file="${user.home}/.build.properties"/>
|
||||
<property file="build.properties"/>
|
||||
|
||||
<!-- Configure the custom Ant tasks for the Manager application
|
||||
These tasks require catalina-ant.jar in $ANT_HOME/lib-->
|
||||
|
|
|
@ -74,16 +74,38 @@
|
|||
<servlet>
|
||||
<servlet-name>action</servlet-name>
|
||||
<servlet-class>org.thdl.lex.LexActionServlet</servlet-class>
|
||||
|
||||
<!--These init parameter provide configuration info for the Global object that stores recently modified terms.-->
|
||||
<init-param>
|
||||
<param-name>globalDataRefreshDelay</param-name>
|
||||
<!--delay in minutes-->
|
||||
<param-value>6</param-value>
|
||||
<param-value>6</param-value><!--delay in seconds-->
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>recentItems</param-name>
|
||||
<!--number of recently modified terms to store in the global object-->
|
||||
<param-name>recentItems</param-name><!--number of recently modified terms -->
|
||||
<param-value>6</param-value>
|
||||
</init-param>
|
||||
|
||||
<!--These init parameter provide configuration info for the OAI Metadata Harvesting of Bibliographical entries-->
|
||||
<init-param>
|
||||
<param-name>oaiServer</param-name>
|
||||
<param-value>http://datastore.lib.virginia.edu/tibet/spt/SPT--OAI.php</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>oaiMetadataPrefix</param-name>
|
||||
<param-value>oai_dc</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>oaiHome</param-name>
|
||||
<param-value>/Users/travis/webapps/oai-sources</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>oaiLocalCopy</param-name>
|
||||
<param-value>Thdl_Oai_Bibliography_Sources.xml</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>oaiRefreshDelay</param-name><!--Hours between total refresh of sources-->
|
||||
<param-value>24</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<session-factory>
|
||||
|
||||
<property name="connection.datasource">java:comp/env/jdbc/lex-datasource</property>
|
||||
<property name="show_sql">true</property>
|
||||
<property name="show_sql">false</property>
|
||||
<property name="use_outer_join">true</property>
|
||||
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
|
||||
<!-- <property name="max_fetch_depth">15</property>
|
||||
|
|
|
@ -69,8 +69,17 @@ public class LexActionServlet extends HttpServlet
|
|||
{
|
||||
super.init( config );
|
||||
initCommands();
|
||||
|
||||
config.getServletContext().setAttribute( "flatData", new LexFlatDataRepository() );
|
||||
config.getServletContext().setAttribute( "sources", new LexSourceRepository() );
|
||||
|
||||
LexSourceRepository sources = LexSourceRepository.getInstance();
|
||||
sources.setOaiServer( config.getServletContext().getInitParameter( "oaiServer" ) );
|
||||
sources.setOaiMetadataPrefix( config.getServletContext().getInitParameter( "oaiMetadataPrefix" ) );
|
||||
sources.setOaiHome( config.getServletContext().getInitParameter( "oaiHome" ) );
|
||||
sources.setOaiLocalCopy( config.getServletContext().getInitParameter( "oaiLocalCopy" ) );
|
||||
//int oaiDelay = Integer.parseInt( config.getServletContext().getInitParameter( "oaiRefreshDelay" ) );
|
||||
sources.setOaiRefreshDelay( 24 );
|
||||
config.getServletContext().setAttribute( "sources", sources );
|
||||
String delay = config.getInitParameter( "globalDataRefreshDelay" );
|
||||
long refreshDelay = Long.parseLong( delay ) * 1000;
|
||||
String recent = config.getInitParameter( "recentItems" );
|
||||
|
|
|
@ -25,11 +25,125 @@ public class LexSourceRepository
|
|||
{
|
||||
//attributes
|
||||
private static LexSourceRepository instance;
|
||||
|
||||
private ScheduledHarvestManager harvestManager;
|
||||
|
||||
private ScheduledHarvest harvest;
|
||||
|
||||
private String oaiServer;
|
||||
private String oaiMetadataPrefix;
|
||||
private String oaiHome;
|
||||
private String oaiLocalCopy;
|
||||
private int oaiRefreshDelay;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the oaiServer attribute of the LexSourceRepository object
|
||||
*
|
||||
* @param oaiServer The new oaiServer value
|
||||
*/
|
||||
public void setOaiServer( String oaiServer )
|
||||
{
|
||||
this.oaiServer = oaiServer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the oaiMetadataPrefix attribute of the LexSourceRepository object
|
||||
*
|
||||
* @param oaiMetadataPrefix The new oaiMetadataPrefix value
|
||||
*/
|
||||
public void setOaiMetadataPrefix( String oaiMetadataPrefix )
|
||||
{
|
||||
this.oaiMetadataPrefix = oaiMetadataPrefix;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the oaiHome attribute of the LexSourceRepository object
|
||||
*
|
||||
* @param oaiHome The new oaiHome value
|
||||
*/
|
||||
public void setOaiHome( String oaiHome )
|
||||
{
|
||||
this.oaiHome = oaiHome;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the oaiLocalCopy attribute of the LexSourceRepository object
|
||||
*
|
||||
* @param oaiLocalCopy The new oaiLocalCopy value
|
||||
*/
|
||||
public void setOaiLocalCopy( String oaiLocalCopy )
|
||||
{
|
||||
this.oaiLocalCopy = oaiLocalCopy;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the oaiRefreshDelay attribute of the LexSourceRepository object
|
||||
*
|
||||
* @param oaiRefreshDelay The new oaiRefreshDelay value
|
||||
*/
|
||||
public void setOaiRefreshDelay( int oaiRefreshDelay )
|
||||
{
|
||||
this.oaiRefreshDelay = oaiRefreshDelay;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the oaiServer attribute of the LexSourceRepository object
|
||||
*
|
||||
* @return The oaiServer value
|
||||
*/
|
||||
public String getOaiServer()
|
||||
{
|
||||
return oaiServer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the oaiMetadataPrefix attribute of the LexSourceRepository object
|
||||
*
|
||||
* @return The oaiMetadataPrefix value
|
||||
*/
|
||||
public String getOaiMetadataPrefix()
|
||||
{
|
||||
return oaiMetadataPrefix;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the oaiHome attribute of the LexSourceRepository object
|
||||
*
|
||||
* @return The oaiHome value
|
||||
*/
|
||||
public String getOaiHome()
|
||||
{
|
||||
return oaiHome;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the oaiLocalCopy attribute of the LexSourceRepository object
|
||||
*
|
||||
* @return The oaiLocalCopy value
|
||||
*/
|
||||
public String getOaiLocalCopy()
|
||||
{
|
||||
return oaiLocalCopy;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the oaiRefreshDelay attribute of the LexSourceRepository object
|
||||
*
|
||||
* @return The oaiRefreshDelay value
|
||||
*/
|
||||
public int getOaiRefreshDelay()
|
||||
{
|
||||
return oaiRefreshDelay;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the harvest attribute of the LexSourceRepository object
|
||||
|
@ -150,7 +264,7 @@ public class LexSourceRepository
|
|||
*
|
||||
* @exception Exception Description of the Exception
|
||||
*/
|
||||
public LexSourceRepository() throws Exception
|
||||
private LexSourceRepository() throws Exception
|
||||
{
|
||||
SimpleDataStore dataStore = new SimpleDataStore( "/Users/travis/webapps/lex/dlese-oai/scheduled-harvester", true );
|
||||
File initialHarvestDir = new File( "/Users/travis/webapps/lex/dlese-oai/datastore.lib.virginia.edu" );
|
||||
|
|
Loading…
Reference in a new issue