log file writing [message #316166] |
Thu, 24 April 2008 00:55 |
myclassic
Messages: 136 Registered: December 2006 Location: Pakistan
|
Senior Member |
|
|
Dear Sir /Madam
I am writing a java class in Jdeveloper to compile my Developer10g Forms(.FMB) into Exe (.FMX).
I have more than 500 Forms to be Compiled.
It creates a log file(one Log file for one form) with it having .ERR extension in both cases(either it is successfully compiled and converted into .FMX or not)
I want to stop the log file (.Err) for the FORMS which are successfully compiled and exe(.FMX) is created.
I want to write single log file for the forms which have some problem and are not compiled or are not converted in exe(.FMX).
how it is possible in Jdeveloper.
please help me.
Regards.
|
|
|
Re: log file writing [message #316211 is a reply to message #316166] |
Thu, 24 April 2008 05:02 |
myclassic
Messages: 136 Registered: December 2006 Location: Pakistan
|
Senior Member |
|
|
Dear Fellows
I have found a solution to create a log file of your own.but it only can write the name of your module that is being either compiled or not.
to avoid creating log by the system is also provided but it works if your form name is exactly equal your module name in the form.
here it goes.......
but if u find some good solution then please post it......
//////////////Actual Code////////////
package mypackage1;
import com.sun.imageio.spi.FileImageInputStreamSpi;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import oracle.forms.jdapi.FormModule;
import oracle.forms.jdapi.Jdapi;
import oracle.forms.jdapi.JdapiIterator;
import oracle.forms.jdapi.JdapiModule;
public class CompileClass
{
//private BufferedWriter logFile;
public String ConnectString ;
public String log = "Comp.txt";
public String log1 = "UnComp.txt";
public String totalText = "";
public CompileClass()
{
ConnectString = "UserId/PassWord@String";
for (JdapiIterator modules = Jdapi.getModules() ; modules.hasNext() ; )
{
FormModule mod = (FormModule)(JdapiModule)modules.next();
Jdapi.connectToDatabase(ConnectString);
System.out.println(mod.getName());
if (log != null) {
try{
mod.compile();
totalText = mod.getName()+" Compiled\n";
BufferedWriter logFile = new BufferedWriter(new FileWriter(log, true));
logFile.write(totalText + "\n");
logFile.flush();
System.out.println(mod.getName()+"Compiled Successfully");
File bkup = new File(mod.getName().concat(".ERR"));
bkup.delete();
}
catch(Exception e)
{
try{ totalText = mod.getName()+" Found Some Errors\n";
BufferedWriter logFile = new BufferedWriter(new FileWriter(log1, true));
logFile.write(totalText + "\n");
logFile.flush();
System.out.println(e.toString());
File bkup = new File(mod.getName()+".ERR");
// System.out.println(bkup.getName());
bkup.delete();
}
catch(Exception f){
}
}
}
}
}
/**
*
* @param args
*/
public static void main(String[] args)
{
try {
for (int i=0 ; i < args.length ; i++ ) {
JdapiModule.openModule(args[i]);
// Jdapi.shutdown();
}
}
catch(Exception e)
{
System.out.println(e.toString());
Jdapi.shutdown();
}
CompileClass compileClass = new CompileClass();
}
}
|
|
|