1 21 22 package org.webdocwf.util.loader; 23 24 import java.util.Vector ; 25 26 import org.w3c.dom.Document ; 27 import org.webdocwf.util.loader.logging.Logger; 28 29 35 public class ImportDefinitionElement { 36 37 private Logger logger; 38 private LoaderJobAttrReader loaderJobReader; 39 private CounterColumns counterColumns; 40 41 String strImportDefinitionName = ""; 42 String strImportDefinitionTableName = ""; 43 int iImportDefinitionCommitCount; 44 String strImportDefinitionSelectStatement = ""; 46 String strRestartCounterTableName = ""; 47 String strRestartCounterImportDefinitionName = ""; 48 String strRestartCounterValue = ""; 49 boolean bRestartAutoCreate = false; 50 Vector vecRestartCounterSortColumn = new Vector (); 51 52 int iObjectID = 0; 53 int iObjectIDCT = 0; 54 String strObjectIDTableName = ""; 55 String strObjectIDColumnName = ""; 56 57 String strObjectIDNameColumnName = ""; 59 String strObjectIDNameColumnValue = ""; 60 61 boolean bObjectIDAutoCreate; 62 int iObjectIDStartValue; 63 int iCommitCount = 0; 65 66 String strOnErrorContinueXml=""; 68 String strDefaultCutOffData=""; 69 70 String strCopyTableName = ""; 73 String strCopyTableSourceTableName = ""; 74 String strCopyTableTargetTableName = ""; 75 String strCopyTableOidLogic="false"; 76 String strCopyTableOnErrorContinue=""; 77 78 String strCopyTableCommitCount; 79 int iCopyTableCommitCount; 80 81 String setFetchSizeID=""; 82 String setCursorNameID=""; 83 String setFetchSizeCT=""; 84 String setCursorNameCT=""; 85 86 87 97 public void importXMLFile (Document doc, int iJobNumber) throws NullPointerException , 98 Exception { 99 this.logger.write("full", "\timportXMLFile method is started."); 100 this.strOnErrorContinueXml=OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 102 "onErrorContinue", iJobNumber); 103 this.strDefaultCutOffData=OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 104 "dataCutOff", iJobNumber); 105 this.strImportDefinitionName = OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 107 "name", iJobNumber); 108 this.strImportDefinitionTableName = OctopusXMLUtil.importAttributeValue(doc, 110 "importDefinition", "tableName", iJobNumber); 111 String strCommitCount = OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 113 "commitCount", iJobNumber); 114 if (!strCommitCount.equals("")) 115 this.iImportDefinitionCommitCount = Integer.parseInt(strCommitCount); 116 else { 117 if (loaderJobReader.getLoaderJobCommitCount()!= 0){ 118 this.iImportDefinitionCommitCount = loaderJobReader.getLoaderJobCommitCount(); 119 }else{ 120 if(this.iCommitCount!=0) 121 this.iImportDefinitionCommitCount = this.iCommitCount; 122 else 123 this.iImportDefinitionCommitCount=loaderJobReader.getDefaultCommitCount(); 124 } 125 } 126 134 this.strCopyTableName=OctopusXMLUtil.importAttributeValue(doc, 135 "copyTable", "name", iJobNumber); 136 this.strCopyTableSourceTableName=OctopusXMLUtil.importAttributeValue(doc, 137 "copyTable", "sourceTableName", iJobNumber); 138 this.strCopyTableTargetTableName=OctopusXMLUtil.importAttributeValue(doc, 139 "copyTable", "targetTableName", iJobNumber); 140 this.strCopyTableOidLogic=OctopusXMLUtil.importAttributeValue(doc, 141 "copyTable", "oidLogic", iJobNumber); 142 this.strCopyTableOnErrorContinue=OctopusXMLUtil.importAttributeValue(doc, 143 "copyTable", "onErrorContinue", iJobNumber); 144 String strCopyTableCommitCount = OctopusXMLUtil.importAttributeValue(doc, "copyTable", 146 "commitCount", iJobNumber); 147 if (!strCopyTableCommitCount.equals("")){ 148 this.iCopyTableCommitCount = Integer.parseInt(strCopyTableCommitCount); 149 }else { 150 if (loaderJobReader.getLoaderJobCommitCount()!= 0){ 151 this.iCopyTableCommitCount = loaderJobReader.getLoaderJobCommitCount(); 152 }else{ 153 if(this.iCommitCount!=0) 154 this.iCopyTableCommitCount = this.iCommitCount; 155 else 156 this.iCopyTableCommitCount=loaderJobReader.getDefaultCommitCount(); 157 } 158 } 159 String strIncrementCT = OctopusXMLUtil.importAttributeValue(doc, 160 "copyTable", "objectIDIncrement", iJobNumber); 161 if (!strIncrementCT.equals("")) 162 this.iObjectIDCT = Integer.parseInt(strIncrementCT); 163 else 164 this.iObjectIDCT = loaderJobReader.getDefaultObjectIDIncrement(); 165 166 this.setFetchSizeID=OctopusXMLUtil.importAttributeValue(doc, 168 "importDefinition", "setFetchSize", iJobNumber); 169 if(this.setFetchSizeID.equalsIgnoreCase("")) 170 this.setFetchSizeID=this.loaderJobReader.getSetFetchSize(); 171 172 this.setCursorNameID=OctopusXMLUtil.importAttributeValue(doc, 173 "importDefinition", "setCursorName", iJobNumber); 174 if(this.setCursorNameID.equalsIgnoreCase("")) 175 this.setCursorNameID=this.loaderJobReader.getSetCursorName(); 176 177 178 this.setFetchSizeCT=OctopusXMLUtil.importAttributeValue(doc, 180 "copyTable", "setFetchSize", iJobNumber); 181 if(this.setFetchSizeCT.equalsIgnoreCase("")) 182 this.setFetchSizeCT=this.loaderJobReader.getSetFetchSize(); 183 184 this.setCursorNameCT=OctopusXMLUtil.importAttributeValue(doc, 185 "copyTable", "setCursorName", iJobNumber); 186 if(this.setCursorNameCT.equalsIgnoreCase("")) 187 this.setCursorNameCT=this.loaderJobReader.getSetFetchSize(); 188 189 190 198 this.strImportDefinitionSelectStatement = OctopusXMLUtil.importAttributeValue(doc, 200 "importDefinition", "selectStatement", iJobNumber); 201 String strIncrement = OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 203 "objectIDIncrement", iJobNumber); 204 if (!strIncrement.equals("")) 205 this.iObjectID = Integer.parseInt(strIncrement); 206 else 207 this.iObjectID = loaderJobReader.getDefaultObjectIDIncrement(); 208 this.strObjectIDTableName = OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 210 "objectIDTableName", iJobNumber); 211 if (this.strObjectIDTableName.equals("")) 212 this.strObjectIDTableName = loaderJobReader.getDefaultObjectIDTableName(); 213 this.strObjectIDColumnName = OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 215 "objectIDColumnName", iJobNumber); 216 if( this.strObjectIDColumnName.equals("") ) 217 this.strObjectIDColumnName = loaderJobReader.getDefaultObjectIDColumnName(); 218 219 this.strObjectIDNameColumnName= OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 221 "objectIDNameColumnName", iJobNumber); 222 this.strObjectIDNameColumnValue= OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 223 "objectIDNameColumnValue", iJobNumber); 224 225 if(this.strObjectIDNameColumnName.equals("")) { 226 this.strObjectIDNameColumnName = loaderJobReader.getDefaultObjectIDNameColumnName(); 227 } 228 if(this.strObjectIDNameColumnValue.equals("")) { 229 this.strObjectIDNameColumnValue = loaderJobReader.getDefaultObjectIDNameColumnValue(); 230 } 231 232 String strObjectIDAutoCreate = OctopusXMLUtil.importAttributeValue(doc, "importDefinition", 234 "objectIDAutoCreate", iJobNumber); 235 if (strObjectIDAutoCreate.equals("")) 236 this.bObjectIDAutoCreate = loaderJobReader.getDefaultObjectIDAutoCreate(); 237 else 238 this.bObjectIDAutoCreate = (new Boolean (strObjectIDAutoCreate)).booleanValue(); 239 if (this.bObjectIDAutoCreate == true) { 240 String strObjectIDStartValue = OctopusXMLUtil.importAttributeValue(doc, 241 "importDefinition", "objectIDStartValue", iJobNumber); 242 if (strObjectIDStartValue.equals("")) 243 this.iObjectIDStartValue = loaderJobReader.getDefaultObjectIDStartValue(); 244 else 245 this.iObjectIDStartValue = Integer.parseInt(strObjectIDStartValue); 246 } 247 String strReturnCode = OctopusXMLUtil.importAttributeValue(doc, 248 "importDefinition", "returnCode", iJobNumber); 249 if(!strReturnCode.equals("")) 250 ReturnCode.setErrorReturnCode(Integer.parseInt(strReturnCode)); 251 else 252 ReturnCode.setErrorReturnCode(ReturnCode.getDefaultErrorReturnCode()); 253 this.vecRestartCounterSortColumn = OctopusXMLUtil.importValue(doc, "sortColumn", 254 "entry", iJobNumber); 255 } 256 257 261 public void setLogger(Logger logger) { 262 this.logger = logger; 263 } 264 265 269 public void setLoaderJob(LoaderJobAttrReader loader) { 270 this.loaderJobReader = loader; 271 } 272 } | Popular Tags |