Class EventHarvestUtil
- java.lang.Object
-
- dk.netarkivet.harvester.webinterface.EventHarvestUtil
-
public final class EventHarvestUtil extends Object
Contains utility methods for supporting event harvest GUI.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addConfigurations(javax.servlet.jsp.PageContext context, I18n i18n, String eventHarvestName, List<String> illegalSeeds)
Adds a bunch of configurations to a given PartialHarvest.static void
addConfigurationsFromSeedsFile(javax.servlet.jsp.PageContext context, I18n i18n, String eventHarvestName, File seeds, String maxbytesString, String maxobjectsString, String maxrateString, String ordertemplate, Map<String,String> attributes, List<String> illegalSeeds)
Add configurations to an existing selective harvest.static void
processAddSeeds(javax.servlet.jsp.PageContext pageContext, boolean isMultiPart, I18n I18N, String harvestName, List<String> illegalSeeds, Map<String,String> attributeMap)
-
-
-
Method Detail
-
processAddSeeds
public static void processAddSeeds(javax.servlet.jsp.PageContext pageContext, boolean isMultiPart, I18n I18N, String harvestName, List<String> illegalSeeds, Map<String,String> attributeMap) throws IOException
- Throws:
IOException
-
addConfigurations
public static void addConfigurations(javax.servlet.jsp.PageContext context, I18n i18n, String eventHarvestName, List<String> illegalSeeds)
Adds a bunch of configurations to a given PartialHarvest. For full definitions of the parameters, see Definitions-add-event-seeds.jsp. For each seed in the list, the following steps are taken: 1) The domain is parsed out of the seed. If no such domain is known, it is created with the usual defaults. 2) For each domain, a configuration with the name <harvestDefinition>_<orderTemplate>_<maxBytes>Bytes is created unless it already exists. The configuration uses orderTemplate, and the specified maxBytes. If maxBytes is unspecified, its default value is used. The configuration is added to the harvest specified by the harvestDefinition argument. 3) For each domain, a seedlist with the name <harvestDefinition>_<orderTemplate>_<maxBytes>Bytes is created if it does not already exist and the given url is added to it. This seedlist is the only seedlist associated with the configuration of the same name.- Parameters:
context
- the current JSP contexti18n
- the translation information to use in this contexteventHarvestName
- The name of the partial harvest to which these seeds are to be addedillegalSeeds
- A (possibly empty) list of invalidSeeds found- Throws:
ForwardedToErrorPage
- If maxBytes is not a number, or if any of the seeds is badly formatted such that no domain name can be parsed from it, or if orderTemplate is not given or unknown.
-
addConfigurationsFromSeedsFile
public static void addConfigurationsFromSeedsFile(javax.servlet.jsp.PageContext context, I18n i18n, String eventHarvestName, File seeds, String maxbytesString, String maxobjectsString, String maxrateString, String ordertemplate, Map<String,String> attributes, List<String> illegalSeeds)
Add configurations to an existing selective harvest.- Parameters:
context
- The current JSP contexti18n
- The translation information to use in this contexteventHarvestName
- The name of the partial harvest to which these seeds are to be addedseeds
- The seeds as a file (each seed on a separate line)maxbytesString
- The given maxbytes as a stringmaxobjectsString
- The given maxobjects as a stringmaxrateString
- The given maxrate as a string (currently not used)ordertemplate
- The name of the ordertemplate to useattributes
- A list of attributes and form valuesillegalSeeds
- A (possibly empty) list of invalidSeeds found
-
-