public class BuiltinRPC extends 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.
cssStylenameSuffix
Modifier and Type | Method and Description |
---|---|
void | clearAttributes(javax.servlet.http.HttpSession session) Clears any attributes previously stored by the setAttributes method. |
static java.util.List | getBeanFields(java.lang.String className) Returns a list of fields derived from the properties of the passed-in JavaBean. |
static java.util.Map | getDatabaseProductNameAndVersion(java.lang.String serverType, java.lang.String dbName) Returns the product name and version of the database connected via Hibernate or the supplied dbName configuration (the default configuration if not supplied), depending on value of serverType |
static RPCResponse | getDataSourceConfigFromJavaClass(java.lang.String className) Returns a DataSource config Map for the Java class provided. |
static DataSource | getDataSourceFromHibernateMapping(java.lang.String entityName, java.lang.String ID) Returns a DataSource derived from the Hibernate entity provided. |
static DataSource | getDataSourceFromTable(java.lang.String tableName, java.lang.String serverType, java.lang.String dbName, java.lang.String ID) Returns a DataSource derived from the table provided. |
static java.lang.String | getDataSourceJSONFromHibernateMapping(java.lang.String entityName, java.lang.String ID) Returns the JSON representation of a DataSource derived from the entity provided. |
static java.lang.String | getDataSourceJSONFromTable(java.lang.String tableName, java.lang.String serverType, java.lang.String dbName, java.lang.String ID) Returns the JSON representation of a DataSource derived from the table provided. |
static java.util.List | getFieldsFromTable(java.lang.String tableName, java.lang.String schema, java.lang.String serverType, java.lang.String dbName) Returns a list of fields in the passed in table, with properties such as type and length inferred from the database metadata. |
static java.util.List | getHibernateBeans(java.util.List include, java.util.List exclude, boolean excludeNullMappings) Returns a list of classes currently mapped in Hibernate. |
static java.util.List | getTables(java.lang.String serverType, java.lang.String dbName, boolean includeTables, boolean includeViews, java.lang.String catalog, java.lang.String schema, java.util.List include, java.util.List exclude) Returns a list of table and/or view names |
static void | setAttributes(java.lang.String scope, java.lang.Object rawAttrs, java.lang.String prefix, javax.servlet.http.HttpServletRequest req) Stores the supplied attributes on the server, in either request or session scope. |
appendToFile, deleteFile, downloadClientContent, downloadWSDL, evalJava, getLogEntries, getLogNames, loadFile, loadSharedXML, saveFile, saveSharedXML, uploadProgressCheck, xmlToJS
public static DataSource getDataSourceFromTable(java.lang.String tableName, java.lang.String serverType, java.lang.String dbName, java.lang.String ID) throws java.lang.Exception
tableName
- The name of the table.[servertype]
- "sql" or "hibernate"[dbName]
- Optionally, the name of the database - if null, uses the defaultjava.lang.Exception
public static java.lang.String getDataSourceJSONFromTable(java.lang.String tableName, java.lang.String serverType, java.lang.String dbName, java.lang.String ID) throws java.lang.Exception
tableName
- The name of the table.[servertype]
- "sql" or "hibernate"[dbName]
- Optionally, the name of the database - if null, uses the defaultjava.lang.Exception
public static DataSource getDataSourceFromHibernateMapping(java.lang.String entityName, java.lang.String ID) throws java.lang.Exception
entityName
- The name of the Hibernate mapped entity.java.lang.Exception
public static java.lang.String getDataSourceJSONFromHibernateMapping(java.lang.String entityName, java.lang.String ID) throws java.lang.Exception
entityName
- The name of the Hibernate mapped entity.java.lang.Exception
public static java.util.List getTables(java.lang.String serverType, java.lang.String dbName, boolean includeTables, boolean includeViews, java.lang.String catalog, java.lang.String schema, java.util.List include, java.util.List exclude) throws java.lang.Exception
[serverType]
- "sql" or "hibernate", determines the database connection strategy[dbName]
- Optionally, the name of the database - if null, uses the default[includeTables]
- If true, includes tables in the returned list[includeViews]
- If true, includes views in the returned list[catalog]
- Optionally, the catalog name to use to restrict the list. If null, searches all catalogs.[schema]
- Optionally, the schema name to use to restrict the list. If null, searches all schemata.[include]
- Optionally, a list of partial table names to perform substring checking against. Tables will be included where the table name matches any of the supplied substrings. The matching is not case sensitive.[exclude]
- Optionally, a list of partial table names to perform substring checking against. Tables will be excluded where the table name matches any of the supplied substrings. The matching is not case sensitive. Note that if you specify both include and exclude criteria and they conflict (ie, according to the criteria you set, a table should be both included and excluded), exclude wins.java.lang.Exception
public static java.util.List getFieldsFromTable(java.lang.String tableName, java.lang.String schema, java.lang.String serverType, java.lang.String dbName) throws java.lang.Exception
tableName
- The name of the table.[schema]
- Optionally, the name of the database schema to use (not all databases require - or even recognize the concept of - a schema)[serverType]
- "sql" or "hibernate", determines the database connection strategy[dbName]
- Optionally, the name of the database if serverType is "sql". If null, uses the defaultjava.lang.Exception
public static java.util.List getBeanFields(java.lang.String className) throws java.lang.Exception
className
- The fully-qualified classname of the JavaBeanjava.lang.Exception
public static java.util.List getHibernateBeans(java.util.List include, java.util.List exclude, boolean excludeNullMappings) throws java.lang.Exception
[include]
- Optionally, a list of partial entity names to perform substring checking against. Entities will be included where the entity name matches any of the supplied substrings. The matching is not case sensitive.[exclude]
- Optionally, a list of partial entity names to perform substring checking against. Entities will be excluded where the table name matches any of the supplied substrings. The matching is not case sensitive. Note that if you specify both include and exclude criteria and they conflict (ie, according to the criteria you set, an entity should be both included and excluded), exclude wins.[excludeNullMappings]
- Excludes mappings with a null classname from the listjava.lang.Exception
public static java.util.Map getDatabaseProductNameAndVersion(java.lang.String serverType, java.lang.String dbName) throws java.lang.Exception
[serverType]
- "sql" or "hibernate", determines the database connection strategy[dbName]
- Optional name of the configuration to use, if serverType is "sql"java.lang.Exception
public static void setAttributes(java.lang.String scope, java.lang.Object rawAttrs, java.lang.String prefix, javax.servlet.http.HttpServletRequest req) throws java.lang.Exception
scope
- Either "request" or "session", indicates where SmartClient should store the passed attributesattributes
- A Map or List of Maps specifying the attributes. Each map should contain at least a name entry and a value entry. If you also supply a type, SmartClient will make a better attempt at storing your attributes as appropriate types (Integer, Boolean etc, rather than String)prefix
- String to prepend to field names before they are stored in the request or session. This provides a basic namespace facility, allowing you to avoid name collisions with existing session attributes. // // Example usage: if you pass an attribute called "someDate" and a prefix of "myFields_", your attribute will be available as "myFields_someDate"
java.lang.Exception
public void clearAttributes(javax.servlet.http.HttpSession session) throws java.lang.Exception
java.lang.Exception
public static RPCResponse getDataSourceConfigFromJavaClass(java.lang.String className) throws java.lang.Exception
className
- The name of the Java class.java.lang.Exception