Escolar Documentos
Profissional Documentos
Cultura Documentos
cp;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Locale;
import java.util.Properties;
import java.util.Vector;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import oracle.apps.fnd.common.Log;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.cp.request.CpContext;
import oracle.apps.fnd.cp.request.JavaConcurrentProgram;
import oracle.apps.fnd.cp.request.LogFile;
import oracle.apps.fnd.cp.request.OutFile;
import oracle.apps.fnd.cp.request.RemoteFile;
import oracle.apps.fnd.cp.request.ReqCompletion;
import oracle.apps.fnd.cp.request.ReqDetails;
import oracle.apps.fnd.util.NameValueType;
import oracle.apps.fnd.util.ParameterList;
import oracle.apps.xdo.XDOException;
import oracle.apps.xdo.batch.BurstingProcessorEngine;
import oracle.apps.xdo.batch.bursting.DocumentStatus;
import oracle.apps.xdo.common.config.ConfigLocation;
import oracle.apps.xdo.common.config.ConfigReader;
import oracle.apps.xdo.common.log.Logger;
import oracle.apps.xdo.common.log.XDOLogImpl;
import oracle.apps.xdo.common.net.XDOStreamHandlerFactory;
import oracle.apps.xdo.oa.util.OAHelper;
import oracle.apps.xdo.oa.util.OAXDOLogImpl;
import oracle.jdbc.OracleCallableStatement;
import oracle.jdbc.OraclePreparedStatement;
import oracle.jdbc.OracleResultSet;
import oracle.sql.BLOB;
public JCP4XDOBurstingEngine() {}
try
{
tempDir = getSystemTempDirectory();
mJConn = paramCpContext.getJDBCConnection();
ParameterList localParameterList = paramCpContext.getParameterList();
while (localParameterList.hasMoreElements())
{
localObject6 = localParameterList.nextParameter();
localProperties.put("user-variable:cp:" +
((NameValueType)localObject6).getName(), ((NameValueType)localObject6).getValue());
if (((NameValueType)localObject6).getName().equals("ReportRequestID"))
{
i = Integer.parseInt(((NameValueType)localObject6).getValue());
}
else if (((NameValueType)localObject6).getName().equals("DebugFlag"))
{
str3 = ((NameValueType)localObject6).getValue();
}
}
debug = (str3.equals("Y"));
if (debug) {
lfile.writeln("Request ID: " + j, 1);
lfile.writeln("All Parameters: " + localParameterList.getString(), 1);
lfile.writeln("Report Req ID: " + i, 1);
lfile.writeln("Debug Flag: " + str3, 1);
}
OracleCallableStatement localOracleCallableStatement =
(OracleCallableStatement)mJConn.prepareCall((String)localObject6);
localOracleCallableStatement.setInt(1, i);
localOracleCallableStatement.setInt(2, j);
localOracleCallableStatement.execute();
localOracleCallableStatement.close();
mJConn.commit();
OraclePreparedStatement localOraclePreparedStatement =
(OraclePreparedStatement)mJConn.prepareStatement((String)localObject6);
localOraclePreparedStatement.setInt(1, i);
OracleResultSet localOracleResultSet =
(OracleResultSet)localOraclePreparedStatement.executeQuery();
localOracleResultSet.next();
String str5 = localOracleResultSet.getString(1);
String str6 = localOracleResultSet.getString(2);
String str7 = localOracleResultSet.getString(3);
localProperties.put("user-variable:cp:reportdescription", str7);
localProperties.put("user-variable:cp:parent_request_id",
Integer.toString(i));
localOracleResultSet.close();
localOraclePreparedStatement.close();
if (localInputStream == null)
{
localReqCompletion.setCompletion(2, "Error has occured while accessing
control file..");
XDOStreamHandlerFactory.registerNewProtocols();
localBurstingProcessorEngine.setTempDirectory(tempDir);
localBurstingProcessorEngine.setXMLAPI(localInputStream);
localBurstingProcessorEngine.setData(str9);
localProperties.put("burstng-source", "EBS");
set_OA_MEDIA_Property(localProperties);
AddCoreProperties(localProperties);
Logger.setLevel(1);
}
catch (Exception localException3) {
lfile.writeln("Error during initiating the XDO log...", 1);
Logger.init();
Logger.setLevel(1);
}
}
status = localBurstingProcessorEngine.process();
localBurstingStatusReport.generate();
localInputStream.close();
if (burstingStatus) {
localReqCompletion.setCompletion(0, "Request Completed Normal");
} else {
localReqCompletion.setCompletion(2, "");
}
}
catch (SQLException localSQLException)
{
lfile.writeln("--SQLException", 1);
lfile.writeln(getErrorStack(localSQLException), 1);
localReqCompletion.setCompletion(2, localSQLException.getMessage());
}
catch (XDOException localXDOException)
{
lfile.writeln("--XDOException", 1);
lfile.writeln(getErrorStack(localXDOException), 1);
localReqCompletion.setCompletion(2, localXDOException.getMessage());
}
catch (Exception localException2)
{
lfile.writeln("--Exception", 1);
lfile.writeln(localException2.getMessage(), 1);
lfile.writeln(getErrorStack(localException2), 1);
localReqCompletion.setCompletion(2, localException2.getMessage());
}
finally
{
paramCpContext.releaseJDBCConnection();
if (localBurstingProcessorEngine != null) {
localBurstingProcessorEngine.deletTemporaryOutputFiles();
}
}
}
return null;
}
localOracleCallableStatement =
(OracleCallableStatement)mJConn.prepareCall(str);
localOracleCallableStatement.setInt(1, paramInt);
OracleResultSet localOracleResultSet =
(OracleResultSet)localOracleCallableStatement.executeQuery();
if (localOracleResultSet.next())
{
localBLOB = localOracleResultSet.getBLOB(1);
}
localOracleCallableStatement.close();
} catch (SQLException localSQLException) { localSQLException =
localSQLException;throw localSQLException;
} finally {}
return localBLOB.getBinaryStream();
}
str = getDBTempDirectory();
return localProperties;
}
catch (Exception localException)
{
localException =
try
{
localOraclePreparedStatement =
(OraclePreparedStatement)ccntxt.getJDBCConnection().prepareStatement(str2);
localResultSet = localOraclePreparedStatement.executeQuery();
if (localResultSet.next()) {}
return localResultSet.getString(1);
}
catch (SQLException localSQLException)
{
Logger.log("--Error: Exception while querying for temp directory", 4);
}
finally
{
if (localResultSet != null)
{
try
{
localResultSet.close();
localResultSet = null;
}
catch (Exception localException5) {}
}
if (localOraclePreparedStatement != null)
{
try
{
localOraclePreparedStatement.close();
localOraclePreparedStatement = null;
}
catch (Exception localException6) {}
}
}
}
if (localHashtable.contains(str3)) {
lfile.writeln("Found duplicate file name " + str3, 1);
str3 = getAlternateFileName(localHashtable, str3);
lfile.writeln("-->File name renamed as " + str3, 1);
}
localHashtable.put(str3, str3);
localZipOutputStream.putNextEntry(new ZipEntry(str3));
readWrite(localFileInputStream, localZipOutputStream);
localZipOutputStream.closeEntry();
localFileInputStream.close();
localFileInputStream = null;
}
if (status.equals("success"))
burstingStatus = true;
}
localZipOutputStream.finish();
localZipOutputStream.flush();
return str2;
}
try
{
XDOStreamHandlerFactory.registerNewProtocols();
if (ccntxt != null)
{
localObject = ccntxt.getLog();
if (localObject != null)
{
Logger.setLog(new OAXDOLogImpl((Log)localObject));
}
}
OAHelper.setOASystemProperties(ccntxt);
paramProperties.put("user-variable.OA_MEDIA", localObject);
}
else
{
}
catch (Exception localException)
{
Logger.log(localException);
}
}