edu.internet2.middleware.grouper.xml.export
Class XmlExportMain

java.lang.Object
  extended by edu.internet2.middleware.grouper.xml.export.XmlExportMain

public class XmlExportMain
extends Object


Constructor Summary
XmlExportMain()
           
 
Method Summary
 XmlExportMain addObjectName(String objectName)
          add an object name to export e.g.
 XmlExportMain addStem(String stem)
          add a stem pattern e.g.
 void appendHqlStemLikeOrObjectEquals(StringBuilder queryBuilder, String aliasName, String fieldName, boolean forStemsOnly)
           
 boolean filterStemsOrObjects()
           
 Set<String> getAttributeAssignIds()
           
 Map<String,AttributeAssign> getAttributeAssignsForSecondPhase()
           
 Map<String,AttributeAssignValue> getAttributeAssignValuesForSecondPhase()
           
 Set<String> getObjectNames()
          get the object names filtering on
 Set<String> getStemNamePatterns()
          stem patterns to filter on, e.g.
 Set<String> getStems()
          stem patterns to filter on, e.g.
 void incrementRecordCount()
           
 void incrementRecordCount(int numberOfRecords)
          increment by an index
 boolean isIncludeAudits()
          if audits should be included
 boolean isIncludeComments()
          if comments should be included for foreign keys, note, this slows down the export
static void main(String[] args)
           
 void setIncludeAudits(boolean theIncludeAudits)
          include audits, default to true
 void setIncludeComments(boolean includeComments1)
          if comments should be included for foreign keys, note, this slows down the export
 void writeAllTables(File file)
           
 void writeAllTables(Writer writer, String fileName)
          write the xml to a writer
 void writeAllTablesGsh(Writer writer, String fileName)
          write the xml to a writer
 void writeGshScriptForSubject(String subjectId, String sourceId, String subjectVariableName, Writer writer, String errorVariable)
          write gsh script for subject, include error handling
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlExportMain

public XmlExportMain()
Method Detail

addStem

public XmlExportMain addStem(String stem)
add a stem pattern e.g. this:stem, that stem and all substems and objects will be exported

Parameters:
stem -
Returns:
this for chaining

addObjectName

public XmlExportMain addObjectName(String objectName)
add an object name to export e.g. this:stem or this:stem:group

Parameters:
objectName -
Returns:
this for chaining

getObjectNames

public Set<String> getObjectNames()
get the object names filtering on

Returns:
object names

getStems

public Set<String> getStems()
stem patterns to filter on, e.g. a:b or a:%

Returns:
stem patterns to filter on

getStemNamePatterns

public Set<String> getStemNamePatterns()
stem patterns to filter on, e.g. a:b or a:%. This will return a:b:% or a:%:%

Returns:
stem patterns to filter on

setIncludeAudits

public void setIncludeAudits(boolean theIncludeAudits)
include audits, default to true

Parameters:
theIncludeAudits -

isIncludeAudits

public boolean isIncludeAudits()
if audits should be included

Returns:
if audits should be included

isIncludeComments

public boolean isIncludeComments()
if comments should be included for foreign keys, note, this slows down the export

Returns:
the includeComments

setIncludeComments

public void setIncludeComments(boolean includeComments1)
if comments should be included for foreign keys, note, this slows down the export

Parameters:
includeComments1 - the includeComments to set

main

public static void main(String[] args)
                 throws Exception
Parameters:
args -
Throws:
Exception

incrementRecordCount

public void incrementRecordCount()

incrementRecordCount

public void incrementRecordCount(int numberOfRecords)
increment by an index

Parameters:
numberOfRecords -

writeAllTables

public void writeAllTables(File file)
Parameters:
file -

writeAllTablesGsh

public void writeAllTablesGsh(Writer writer,
                              String fileName)
write the xml to a writer

Parameters:
writer -
fileName - for logging

writeGshScriptForSubject

public void writeGshScriptForSubject(String subjectId,
                                     String sourceId,
                                     String subjectVariableName,
                                     Writer writer,
                                     String errorVariable)
                              throws IOException
write gsh script for subject, include error handling

Parameters:
subjectId -
sourceId -
subjectVariableName -
writer -
errorVariable - set to true if error if applicable
Throws:
IOException

writeAllTables

public void writeAllTables(Writer writer,
                           String fileName)
write the xml to a writer

Parameters:
writer -
fileName - for logging

getAttributeAssignIds

public Set<String> getAttributeAssignIds()
Returns:
the attributeAssignIds

getAttributeAssignsForSecondPhase

public Map<String,AttributeAssign> getAttributeAssignsForSecondPhase()
Returns:
the attributeAssignsForSecondPhase

getAttributeAssignValuesForSecondPhase

public Map<String,AttributeAssignValue> getAttributeAssignValuesForSecondPhase()
Returns:
the attributeAssignValuesForSecondPhase

filterStemsOrObjects

public boolean filterStemsOrObjects()
Returns:
filter

appendHqlStemLikeOrObjectEquals

public void appendHqlStemLikeOrObjectEquals(StringBuilder queryBuilder,
                                            String aliasName,
                                            String fieldName,
                                            boolean forStemsOnly)
Parameters:
queryBuilder -
aliasName -
fieldName -
forStemsOnly - this param doesnt matter right now. used to let you specify an exact folder, but might as well specify any exact object