org.tigris.scarab.util.xmlissues
Class ScarabIssues

java.lang.Object
  extended byorg.tigris.scarab.util.xmlissues.ScarabIssues
All Implemented Interfaces:
java.io.Serializable

public class ScarabIssues
extends java.lang.Object
implements java.io.Serializable

This class manages the validation and importing of issues.

This classes has a format dictated by the Betwixt parser. As the parser extracts elements out of the XML file, it looks for the public getters and setters in this class's signature and thereby makes determinations on what JavaBean methods to call in this class. Reading this source file in isolation: Doing so would make it look like you could do things like remove the data member 'issue' and its accessor methods because it looks as though they are unused, whereas they are in fact signals to the Betwixt parser: It reads them and interprets their presence and instruction to create instances of issues from the XML being parsed.

Also, of note, the design of this class is that, it has two modes based off the setting of the inValidationMode class. When parsing w/ the inValidationMode(boolean) flag set, the db is not touched. The code just validates the XML's data content checking the users exist in the db, that the attributes and modules referenced already exit. A parse with the inValidationMode(boolean) set to false will do actual insert of the XML issues.

Version:
$Id: ScarabIssues.java 10257 2006-08-07 22:43:30Z jorgeuriarte $
Author:
Jon S. Stevens, Daniel Rall
See Also:
Serialized Form

Field Summary
(package private)  ImportErrors importErrors
          A record of any errors encountered during the import.
 
Constructor Summary
ScarabIssues()
           
 
Method Summary
 void addIssue(XmlIssue issue)
           
 void allowFileAttachments(boolean flag)
          Instances of this class will have their allowFileAttachments(boolean) flag set to this value upon instantiation.
(package private)  void doHandleDependencies()
           
(package private)  void doValidateDependencies()
           
(package private)  void doValidateUsers()
           
 java.util.Map getIDs()
           
 java.lang.String getImportType()
           
 int getImportTypeCode()
           
 java.util.List getIssues()
           
 XmlModule getModule()
           
 void inValidationMode(boolean flag)
           
 void setImportType(java.lang.String value)
           
 void setModule(XmlModule module)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

importErrors

ImportErrors importErrors
A record of any errors encountered during the import. Set by ImportIssues after an instance is created during XML parsing.

Constructor Detail

ScarabIssues

public ScarabIssues()
Method Detail

allowFileAttachments

public void allowFileAttachments(boolean flag)
Instances of this class will have their allowFileAttachments(boolean) flag set to this value upon instantiation. Current file attachment handling code has a security bug that can allow a user to see any file on the host that is readable by scarab. It is not easy to exploit this hole, and there are cases where we want to use the functionality and can be sure the hole is not being exploited. So adding a flag to allow file attachments under certain circumstances.


inValidationMode

public void inValidationMode(boolean flag)

setImportType

public void setImportType(java.lang.String value)

getImportType

public java.lang.String getImportType()

getImportTypeCode

public int getImportTypeCode()

getIDs

public java.util.Map getIDs()
Returns:
Map of original id -> new scarab id.

getModule

public XmlModule getModule()

setModule

public void setModule(XmlModule module)

doValidateUsers

void doValidateUsers()

doValidateDependencies

void doValidateDependencies()

doHandleDependencies

void doHandleDependencies()
                    throws ScarabException
Throws:
ScarabException

getIssues

public java.util.List getIssues()

addIssue

public void addIssue(XmlIssue issue)
              throws ScarabException
Throws:
ScarabException


Copyright © 2000-2004 Tigris.org. All Rights Reserved.