Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.archive.crawler.admin.ui
Class JobConfigureUtils

    java.lang.Object
      org.archive.crawler.admin.ui.JobConfigureUtils

    public class JobConfigureUtils

extends java.lang.Object

Utility methods used configuring jobs in the admin UI. Methods are mostly called by the admin UI jsp.

Version:
  $Date: 2006-07-31 19:39:04 +0000 (Mon, 31 Jul 2006) $, $Revision: 4401 $
Author:
  stack

Field Summary
`static java.lang.String` | `ACTION`
`static java.lang.String` | `FILTERS`
`static java.lang.String` | `SUBACTION`

Constructor Summary
`JobConfigureUtils()`

Method Summary
`protected static void` | `checkAttribute(ModuleAttributeInfo att, ComplexType mbean, CrawlerSettings settings, javax.servlet.http.HttpServletRequest request, boolean expert)` Process passed attribute.
`static CrawlJob` | `checkCrawlJob(CrawlJob job, javax.servlet.http.HttpServletResponse response, java.lang.String redirectBasePath, java.lang.String currDomain)` Check passed job is not null and not readonly.
`protected static CrawlJob` | `getAndCheckJob(CrawlJob job, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Check passed crawljob CrawlJob setting.
`protected static java.io.File` | `getSeedFile(SettingsHandler hndlr)`
`protected static java.io.InputStream` | `getSeedStream(SettingsHandler hndlr)` Return seeds as a stream.
`static CrawlJob` | `handleJobAction(CrawlJobHandler handler, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String redirectBasePath, java.lang.String currDomain, java.lang.String reference)` Handle job action.
`static void` | `printOutSeeds(SettingsHandler hndlr, java.lang.String payload)` Print complete seeds list on passed in PrintWriter.
`static void` | `printOutSeeds(SettingsHandler hndlr, java.io.Writer out)` Print complete seeds list on passed in PrintWriter.
`static boolean` | `seedsEdittableSize(SettingsHandler h)` Test whether seeds file is of a size that's reasonable to edit in an HTML textarea.
`protected static void` | `writeAttribute(java.lang.String attName, java.lang.String attAbsoluteName, ComplexType mbean, CrawlerSettings settings, java.lang.Object value)` Write out attribute.
`static void` | `writeNewOrderFile(ComplexType mbean, CrawlerSettings settings, javax.servlet.http.HttpServletRequest request, boolean expert)` This methods updates a ComplexType with information passed to it by a HttpServletRequest.
`protected static void` | `writeReader(java.io.Reader reader, java.io.Writer out)` Print complete seeds list on passed in PrintWriter.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ACTION

    public static final java.lang.String ACTION

See Also:
  Constant Field Values

### SUBACTION

    public static final java.lang.String SUBACTION

See Also:
  Constant Field Values

### FILTERS

    public static final java.lang.String FILTERS

See Also:
  Constant Field Values

Constructor Detail

### JobConfigureUtils

    public JobConfigureUtils()

Method Detail

### getAndCheckJob

    protected static CrawlJob getAndCheckJob(CrawlJob job,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)

  Check passed crawljob CrawlJob setting. Call this method at start of page.

  Parameters:
    `job` - Current CrawlJobHandler.
    `request` - Http request.
    `response` - Http response.
  Returns:
    Crawljob.

### writeNewOrderFile

    public static void writeNewOrderFile(ComplexType mbean,
                                         CrawlerSettings settings,
                                         javax.servlet.http.HttpServletRequest request,
                                         boolean expert)

  This methods updates a ComplexType with information passed to it by a HttpServletRequest. It assumes that for every 'simple' type there is a corresponding parameter in the request. A recursive call will be made for any nested ComplexTypes. For each attribute it will check if the relevant override is set (name.override parameter equals 'true'). If so the attribute setting on the specified domain level (settings) will be rewritten. If it is not we well ensure that it isn't being overridden.

  Parameters:
    `mbean` - The ComplexType to update
    `settings` - CrawlerSettings for the domain to override setting for. null denotes the global settings.
    `request` - The HttpServletRequest to use to update the ComplexType
    `expert` - if true expert settings will be updated, otherwise they will be ignored.

### checkAttribute

    protected static void checkAttribute(ModuleAttributeInfo att,
                                         ComplexType mbean,
                                         CrawlerSettings settings,
                                         javax.servlet.http.HttpServletRequest request,
                                         boolean expert)

  Process passed attribute. Check if needs to be written and if so, write it.

  Parameters:
    `att` - Attribute to process.
    `mbean` - The ComplexType to update
    `settings` - CrawlerSettings for the domain to override setting for. null denotes the global settings.
    `request` - The HttpServletRequest to use to update the ComplexType
    `expert` - if true expert settings will be updated, otherwise they will be ignored.

### writeAttribute

    protected static void writeAttribute(java.lang.String attName,
                                         java.lang.String attAbsoluteName,
                                         ComplexType mbean,
                                         CrawlerSettings settings,
                                         java.lang.Object value)

  Write out attribute.

  Parameters:
    `attName` - Attribute short name.
    `attAbsoluteName` - Attribute full name.
    `mbean` - The ComplexType to update
    `settings` - CrawlerSettings for the domain to override setting for. null denotes the global settings.
    `value` - Value to set into the attribute.

### checkCrawlJob

    public static CrawlJob checkCrawlJob(CrawlJob job,
                                         javax.servlet.http.HttpServletResponse response,
                                         java.lang.String redirectBasePath,
                                         java.lang.String currDomain)
                                  throws java.io.IOException

  Check passed job is not null and not readonly.

  Parameters:
    `job` - Job to check.
    `response` - Http response.
    `redirectBasePath` - Full path for where to go next if an error.
    `currDomain` - May be null. E.g. "/admin/jobs/per/overview.jsp".
  Returns:
    A job else we've redirected if no job or readonly.
  Throws:
    `java.io.IOException`

### handleJobAction

    public static CrawlJob handleJobAction(CrawlJobHandler handler,
                                           javax.servlet.http.HttpServletRequest request,
                                           javax.servlet.http.HttpServletResponse response,
                                           java.lang.String redirectBasePath,
                                           java.lang.String currDomain,
                                           java.lang.String reference)
                                    throws java.io.IOException,
                                           javax.management.AttributeNotFoundException,
                                           java.lang.reflect.InvocationTargetException,
                                           javax.management.InvalidAttributeValueException

  Handle job action.

  Parameters:
    `handler` - CrawlJobHandler to operate on.
    `request` - Http request.
    `response` - Http response.
    `redirectBasePath` - Full path for where to go next if an error. E.g. "/admin/jobs/per/overview.jsp".
    `currDomain` - Current domain. Pass null for global domain.
    `reference` -
  Returns:
    The crawljob configured.
  Throws:
    `java.io.IOException`
    `javax.management.AttributeNotFoundException`
    `java.lang.reflect.InvocationTargetException`
    `javax.management.InvalidAttributeValueException`

### printOutSeeds

    public static void printOutSeeds(SettingsHandler hndlr,
                                     java.lang.String payload)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException,
                                     java.io.IOException

  Print complete seeds list on passed in PrintWriter.

  Parameters:
    `hndlr` - Current handler.
    `payload` - What to write out.
  Throws:
    `javax.management.AttributeNotFoundException`
    `javax.management.MBeanException`
    `javax.management.ReflectionException`
    `java.io.IOException`
    `java.io.IOException`

### printOutSeeds

    public static void printOutSeeds(SettingsHandler hndlr,
                                     java.io.Writer out)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException,
                                     java.io.IOException

  Print complete seeds list on passed in PrintWriter.

  Parameters:
    `hndlr` - Current handler.
    `out` - Writer to write out all seeds to.
  Throws:
    `javax.management.ReflectionException`
    `javax.management.MBeanException`
    `javax.management.AttributeNotFoundException`
    `java.io.IOException`

### seedsEdittableSize

    public static boolean seedsEdittableSize(SettingsHandler h)
                                      throws javax.management.AttributeNotFoundException,
                                             javax.management.MBeanException,
                                             javax.management.ReflectionException

  Test whether seeds file is of a size that's reasonable to edit in an HTML textarea.

  Parameters:
    `h` - current settingsHandler
  Returns:
    true if seeds size is manageable, false otherwise
  Throws:
    `javax.management.AttributeNotFoundException`
    `javax.management.MBeanException`
    `javax.management.ReflectionException`

### getSeedFile

    protected static java.io.File getSeedFile(SettingsHandler hndlr)
                                       throws javax.management.AttributeNotFoundException,
                                              javax.management.MBeanException,
                                              javax.management.ReflectionException

  Parameters:
    `hndlr` - Settings handler.
  Returns:
    Seeds file.
  Throws:
    `javax.management.ReflectionException`
    `javax.management.MBeanException`
    `javax.management.AttributeNotFoundException`

### getSeedStream

    protected static java.io.InputStream getSeedStream(SettingsHandler hndlr)
                                                throws java.io.IOException,
                                                       javax.management.AttributeNotFoundException,
                                                       javax.management.MBeanException,
                                                       javax.management.ReflectionException

  Return seeds as a stream. This method will work for case where seeds are on disk or on classpath.

  Parameters:
    `hndlr` - SettingsHandler. Used to find seeds.txt file.
  Returns:
    InputStream on current seeds file.
  Throws:
    `java.io.IOException`
    `javax.management.ReflectionException`
    `javax.management.MBeanException`
    `javax.management.AttributeNotFoundException`

### writeReader

    protected static void writeReader(java.io.Reader reader,
                                      java.io.Writer out)
                               throws java.io.IOException

  Print complete seeds list on passed in PrintWriter.

  Parameters:
    `reader` - File to read seeds from.
    `out` - Writer to write out all seeds to.
  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Internet Archive. All Rights Reserved.