public class BuiltinRPC
You can control which methods are enabled by listing the enabled methods under the server.properties attribute RPCManager.enabledBuiltinMethods
. Additionally, you must set RPCManager.enableBuiltinRPCs: true
in server.properties to enable bulitin RPCs.
Modifier and Type | Field and Description |
---|---|
static java.lang.String | cssStylenameSuffix Accepts a List of formatted Record-data, exports it to the specified format and streams it back as a file with the specified fileName to the requester via content-disposition: attachment. |
Modifier and Type | Method and Description |
---|---|
static RPCResponse | appendToFile(java.lang.String path, java.lang.String data) Appends the supplied contents to a file under webroot. |
static RPCResponse | deleteFile(java.lang.String path) Deletes an arbitrary file under webRoot. |
static void | downloadClientContent(java.lang.String fileContents, java.lang.String fileName, java.lang.String mimeType, RPCManager rpc, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Accepts string content and streams it back as a file to the requester via content-disposition: attachment. |
static void | downloadWSDL(java.lang.String url, java.lang.String format, java.lang.String fileName, RPCManager rpc, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Loads a WSDL file from the specified URL, optionally translates it to SmartClient-compatible JS format and streams the file back to the requester via content-disposition: attachment. |
static RPCResponse | evalJava(java.lang.String javaCode, RequestContext context) This method is used by the "Evaluate Java" section of the Developer Console (in the Results tab). |
static java.util.List | getLogEntries(java.lang.String logName) Returns the contents of the specified log4j log. |
static java.util.List | getLogNames() Returns the list of available log4j log names. |
static RPCResponse | loadFile(java.lang.String path) Returns the contents of any file under webRoot as a String. |
static RPCResponse | loadSharedXML(java.lang.String type, java.lang.String ID) Load a DS, UI, or APP file from the standard search path. |
static RPCResponse | saveFile(java.lang.String path, java.lang.String data) Saves a file under webRoot with the supplied contents. |
static RPCResponse | saveSharedXML(java.lang.String type, java.lang.String ID, java.lang.String contents) Writes or overwrites a UI, DS or APP file with the provided contents. |
static RPCResponse | uploadProgressCheck(javax.servlet.http.HttpSession session, java.lang.String formID) Used by the FileUpload control to periodically check the progress of a file upload. |
static RPCResponse | xmlToJS(java.lang.String xmlString) Translates XML to JS in exactly the same fashion as done by the <isomorphicXML> JSP tag. |
public static java.lang.String cssStylenameSuffix
public static void downloadWSDL(java.lang.String url, java.lang.String format, java.lang.String fileName, RPCManager rpc, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
This method is used by the Download feature of the WSDL tab in the Developer Console.
url
- The URL from which to load the WSDL file. Can be relative or absolute.format
- Set to 'xml' to stream the file without translation to JS or 'js' to get translated output.fileName
- This method returns a stream with content-disposition: attachment. This argument specifies the default filename that will be shown to the user in the "save as" dialog that comes up in the browser.java.lang.Exception
public static void downloadClientContent(java.lang.String fileContents, java.lang.String fileName, java.lang.String mimeType, RPCManager rpc, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
This method is used by the Download feature of the DataSourceList in Visual Builder.
fileContents
- The string data to return in a file for saving.fileName
- This method returns a stream with content-disposition: attachment. This argument specifies the default filename that will be shown to the user in the "save as" dialog that comes up in the browser.mimeType
- The MIME type with which to save the fileContentsjava.lang.Exception
public static RPCResponse xmlToJS(java.lang.String xmlString) throws java.lang.Exception
This method is enabled by default in smartclientRuntime
xmlString
- String of XML to be translated to JS.java.lang.Exception
public static RPCResponse uploadProgressCheck(javax.servlet.http.HttpSession session, java.lang.String formID) throws java.lang.Exception
This method is enabled by default in smartclientRuntime
formID
- The ID of the form uploading the file.java.lang.Exception
public static RPCResponse deleteFile(java.lang.String path) throws java.lang.Exception
This method is used by the Visual Builder tool.
path
- file to delete, must be relative to webRoot.java.lang.Exception
public static RPCResponse saveFile(java.lang.String path, java.lang.String data) throws java.lang.Exception
This method is used by the Visual Builder tool.
path
- location of new file, must be relative to webRootdata
- contents of new filejava.lang.Exception
public static RPCResponse appendToFile(java.lang.String path, java.lang.String data) throws java.lang.Exception
path
- location of file, must be relative to webRootdata
- text to append to filejava.lang.Exception
public static RPCResponse loadFile(java.lang.String path) throws java.lang.Exception
This method is used by the Visual Builder tool.
path
- location of file to loadjava.lang.Exception
public static RPCResponse evalJava(java.lang.String javaCode, RequestContext context) throws java.lang.Exception
javaCode
- Arbitrary JSP content, java sections must be enclosed in standard Java escape tags (<% %>).java.lang.Exception
public static RPCResponse loadSharedXML(java.lang.String type, java.lang.String ID) throws java.lang.Exception
This method is used by the Visual Builder tool.
type
- UI or DS or APPID
- the ID of the file to loadjava.lang.Exception
public static RPCResponse saveSharedXML(java.lang.String type, java.lang.String ID, java.lang.String contents) throws java.lang.Exception
This method is used by the Visual Builder tool.
type
- UI or DS or APPID
- Specifies the base filename, .ui.xml or .ds.xml or .app.xml is automatically appended, based on the type.contents
- The contents of the file.java.lang.Exception
public static java.util.List getLogNames() throws java.lang.Exception
This method is used by the Server Logs tab of the Developer Console.
java.lang.Exception
public static java.util.List getLogEntries(java.lang.String logName) throws java.lang.Exception
This method is used by the Server Logs tab of the Developer Console.
logName
- The name of the log.java.lang.Exception