Class EventHarvestUtil


  • public final class EventHarvestUtil
    extends Object
    Contains utility methods for supporting event harvest GUI.
    • Method Detail

      • 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 context
        i18n - the translation information to use in this context
        eventHarvestName - The name of the partial harvest to which these seeds are to be added
        illegalSeeds - 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 context
        i18n - The translation information to use in this context
        eventHarvestName - The name of the partial harvest to which these seeds are to be added
        seeds - The seeds as a file (each seed on a separate line)
        maxbytesString - The given maxbytes as a string
        maxobjectsString - The given maxobjects as a string
        maxrateString - The given maxrate as a string (currently not used)
        ordertemplate - The name of the ordertemplate to use
        attributes - A list of attributes and form values
        illegalSeeds - A (possibly empty) list of invalidSeeds found