| java.lang.Object org.tigris.scarab.util.xmlissues.ImportIssues
ImportIssues | public class ImportIssues implements ErrorHandler(Code) | | This is a bean'ish object which allows one to set values for importing
issues, and then run the actual import.
Amenable to the ant task wrapper or you can pass an explicit file for
explicit import if turbine is already up and running.
The way the ant task wrapper works is simple: call all the appropriate
set methods to define the properties. Then you will need to call the init()
and execute methods to start running things. Note: If Turbine is already
initialized, there is no need to call the init() method.
Instances of this class are not thread-safe.
author: Jon S. Stevens author: Daniel Rall version: $Id: ImportIssues.java 10065 2006-04-23 21:02:14Z hair $ since: Scarab beta 14 |
Inner Class :class TransformResolver implements URIResolver | |
Inner Class :class ScarabIssuesSetupRule extends Rule | |
Inner Class :final public static class ImportType | |
Method Summary | |
protected BeanReader | createScarabIssuesBeanReader() Return a bean reader for ScarabIssue. | protected XMLIntrospector | createXMLIntrospector() | public void | error(SAXParseException e) Receive notification of a recoverable error. | public void | execute() Hook method called by Ant's Task wrapper. | public void | fatalError(SAXParseException e) Receive notification of a non-recoverable error. | public File | getConfigDir() | public String | getConfigFile() | public ScarabIssues | getScarabIssuesBeanReader() Get instance of the ScarabIssues used importing.
You'd use this method to get at the instance of scarab issues used
importing for case where you want to print out info on the import thats
just happened. | public boolean | getSendEmail() | public String | getTurbineResources() | public File | getXmlFile() | public void | init() | protected ScarabIssues | insert(String name, Reader is, BeanReader reader) Do actual issue insert.
Assumes issues passed have already been validated. | public Collection | runImport(File importFile) Run an import.
Assumes we're up and running inside of turbine.
Parameters: importFile - File to import. | public Collection | runImport(File importFile, Module currentModule) Run an import.
Assumes we're up and running inside of turbine.
Parameters: importFile - File to import. Parameters: currentModule - If non-null, run check that import is going against this module. | public Collection | runImport(FileItem importFile) Run an import.
Assumes we're up and running inside of turbine. | public Collection | runImport(FileItem importFile, Module currentModule, ImportType type) Run an import.
Assumes we're up and running inside of turbine. | protected Collection | runImport(String filePath, Object input, Module currentModule, ImportType type) | public void | setConfigDir(File configDir) | public void | setConfigFile(String configProps) | public void | setSendEmail(boolean state) | public void | setTurbineResources(String trProps) | public void | setXmlFile(File xmlFile) | protected void | validate(String name, Reader is, BeanReader reader, Module currentModule) Run validation phase. | public void | warning(SAXParseException e) Receive notification of a warning. | protected void | write(Object bean, Writer out) Method to output the bean object as XML. |
SYSTEM_DTD_URI | final public static String SYSTEM_DTD_URI(Code) | | |
ImportIssues | public ImportIssues()(Code) | | |
ImportIssues | public ImportIssues(boolean allowFileAttachments)(Code) | | |
createXMLIntrospector | protected XMLIntrospector createXMLIntrospector()(Code) | | |
getScarabIssuesBeanReader | public ScarabIssues getScarabIssuesBeanReader()(Code) | | Get instance of the ScarabIssues used importing.
You'd use this method to get at the instance of scarab issues used
importing for case where you want to print out info on the import thats
just happened. Call after a successful import. Calling before will give
undefined results.
Instance of ScarabIssues we ran the import with. |
getSendEmail | public boolean getSendEmail()(Code) | | |
getTurbineResources | public String getTurbineResources()(Code) | | |
insert | protected ScarabIssues insert(String name, Reader is, BeanReader reader) throws ParserConfigurationException, SAXException, IOException, ScarabException(Code) | | Do actual issue insert.
Assumes issues passed have already been validated. If they haven't
been, could damage scarab.
Parameters: name - Name to use in log messages (E.g. filename). May be null. Parameters: is - Input stream of xml to insert. Parameters: reader - ScarabIssues bean reader instance. The instance of scarabissues we inserted in case you need to display info about the issues inserted. |
runImport | public Collection runImport(File importFile) throws ScarabException(Code) | | Run an import.
Assumes we're up and running inside of turbine.
Parameters: importFile - File to import. List of errors if any. exception: Exception - |
runImport | public Collection runImport(File importFile, Module currentModule) throws ScarabException(Code) | | Run an import.
Assumes we're up and running inside of turbine.
Parameters: importFile - File to import. Parameters: currentModule - If non-null, run check that import is going against this module. List of errors if any. exception: Exception - |
runImport | public Collection runImport(FileItem importFile) throws ScarabException(Code) | | Run an import.
Assumes we're up and running inside of turbine. Awkwardly duplicates
ImportIssues.runImport(File) import but duplication is so we can do the reget of
the input stream; FileInput "manages" backing up the Upload for us on the
second get of the input stream (It creates new ByteArrayInputStream
w/ the src being a byte array of the file its kept in memory or in
temporary storage on disk).
Parameters: importFile - FileItem reference to use importing. List of errors if any. exception: Exception - |
runImport | public Collection runImport(FileItem importFile, Module currentModule, ImportType type) throws ScarabException(Code) | | Run an import.
Assumes we're up and running inside of turbine. Awkwardly duplicates
ImportIssues.runImport(File) import but duplication is so we can do the reget of
the input stream; FileInput "manages" backing up the Upload for us on the
second get of the input stream (It creates new ByteArrayInputStream
w/ the src being a byte array of the file its kept in memory or in
temporary storage on disk).
Parameters: importFile - FileItem reference to use importing. Parameters: currentModule - If non-null, run check that import is going against this module. List of errors if any. exception: Exception - |
setConfigDir | public void setConfigDir(File configDir)(Code) | | |
setConfigFile | public void setConfigFile(String configProps)(Code) | | |
setSendEmail | public void setSendEmail(boolean state)(Code) | | |
setTurbineResources | public void setTurbineResources(String trProps)(Code) | | |
setXmlFile | public void setXmlFile(File xmlFile)(Code) | | |
validate | protected void validate(String name, Reader is, BeanReader reader, Module currentModule) throws ParserConfigurationException, SAXException, IOException(Code) | | Run validation phase. Starts by performing XML-well
formed-ness and DTD validation (if present), then checks the
content.
Parameters: name - Filename to output in log message. May be null. Parameters: is - Input stream to read. Parameters: reader - ScarabIssues bean reader instance. Parameters: currentModule - If not null , check whetherimport is going against this module. Any errors encountered during XML or contentvalidation. exception: Exception - |
|
|