Package edu.mit.simile.butterfly
Class ScriptableButterfly
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- edu.mit.simile.butterfly.ButterflyScriptableObject
-
- edu.mit.simile.butterfly.ScriptableButterfly
-
- All Implemented Interfaces:
Serializable,org.mozilla.javascript.ConstProperties,org.mozilla.javascript.debug.DebuggableObject,org.mozilla.javascript.Scriptable
public class ScriptableButterfly extends ButterflyScriptableObject
This class represents the "butterfly" javascript object that is made available to the javascript controllers and allows the controller to interact with butterfly and invoke its operations.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger_jsLoggerprotected static org.slf4j.Logger_logger-
Fields inherited from class edu.mit.simile.butterfly.ButterflyScriptableObject
_module, _properties
-
-
Constructor Summary
Constructors Constructor Description ScriptableButterfly()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandidRespond()StringgetClassName()static StringgetName()StringjsFunction_getContextPath(Object request, boolean absolute)ButterflyMounterjsFunction_getMounter()MountPointjsFunction_getMountPoint()StringjsFunction_getProperty(String key, String defaultValue)StringjsFunction_getString(Object request)voidjsFunction_log(String message)ObjectjsFunction_makePath(String pathInfo, Object levels)voidjsFunction_redirect(Object request, Object response, String location)voidjsFunction_responded()voidjsFunction_sendBinary(Object request, Object response, String file, String mimeType)voidjsFunction_sendError(Object request, Object response, int code, String str)voidjsFunction_sendString(Object request, Object response, String str, String encoding, String mimeType)voidjsFunction_sendText(Object request, Object response, String file, String encoding, String mimeType, boolean absolute)voidjsFunction_sendTextFromTemplate(Object request, Object response, Object context, String template, String encoding, String mimeType, boolean absolute)voidjsFunction_sendWrappedText(Object request, Object response, String file, String encoding, String mimeType, String prologue, String epilogue, boolean absolute)voidjsFunction_sendXHtmlDocument(Object request, Object response, Object document, String encoding, String mimeType, boolean absolute)voidjsFunction_sendXmlDocument(Object request, Object response, Object document, String encoding, String mimeType, boolean absolute)static Map<String,String>jsToMap(Object o)static org.apache.velocity.VelocityContextjsToVelocity(Object o)-
Methods inherited from class edu.mit.simile.butterfly.ButterflyScriptableObject
destroy, init, unwrap, wrap
-
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
-
-
-
-
Method Detail
-
getName
public static String getName()
-
getClassName
public String getClassName()
- Specified by:
getClassNamein interfaceorg.mozilla.javascript.Scriptable- Specified by:
getClassNamein classButterflyScriptableObject
-
didRespond
public boolean didRespond()
-
jsFunction_redirect
public void jsFunction_redirect(Object request, Object response, String location) throws Exception
- Throws:
Exception
-
jsFunction_sendBinary
public void jsFunction_sendBinary(Object request, Object response, String file, String mimeType) throws Exception
- Throws:
Exception
-
jsFunction_sendText
public void jsFunction_sendText(Object request, Object response, String file, String encoding, String mimeType, boolean absolute) throws Exception
- Throws:
Exception
-
jsFunction_sendWrappedText
public void jsFunction_sendWrappedText(Object request, Object response, String file, String encoding, String mimeType, String prologue, String epilogue, boolean absolute) throws Exception
- Throws:
Exception
-
jsFunction_sendTextFromTemplate
public void jsFunction_sendTextFromTemplate(Object request, Object response, Object context, String template, String encoding, String mimeType, boolean absolute) throws Exception
- Throws:
Exception
-
jsFunction_sendXmlDocument
public void jsFunction_sendXmlDocument(Object request, Object response, Object document, String encoding, String mimeType, boolean absolute) throws Exception
- Throws:
Exception
-
jsFunction_sendXHtmlDocument
public void jsFunction_sendXHtmlDocument(Object request, Object response, Object document, String encoding, String mimeType, boolean absolute) throws Exception
- Throws:
Exception
-
jsFunction_log
public void jsFunction_log(String message)
-
jsFunction_makePath
public Object jsFunction_makePath(String pathInfo, Object levels) throws Exception
- Throws:
Exception
-
jsFunction_responded
public void jsFunction_responded()
-
jsFunction_sendString
public void jsFunction_sendString(Object request, Object response, String str, String encoding, String mimeType) throws Exception
- Throws:
Exception
-
jsFunction_sendError
public void jsFunction_sendError(Object request, Object response, int code, String str) throws Exception
- Throws:
Exception
-
jsFunction_getString
public String jsFunction_getString(Object request) throws Exception
- Throws:
Exception
-
jsFunction_getMountPoint
public MountPoint jsFunction_getMountPoint() throws Exception
- Throws:
Exception
-
jsFunction_getMounter
public ButterflyMounter jsFunction_getMounter() throws Exception
- Throws:
Exception
-
jsFunction_getProperty
public String jsFunction_getProperty(String key, String defaultValue) throws Exception
- Throws:
Exception
-
jsFunction_getContextPath
public String jsFunction_getContextPath(Object request, boolean absolute) throws Exception
- Throws:
Exception
-
jsToVelocity
public static org.apache.velocity.VelocityContext jsToVelocity(Object o)
-
-