public class BuiltinRPC extends Base
You can control which methods are enabled by listing the enabled methods under the server.properties attribute RPCManager.enabledBuiltinMethods
.
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 | downloadClientExport(java.util.List records, java.lang.String exportAs, java.lang.String fileName, java.lang.String exportDisplay, java.util.Map settings, javax.servlet.http.HttpServletResponse response, RPCManager rpc, RPCRequest request) 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. |
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 void | downloadZip(java.util.Map settings, RPCManager rpc, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) This method is used by the Export Project feature in Visual Builder. |
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.Collection | 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 | ping() Convenience method for pinging the server to check whether it's alive. |
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, RPCRequest req) Translates XML to JS in exactly the same fashion as done by the <isomorphicXML> JSP tag. |
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 void downloadZip(java.util.Map settings, RPCManager rpc, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
settings
- data to exportjava.lang.Exception
public static RPCResponse xmlToJS(java.lang.String xmlString, RPCRequest req) 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 ping() throws java.lang.Exception
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.
You can use SKUploadSaveFile datasource for the purpose of saving files. This datasource uses saveFile method so be sure it is enabled in RPCManager.enabledBuiltinMethods property. You can upload files using the datasource with the help of add operation.
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.Collection 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
public static void downloadClientExport(java.util.List records, java.lang.String exportAs, java.lang.String fileName, java.lang.String exportDisplay, java.util.Map settings, javax.servlet.http.HttpServletResponse response, RPCManager rpc, RPCRequest request) throws java.lang.Exception
records
- The records to return in a file for saving.exportAs
- The export-format to convert the passed records intofileName
- If parameter exportDisplay is "download", 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.exportDisplay
- Should the content be exported to a file or a browser windowsettings
- Settings for the export. See DataBoundComponent.exportClientData
in the client-side documentation for detailsjava.lang.Exception