public class BuiltinRPC extends BuiltinRPC
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 |
---|---|
void | clearAttributes(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, java.util.Map properties) 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, java.util.Map properties) 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 attributes, java.lang.String prefix, HttpServletRequest req) Stores the supplied attributes on the server, in either request or session scope. |
appendToFile, deleteFile, downloadClientContent, downloadClientExport, downloadWSDL, downloadZip, evalJava, getLogEntries, getLogNames, loadFile, loadSharedXML, ping, saveFile, saveSharedXML, uploadProgressCheck, xmlToJS
public static DataSource getDataSourceFromTable(java.lang.String tableName, java.lang.String serverType, java.lang.String dbName, java.lang.String ID, java.util.Map properties) 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 defaultID
- Optionally, the ID of the DataSource - if null, uses the tableNameproperties
- An optional Map of properties to apply to the derived DataSourcejava.lang.Exception
public static java.lang.String getDataSourceJSONFromTable(java.lang.String tableName, java.lang.String serverType, java.lang.String dbName, java.lang.String ID, java.util.Map properties) 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 defaultID
- Optionally, the ID of the DataSource - if null, uses the tableNameproperties
- An optional Map of properties to apply to the derived DataSourcejava.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 strategydbName
- Optionally, the name of the database - if null, uses the defaultincludeTables
- If true, includes tables in the returned listincludeViews
- If true, includes views in the returned listcatalog
- 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 strategydbName
- 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 strategydbName
- 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 attributes, java.lang.String prefix, HttpServletRequest req) throws java.lang.Exception
This method is used by the batchUploader to store uploadFormFields.
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(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