DLESE Tools
v1.6.0

org.dlese.dpc.repository
Class OAISetsXMLConfigManager

java.lang.Object
  extended by org.dlese.dpc.repository.OAISetsXMLConfigManager

public class OAISetsXMLConfigManager
extends Object

Reads and writes the XML configuration file used to define OAI sets in the RepositoryManager. See sample ListSets XML config file .

Version:
$Id: OAISetsXMLConfigManager.java,v 1.8 2009/03/20 23:33:54 jweather Exp $
Author:
John Weatherley

Method Summary
static SetDefinitionsForm getSetDefinitionsForm(String listSetsXml, String setSpec)
          Reads the ListSets config XML to extract the set definition for a given set into a SetDefinitionsForm bean.
static boolean removeOAISetSpecDefinition(File setsConfigFile, String setSpec)
          Removes the given OAI set definition from the ListSets config XML file and writes it to disc.
static void setDebug(boolean db)
          Sets the debug attribute of the object
static void setOAISetSpecDefinition(File setsConfigFile, SetDefinitionsForm sb)
          Sets the definition for a given OAI set, writing the ListSets config XML to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSetDefinitionsForm

public static SetDefinitionsForm getSetDefinitionsForm(String listSetsXml,
                                                       String setSpec)
                                                throws Exception
Reads the ListSets config XML to extract the set definition for a given set into a SetDefinitionsForm bean.

Parameters:
listSetsXml - The ListSets config XML to read
setSpec - The setSpec to read
Returns:
The setDefinitionsForm, or null if none configred for that setSpec
Throws:
Exception - If error parsing the XML

removeOAISetSpecDefinition

public static boolean removeOAISetSpecDefinition(File setsConfigFile,
                                                 String setSpec)
                                          throws Exception
Removes the given OAI set definition from the ListSets config XML file and writes it to disc.

Parameters:
setsConfigFile - The ListSets config file
setSpec - The set to remove
Returns:
True if the set existed and was removed
Throws:
Exception - If error

setOAISetSpecDefinition

public static void setOAISetSpecDefinition(File setsConfigFile,
                                           SetDefinitionsForm sb)
                                    throws Exception
Sets the definition for a given OAI set, writing the ListSets config XML to file. If the given set already exists, it will be re-defined, if not, a new set will be added to the existsing sets in the config XML file.

Parameters:
setsConfigFile - File to read/write
sb - The bean that contains the set definition values
Throws:
Exception - If error

setDebug

public static void setDebug(boolean db)
Sets the debug attribute of the object

Parameters:
db - The new debug value

DLESE Tools
v1.6.0