|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.tigris.scarab.util.xmlissues.ImportIssues
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.
| Nested Class Summary | |
static class |
ImportIssues.ImportType
|
(package private) class |
ImportIssues.ScarabIssuesSetupRule
A rule to perform setup of the a ScarabIssues instance. |
(package private) class |
ImportIssues.TransformResolver
A URI Resolver for use with the XSL transforms This resolver will map a URI in the XSL transform to an absolute file path. |
| Field Summary | |
static java.lang.String |
SYSTEM_DTD_URI
|
| Constructor Summary | |
ImportIssues()
|
|
ImportIssues(boolean allowFileAttachments)
|
|
| Method Summary | |
protected org.apache.commons.betwixt.io.BeanReader |
createScarabIssuesBeanReader()
Return a bean reader for ScarabIssue. |
protected org.apache.commons.betwixt.XMLIntrospector |
createXMLIntrospector()
|
void |
error(org.xml.sax.SAXParseException e)
Receive notification of a recoverable error. |
void |
execute()
Hook method called by Ant's Task wrapper. |
void |
fatalError(org.xml.sax.SAXParseException e)
Receive notification of a non-recoverable error. |
java.io.File |
getConfigDir()
|
java.lang.String |
getConfigFile()
|
ScarabIssues |
getScarabIssuesBeanReader()
Get instance of the ScarabIssues used importing. |
boolean |
getSendEmail()
|
java.lang.String |
getTurbineResources()
|
java.io.File |
getXmlFile()
|
void |
init()
|
protected ScarabIssues |
insert(java.lang.String name,
java.io.Reader is,
org.apache.commons.betwixt.io.BeanReader reader)
Do actual issue insert. |
java.util.Collection |
runImport(java.io.File importFile)
Run an import. |
java.util.Collection |
runImport(org.apache.commons.fileupload.FileItem importFile)
Run an import. |
java.util.Collection |
runImport(org.apache.commons.fileupload.FileItem importFile,
Module currentModule,
ImportIssues.ImportType type)
Run an import. |
java.util.Collection |
runImport(java.io.File importFile,
Module currentModule)
Run an import. |
protected java.util.Collection |
runImport(java.lang.String filePath,
java.lang.Object input,
Module currentModule,
ImportIssues.ImportType type)
|
void |
setConfigDir(java.io.File configDir)
|
void |
setConfigFile(java.lang.String configProps)
|
void |
setSendEmail(boolean state)
|
void |
setTurbineResources(java.lang.String trProps)
|
void |
setXmlFile(java.io.File xmlFile)
|
protected void |
validate(java.lang.String name,
java.io.Reader is,
org.apache.commons.betwixt.io.BeanReader reader,
Module currentModule)
Run validation phase. |
void |
warning(org.xml.sax.SAXParseException e)
Receive notification of a warning. |
protected void |
write(java.lang.Object bean,
java.io.Writer out)
Method to output the bean object as XML. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String SYSTEM_DTD_URI
| Constructor Detail |
public ImportIssues()
public ImportIssues(boolean allowFileAttachments)
| Method Detail |
public boolean getSendEmail()
public void setSendEmail(boolean state)
public java.io.File getXmlFile()
public void setXmlFile(java.io.File xmlFile)
public java.io.File getConfigDir()
public void setConfigDir(java.io.File configDir)
public java.lang.String getConfigFile()
public void setConfigFile(java.lang.String configProps)
public java.lang.String getTurbineResources()
public void setTurbineResources(java.lang.String trProps)
public void init()
throws ScarabException,
java.net.MalformedURLException,
java.io.IOException
ScarabException
java.net.MalformedURLException
java.io.IOException
public void execute()
throws ScarabException
ScarabException
public java.util.Collection runImport(java.io.File importFile)
throws ScarabException
importFile - File to import.
java.lang.Exception
ScarabException
public java.util.Collection runImport(java.io.File importFile,
Module currentModule)
throws ScarabException
importFile - File to import.currentModule - If non-null, run check that import is going
against this module.
java.lang.Exception
ScarabException
public java.util.Collection runImport(org.apache.commons.fileupload.FileItem importFile)
throws ScarabException
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).
importFile - FileItem reference to use importing.
java.lang.Exception
ScarabException
public java.util.Collection runImport(org.apache.commons.fileupload.FileItem importFile,
Module currentModule,
ImportIssues.ImportType type)
throws ScarabException
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).
importFile - FileItem reference to use importing.currentModule - If non-null, run check that import is going
against this module.
java.lang.Exception
ScarabException
protected java.util.Collection runImport(java.lang.String filePath,
java.lang.Object input,
Module currentModule,
ImportIssues.ImportType type)
throws ScarabException
input - A File or FileItem.
ScarabException
protected void validate(java.lang.String name,
java.io.Reader is,
org.apache.commons.betwixt.io.BeanReader reader,
Module currentModule)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException
name - Filename to output in log message. May be null.is - Input stream to read.reader - ScarabIssues bean reader instance.currentModule - If not null, check whether
import is going against this module.
java.lang.Exception
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
protected ScarabIssues insert(java.lang.String name,
java.io.Reader is,
org.apache.commons.betwixt.io.BeanReader reader)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
java.io.IOException,
ScarabException
name - Name to use in log messages (E.g. filename). May be null.is - Input stream of xml to insert.reader - ScarabIssues bean reader instance.
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException
ScarabExceptionpublic ScarabIssues getScarabIssuesBeanReader()
protected org.apache.commons.betwixt.io.BeanReader createScarabIssuesBeanReader()
throws javax.xml.parsers.ParserConfigurationException,
java.beans.IntrospectionException,
org.xml.sax.SAXNotRecognizedException,
org.xml.sax.SAXNotSupportedException
javax.xml.parsers.ParserConfigurationException
java.beans.IntrospectionException
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedExceptionprotected org.apache.commons.betwixt.XMLIntrospector createXMLIntrospector()
protected void write(java.lang.Object bean,
java.io.Writer out)
throws java.io.IOException,
org.xml.sax.SAXException,
java.beans.IntrospectionException
java.io.IOException
org.xml.sax.SAXException
java.beans.IntrospectionException
public void error(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXParseException
error in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXParseException
public void fatalError(org.xml.sax.SAXParseException e)
throws org.xml.sax.SAXParseException
fatalError in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXParseExceptionpublic void warning(org.xml.sax.SAXParseException e)
warning in interface org.xml.sax.ErrorHandler
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||