public class Reify
extends java.lang.Object
Reify OnSite
that allows
developers to create and manage Smart GWT screens and datasources. This is an internal only class - do not try
to use it directly in your applications. If you want to create visual tools similar to Reify, see the Dashboards & Tools framework overview
Note that in the Smart GWT SDK, this
class is only present to provide Reify
utility APIs, and is not an
instantiable widget. For example, you can call getMockDS()
to export a
DataSource
as XML-formatted values and metadata for importing into Reify to create a
MockDataSource
.
Reify overview and related methods
Constructor and Description |
---|
Reify() |
Modifier and Type | Method and Description |
---|---|
Record |
getCurrentTestUser()
Returns the current test user details as detailed by
Authentication.getUserSchema() . |
java.lang.String |
getCurrentTestUserId()
Returns the current test userId.
|
static void |
getMockDS(java.lang.String[] dsNames,
MockDSExportCallback callback,
MockDSExportSettings settings)
Exports or serializes the specified
DataSources using the provided settings. |
Record[] |
getTestUsers()
Returns the list of test users.
|
static void |
loadProject(java.lang.String projectNames,
LoadProjectCallback callback,
LoadProjectSettings settings)
Loads projects from the Reify server specified by
serverURL (or LoadProjectSettings.serverURL ) using the ProjectLoaderServlet , reachable at the relative path projectLoaderPath (or LoadProjectSettings.projectLoaderPath ) underneath the
server URL, and fires the given callback after the project has been cached. |
static void |
registerSkin(java.lang.String skinName,
java.lang.String skinURL)
Registers a custom skin so that it becomes available in Reify under the Project->Skins->Custom Skins menu.
|
static void |
setPassword(java.lang.String password)
Setter for
password . |
static void |
setProjectLoaderPath(java.lang.String path)
Setter for
projectLoaderPath . |
static void |
setServerURL(java.lang.String serverURL)
Setter for
serverURL . |
static void |
setUserName(java.lang.String userName)
Setter for
userName . |
static void |
showMockDS(java.lang.String[] dsNames,
MockDSExportCallback callback,
MockDSExportSettings settings)
Shows the result of running
getMockDS() in a modal window so it can
be copied and pasted as needed into Reify or elsewhere. |
public Record getCurrentTestUser()
Authentication.getUserSchema()
.public java.lang.String getCurrentTestUserId()
public Record[] getTestUsers()
public static void getMockDS(java.lang.String[] dsNames, MockDSExportCallback callback, MockDSExportSettings settings)
DataSources
using the provided settings.
The "reifyCSV" format
generates comma-separated
values to paste into the DataSource creation wizard in Reify
. The
use case for the other two formats is, if you have a Smart GWT application, and you plan to load MockDataSources
to enable people to add screens to your application using
Reify, you may want to test your application with the MockDataSources to ensure they have the right data to allow your
application to function (for example, that records in one MockDataSource that are related to another MockDataSource
match up). Similarly, you may want to test any custom classes that you upload to Reify in a standalone file using
MockDataSources
.
You can customize the settings
, such
as numRows
(or numLevels
for tree-DataSources) to keep the data volume
returned by the export low. When related DataSources are present, all related records will be included in the export,
even if numRows
is exceeded. If this is too much data, criteria
can be used to further restrict exported records.
Note that settings
supports an array of requestProperties
, so that you can provide unique
configuration for each DataSource being exported, rather than only global configuration.
Unless you need
programmatic or expert control over the settings, you will likely find it easier to use the "Reify Export" button in the
DataSources tab
. as when using that route, useful global and
per-DataSources settings can be configured in an intuitively-arranged popup dialog.
dsNames
- ID
s of the desired
DataSourcescallback
- called with the complete export or serializationsettings
- controls format and what records and metadata to includeshowMockDS(java.lang.String[], com.smartgwt.client.callbacks.MockDSExportCallback, com.smartgwt.client.util.MockDSExportSettings)
public static void loadProject(java.lang.String projectNames, LoadProjectCallback callback, LoadProjectSettings settings)
serverURL
(or LoadProjectSettings.serverURL
) using the ProjectLoaderServlet
, reachable at the relative path projectLoaderPath
(or LoadProjectSettings.projectLoaderPath
) underneath the
server URL, and fires the given callback after the project has been cached. When a project is loaded, all of its
DataSources and screens (except where explicitly overridden by settings) are also cached in the project. See RPCManager.loadProject()
for further details.
projectNames
- Comma-separated string containing the names of project(s) to load.callback
- Callback for notification of completion of project(s) loaded and screens
cached.settings
- Settings applicable to the loadProject operation.public static void registerSkin(java.lang.String skinName, java.lang.String skinURL)
same directory
as the
built-in skins, then a URL must be provided from which the skin can be loaded. Note that if the URL targets a separate machine or port, you must configure that machine to add CORS headers to any served font files referenced by the style sheet. Otherwise, the browser will report a 404 error for each font file and fail to load it.
skinName
- .
See Identifier
skinURL
- .
See URL
public static void setPassword(java.lang.String password)
password
.password
- public static void setProjectLoaderPath(java.lang.String path)
projectLoaderPath
.path
- public static void setServerURL(java.lang.String serverURL)
serverURL
.public static void setUserName(java.lang.String userName)
userName
.userName
- public static void showMockDS(java.lang.String[] dsNames, MockDSExportCallback callback, MockDSExportSettings settings)
getMockDS()
in a modal window so it can
be copied and pasted as needed into Reify
or elsewhere. Note that the callback is fired when the window is closed, not when it's populated.
dsNames
- ID
s of the desired
DataSourcescallback
- called with the complete export or serializationsettings
- controls format and what records and metadata to include