edu.cs.ai.kreator.scripting
Class KreatorScriptableObject

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by edu.cs.ai.kreator.scripting.KreatorScriptableObject
All Implemented Interfaces:
java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable

public class KreatorScriptableObject
extends org.mozilla.javascript.ScriptableObject

This JavaScript object encapsulates all KReator functionality.

Author:
Marc Finthammer, Kubi Mensah
See Also:
Serialized Form

Field Summary
static org.apache.log4j.Logger LOG
          The Constant LOG.
 java.lang.String testpub
           
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
KreatorScriptableObject(ConsolePane consolePane)
           
 
Method Summary
 void clear()
          Function to be called from JavaScript.
 java.lang.String generateData(java.lang.String knowledgebaseFileStr, java.lang.String outputFileStr, int number, boolean doNotOverwriteExisting, boolean doNotAddToProject, boolean openfile)
          Function to be called from JavaScript.
 java.lang.String getClassName()
           
 java.lang.Object getConfigOption(java.lang.String optionStr)
          Function to be called from JavaScript.
 java.lang.String getJsAllIds()
          Function to be called from JavaScript.
 java.lang.String getJsIds()
          Function to be called from JavaScript.
 java.lang.String getPwd()
          Function to be called from JavaScript.
 java.lang.String getTestprop()
          Function to be called from JavaScript.
 void help(java.lang.String s)
           
 void latex(java.lang.String fileName)
          Function to be called from JavaScript.
 java.lang.String learn(java.lang.String sampleFileStr, java.lang.String structureLearnerStr, java.lang.String parameterLearnerStr, java.lang.String outputFileStr, java.lang.String writerStr, boolean doNotOverwriteExisting, boolean doNotAddToProject, boolean doNotOpenFile)
          Function to be called from JavaScript.
 java.lang.String learnparameter(java.lang.String sampleFileStr, java.lang.String knowledgebaseFileStr, java.lang.String learnerStr, java.lang.String outputFileStr, java.lang.String writerStr, boolean doNotOverwriteExisting, boolean doNotAddToProject, boolean doNotOpenFile)
          Function to be called from JavaScript.
 java.lang.String learnstructure(java.lang.String sampleFileStr, java.lang.String learnerStr, java.lang.String outputFileStr, java.lang.String writerStr, boolean doNotOverwriteExisting, boolean doNotAddToProject, boolean doNotOpenFile)
          Function to be called from JavaScript.
 void multipleQuery(java.lang.Object kbFilesObj, java.lang.Object queryObj, boolean expToLatex, java.lang.Object evidenceObj)
          Function to be called from JavaScript.
 void print(java.lang.String message)
          Function to be called from JavaScript.
 void printkb(java.lang.Object kbObj)
          Function to be called from JavaScript.
 void println(java.lang.String message)
          Function to be called from JavaScript.
 void printo(java.lang.Object message)
          Function to be called from JavaScript.
 void printoln(java.lang.Object message)
          Function to be called from JavaScript.
 double query(java.lang.Object kbObj, java.lang.Object queryObj, java.lang.Object evidenceObj)
          Function to be called from JavaScript.
 void reset(java.lang.String message)
          Function to be called from JavaScript.
 void run(java.lang.String scriptName)
          Function to be called from JavaScript.
 void runnew(java.lang.String scriptName)
          Function to be called from JavaScript.
 void setConfigOption(java.lang.String optionStr, java.lang.String valueStr)
          Function to be called from JavaScript.
 void setTestprop(java.lang.String someProp)
          Function to be called from JavaScript.
 java.lang.String testme(java.lang.String str)
          Function to be called from JavaScript.
 void threadWaitOrAbort()
           
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isGetterOrSetter, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
The Constant LOG.


testpub

public java.lang.String testpub
Constructor Detail

KreatorScriptableObject

public KreatorScriptableObject(ConsolePane consolePane)
Method Detail

getClassName

public java.lang.String getClassName()
Specified by:
getClassName in interface org.mozilla.javascript.Scriptable
Specified by:
getClassName in class org.mozilla.javascript.ScriptableObject

print

public void print(java.lang.String message)
Function to be called from JavaScript. Description see hlp_message.txt.


println

public void println(java.lang.String message)
Function to be called from JavaScript. Description see hlp_message.txt.


printo

public void printo(java.lang.Object message)
Function to be called from JavaScript. Description see hlp_message.txt.


printoln

public void printoln(java.lang.Object message)
Function to be called from JavaScript. Description see hlp_message.txt.


printkb

public void printkb(java.lang.Object kbObj)
             throws KreatorScriptingException,
                    DataFileNotGeneratedException,
                    UnsupportedFileTypeException,
                    ParsingException,
                    java.io.IOException
Function to be called from JavaScript. Description see hlp_message.txt.

Throws:
KreatorScriptingException
UnsupportedFileTypeException
DataFileNotGeneratedException
java.io.IOException
ParsingException

multipleQuery

public void multipleQuery(java.lang.Object kbFilesObj,
                          java.lang.Object queryObj,
                          boolean expToLatex,
                          java.lang.Object evidenceObj)
                   throws KreatorScriptingException,
                          DataFileNotGeneratedException,
                          FileNotSavedException,
                          UnsupportedFileTypeException,
                          QueryException,
                          InvalidLanguageExpressionException,
                          AbortedQueryException,
                          ParsingException,
                          java.io.IOException
Function to be called from JavaScript. Description see hlp_message.txt.

Parameters:
kbFilesObj -
queryObj -
evidenceObj -
Throws:
KreatorScriptingException
DataFileNotGeneratedException
FileNotSavedException
UnsupportedFileTypeException
QueryException
InvalidLanguageExpressionException
AbortedQueryException
ParsingException
java.io.IOException

clear

public void clear()
Function to be called from JavaScript. Description see hlp_message.txt.


reset

public void reset(java.lang.String message)
Function to be called from JavaScript. Description see hlp_message.txt.


query

public double query(java.lang.Object kbObj,
                    java.lang.Object queryObj,
                    java.lang.Object evidenceObj)
             throws DataFileNotGeneratedException,
                    KreatorScriptingException,
                    FileNotSavedException,
                    QueryException,
                    InvalidLanguageExpressionException,
                    AbortedQueryException,
                    java.io.IOException,
                    UnsupportedFileTypeException,
                    ParsingException
Function to be called from JavaScript. Description see hlp_message.txt.

Throws:
DataFileNotGeneratedException
KreatorScriptingException
FileNotSavedException
QueryException
InvalidLanguageExpressionException
AbortedQueryException
java.io.IOException
UnsupportedFileTypeException
ParsingException

learnstructure

public java.lang.String learnstructure(java.lang.String sampleFileStr,
                                       java.lang.String learnerStr,
                                       java.lang.String outputFileStr,
                                       java.lang.String writerStr,
                                       boolean doNotOverwriteExisting,
                                       boolean doNotAddToProject,
                                       boolean doNotOpenFile)
                                throws java.lang.Exception
Function to be called from JavaScript. Description see hlp_message.txt.

Throws:
java.lang.Exception

learnparameter

public java.lang.String learnparameter(java.lang.String sampleFileStr,
                                       java.lang.String knowledgebaseFileStr,
                                       java.lang.String learnerStr,
                                       java.lang.String outputFileStr,
                                       java.lang.String writerStr,
                                       boolean doNotOverwriteExisting,
                                       boolean doNotAddToProject,
                                       boolean doNotOpenFile)
                                throws java.lang.Exception
Function to be called from JavaScript. Description see hlp_message.txt.

Throws:
java.lang.Exception

learn

public java.lang.String learn(java.lang.String sampleFileStr,
                              java.lang.String structureLearnerStr,
                              java.lang.String parameterLearnerStr,
                              java.lang.String outputFileStr,
                              java.lang.String writerStr,
                              boolean doNotOverwriteExisting,
                              boolean doNotAddToProject,
                              boolean doNotOpenFile)
                       throws java.lang.Exception
Function to be called from JavaScript. Description see hlp_message.txt.

Throws:
java.lang.Exception

generateData

public java.lang.String generateData(java.lang.String knowledgebaseFileStr,
                                     java.lang.String outputFileStr,
                                     int number,
                                     boolean doNotOverwriteExisting,
                                     boolean doNotAddToProject,
                                     boolean openfile)
                              throws DataFileNotGeneratedException,
                                     UnsupportedFileTypeException,
                                     FileNotSavedException,
                                     FileExistsException,
                                     ParsingException,
                                     java.io.IOException
Function to be called from JavaScript. Description see hlp_message.txt.

Throws:
UnsupportedFileTypeException
DataFileNotGeneratedException
java.io.IOException
ParsingException
FileExistsException
FileNotSavedException

getConfigOption

public java.lang.Object getConfigOption(java.lang.String optionStr)
Function to be called from JavaScript. Description see hlp_message.txt.


setConfigOption

public void setConfigOption(java.lang.String optionStr,
                            java.lang.String valueStr)
Function to be called from JavaScript. Description see hlp_message.txt.


run

public void run(java.lang.String scriptName)
         throws DataFileNotGeneratedException,
                KreatorScriptingException,
                UnsupportedFileTypeException
Function to be called from JavaScript. Description see hlp_message.txt.

Throws:
DataFileNotGeneratedException
KreatorScriptingException
UnsupportedFileTypeException

runnew

public void runnew(java.lang.String scriptName)
            throws DataFileNotGeneratedException,
                   KreatorScriptingException,
                   UnsupportedFileTypeException,
                   FileNotSavedException
Function to be called from JavaScript. Description see hlp_message.txt.

Throws:
FileNotSavedException
DataFileNotGeneratedException
KreatorScriptingException
UnsupportedFileTypeException

latex

public void latex(java.lang.String fileName)
           throws DataFileNotGeneratedException,
                  ParsingException,
                  java.io.IOException
Function to be called from JavaScript. Description see hlp_message.txt. TODO

Throws:
DataFileNotGeneratedException
ParsingException
java.io.IOException

testme

public java.lang.String testme(java.lang.String str)
Function to be called from JavaScript. Description see hlp_message.txt.


threadWaitOrAbort

public void threadWaitOrAbort()

help

public void help(java.lang.String s)

getPwd

public java.lang.String getPwd()
Function to be called from JavaScript. Description see hlp_message.txt.


getJsIds

public java.lang.String getJsIds()
Function to be called from JavaScript. Description see hlp_message.txt.


getJsAllIds

public java.lang.String getJsAllIds()
Function to be called from JavaScript. Description see hlp_message.txt.


getTestprop

public java.lang.String getTestprop()
Function to be called from JavaScript. Description see hlp_message.txt.


setTestprop

public void setTestprop(java.lang.String someProp)
Function to be called from JavaScript. Description see hlp_message.txt.