dk.netarkivet.harvester.webinterface
Class DomainDefinition

java.lang.Object
  extended by dk.netarkivet.harvester.webinterface.DomainDefinition

public class DomainDefinition
extends java.lang.Object

Utility class for handling update of domain from the domain jsp page.


Method Summary
static java.util.List<java.lang.String> createDomains(java.lang.String... domains)
          Creates domains with default attributes.
static java.lang.String makeDomainLink(java.lang.String domain)
          Creates a link to the domain edit page.
static void processRequest(javax.servlet.jsp.PageContext context, I18n i18n)
          Extracts all required parameters from the request, checks for any inconsistencies, and passes the requisite data to the updateDomain method for processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

processRequest

public static void processRequest(javax.servlet.jsp.PageContext context,
                                  I18n i18n)
Extracts all required parameters from the request, checks for any inconsistencies, and passes the requisite data to the updateDomain method for processing. For reference, the parameters for this page look something like http://localhost:8076/HarvestDefinition/Definitions-edit-domain.jsp? update=1&name=netarkivet.dk&default=defaultconfig&configName=&order_xml=& load=&maxObjects=&urlListName=&seedList=+&passwordName=&passwordDomain=& passwordRealm=&userName=&password=& crawlertraps=%2Fcgi-bin%2F*%0D%0A%2Ftrap%2F*%0D%0A update: This method throws an exception if update is not set name: must be the name of a known domain comments: optional user-entered comments about the domain default: the defaultconfig is set to this value. Must be non-null and a known configuration of this domain. crawlertraps: a newline-separated list of urls to be ignored. May be empty or null alias: If set, this domain is an alias of the set domain renewAlias: If set, the alias date should be renewed

Parameters:
context - The context of this request
i18n - I18n information
Throws:
IOFailure - on updateerrors in the DAO
ForwardedToErrorPage - if domain is not found, if the edition is out-of-date, or if parameters are missing or invalid

createDomains

public static java.util.List<java.lang.String> createDomains(java.lang.String... domains)
Creates domains with default attributes.

Parameters:
domains - a list of domain names
Returns:
List of the non-empty domain names that were not legal domain names or already exist.

makeDomainLink

public static java.lang.String makeDomainLink(java.lang.String domain)
Creates a link to the domain edit page.

Parameters:
domain - The domain to show with a link
Returns:
HTML code with the link and the domain name shown