All,
Thanks to Bob I was able to get custom functions to work properly within the application. What an awesome way to expand the abilities of an already robust application.
I do however still need a bit of guidance with custom processes.
I have a custom process that should open a pdf file stored locally (see code below). The issue I am running into is that every time the process is triggered I receive the following error message. "Process implementation component com.userguide.plugin is not found or has invalid format"
Here is the code for the process. I copied the process example from the Programmer's Reference and changed the execute procedure to open the pdf file.
package com.userguide.plugin;
import com.bas.basserver.executionengine.ExecutionException;
import com.bas.basserver.executionengine.IExecutionEngine;
import com.bas.basserver.executionengine.SuspendProcessException;
import com.bas.connectionserver.server.AccessDeniedException;
public class GuideClass {
public GuideClass()
{
}
//@see com.bas.basserver.executionengine.IProcess#cancel()
public boolean cancel()
{
return true;
}
//@see com.bas.basserver.executionengine.IProcess#execute(com.bas.basserver.exe cutionengine.IExecutionEngine, java.lang.Object[])
public Object execute (IExecutionEngine engine, Object [] parameters)
throws SuspendProcessException, ExecutionException, AccessDeniedException
{
try
{
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + "c:\\User Guide.pdf"); //open the file chart.pdf
return null;
}
catch (Exception e)
{}
return null;
}
//@see com.bas.basserver.executionengine.IProcess#resume(com.bas.basserver.executionengine.IExecutionEngine, java.lang.Object)
public Object resume (IExecutionEngine engine, Object reply)
throws SuspendProcessException, ExecutionException, AccessDeniedException
{
return null;
}
}
The jar file was assembled using the following convention.
Again, Thank you Bob.
The first line in AwarePlugin.java is: package com.sample.plugin;
This basically means that the program is in the following directory structure: com\sample\plugin.
To compile this, while in the parent directory of com, execute
c:\awareim\jdk\bin\javac -classpath c:\awareim\Tomcat\shared\lib\awareim.jar com/sample/plugin/AwarePlugin.java
c:\awareim\jdk\bin\javac is the java compiler that comes with aware. I use this to make sure it is compiled with the version of java aware expects.
-classpath c:\awareim\Tomcat\shared\lib\awareim.jar is pointing to some Aware functions that the program needs.
com/sample/plugin/AwarePlugin.java is the program being compiled.
To create the jar file, from the parent directory of com, execute
c:\sun\sdk\jdk\bin\jar cvf sample.jar com
c:\sun\sdk\jdk\bin\jar is where my version of jar.exe is located. jar.exe does not come with Aware so you have to use your own. It does not appear to matter what version of the jar.exe you use.
cvf sample.jar are options for jar.exe. c - create a new jar file. v - generate verbose output. f sample.jar - specifies the file name for the jar file.
com is the directory and all sub-directories to be put into the jar.
Within the configuration tool I created a process that simply has the Custom Software Component Radio button selected with a value of com.userguide.plugin
Thanks for any assistance.