| java.lang.Object org.archive.crawler.admin.ui.JobConfigureUtils
JobConfigureUtils | public class JobConfigureUtils (Code) | | Utility methods used configuring jobs in the admin UI.
Methods are mostly called by the admin UI jsp.
author: stack version: $Date: 2006-07-31 19:39:04 +0000 (Mon, 31 Jul 2006) $, $Revision: 4401 $ |
Method Summary | |
protected static void | checkAttribute(ModuleAttributeInfo att, ComplexType mbean, CrawlerSettings settings, HttpServletRequest request, boolean expert) Process passed attribute. | public static CrawlJob | checkCrawlJob(CrawlJob job, HttpServletResponse response, String redirectBasePath, String currDomain) Check passed job is not null and not readonly.
Parameters: job - Job to check. Parameters: response - Http response. Parameters: redirectBasePath - Full path for where to go next if an error. Parameters: currDomain - May be null.E.g. | protected static CrawlJob | getAndCheckJob(CrawlJob job, HttpServletRequest request, HttpServletResponse response) Check passed crawljob CrawlJob setting. | protected static File | getSeedFile(SettingsHandler hndlr) Parameters: hndlr - Settings handler. | protected static InputStream | getSeedStream(SettingsHandler hndlr) Return seeds as a stream.
This method will work for case where seeds are on disk or on classpath.
Parameters: hndlr - SettingsHandler. | public static CrawlJob | handleJobAction(CrawlJobHandler handler, HttpServletRequest request, HttpServletResponse response, String redirectBasePath, String currDomain, String reference) Handle job action.
Parameters: handler - CrawlJobHandler to operate on. Parameters: request - Http request. Parameters: response - Http response. Parameters: redirectBasePath - Full path for where to go next if an error.E.g. | public static void | printOutSeeds(SettingsHandler hndlr, String payload) Print complete seeds list on passed in PrintWriter. | public static void | printOutSeeds(SettingsHandler hndlr, Writer out) Print complete seeds list on passed in PrintWriter. | public 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(String attName, String attAbsoluteName, ComplexType mbean, CrawlerSettings settings, Object value) Write out attribute.
Parameters: attName - Attribute short name. Parameters: attAbsoluteName - Attribute full name. Parameters: mbean - The ComplexType to update Parameters: settings - CrawlerSettings for the domain to override setting for. | public static void | writeNewOrderFile(ComplexType mbean, CrawlerSettings settings, HttpServletRequest request, boolean expert) This methods updates a ComplexType with information passed to it by a
HttpServletRequest. | protected static void | writeReader(Reader reader, Writer out) Print complete seeds list on passed in PrintWriter. |
checkAttribute | protected static void checkAttribute(ModuleAttributeInfo att, ComplexType mbean, CrawlerSettings settings, HttpServletRequest request, boolean expert)(Code) | | Process passed attribute. Check if needs to be written and if so, write
it.
Parameters: att - Attribute to process. Parameters: mbean - The ComplexType to update Parameters: settings - CrawlerSettings for the domain to override setting for. nulldenotes the global settings. Parameters: request - The HttpServletRequest to use to update the ComplexType Parameters: expert - if true expert settings will be updated, otherwise they willbe ignored. |
checkCrawlJob | public static CrawlJob checkCrawlJob(CrawlJob job, HttpServletResponse response, String redirectBasePath, String currDomain) throws IOException(Code) | | Check passed job is not null and not readonly.
Parameters: job - Job to check. Parameters: response - Http response. Parameters: redirectBasePath - Full path for where to go next if an error. Parameters: currDomain - May be null.E.g. "/admin/jobs/per/overview.jsp". A job else we've redirected if no job or readonly. throws: IOException - |
getAndCheckJob | protected static CrawlJob getAndCheckJob(CrawlJob job, HttpServletRequest request, HttpServletResponse response)(Code) | | Check passed crawljob CrawlJob setting. Call this method at start of
page.
Parameters: job - Current CrawlJobHandler. Parameters: request - Http request. Parameters: response - Http response. Crawljob. |
writeAttribute | protected static void writeAttribute(String attName, String attAbsoluteName, ComplexType mbean, CrawlerSettings settings, Object value)(Code) | | Write out attribute.
Parameters: attName - Attribute short name. Parameters: attAbsoluteName - Attribute full name. Parameters: mbean - The ComplexType to update Parameters: settings - CrawlerSettings for the domain to override setting for. nulldenotes the global settings. Parameters: value - Value to set into the attribute. |
writeNewOrderFile | public static void writeNewOrderFile(ComplexType mbean, CrawlerSettings settings, HttpServletRequest request, boolean expert)(Code) | | 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 Parameters: settings - CrawlerSettings for the domain to override setting for. nulldenotes the global settings. Parameters: request - The HttpServletRequest to use to update the ComplexType Parameters: expert - if true expert settings will be updated, otherwise they willbe ignored. |
writeReader | protected static void writeReader(Reader reader, Writer out) throws IOException(Code) | | Print complete seeds list on passed in PrintWriter.
Parameters: reader - File to read seeds from. Parameters: out - Writer to write out all seeds to. throws: IOException - |
|
|