DashboardTask Class
Provides functionality to retrieve dashboard results from an ArcGIS Data Reviewer for Server Dashboard REST resource. Dashboard results summarize default and custom (user-defined) fields in a reviewer workspace's REVTABLEMAIN and REVBATCHRUNTABLE tables. Summary values show the number of occurrences of a unique value in a field in these tables.
Constructor
DashboardTask
-
url
Parameters:
-
url
StringThe DataReviewerServer Server Object Extension (SOE) URL.
Example:
var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/"
var dashboardTask=new DashboardTask(url);
Item Index
Methods
Methods
createReviewerSession
()
Deferred
Creates a new Reviewer session. The Reviewer session stores results from check and batch job execution.
Returns:
getDashboardFieldNames
()
Deferred
Requests Dashboard results field names.
Returns:
getDashboardResults
-
fieldName
-
filters
Requests dashboard results by fieldName. fieldName can be any of the following:
- BATCHJOBCHECKGROUP
- CHECKTITLE
- FEATUREOBJECTCLASS
- LIFECYCLESTATUS
- SESSIONID
- SEVERITY
- SUBTYPE
You can also specify custom (user-defined) fields from REVTABLEMAIN for fieldName.
Parameters:
-
fieldName
StringField name for dashboard results. Use the getDashboardFieldNames function to get field names to use in this parameter.
-
filters
ReviewerFilters(optional) Instance of ReviewerFilters containing one or more filters used to narrow down dashboard results. Similar to a where clause. See ReviewerFilters.
Returns:
Example:
var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/"
var dashboardTask=new DashboardTask(url);
var deferred=dashboardTask.getDashboardResults("BATCHJOBCHECKGROUP");
//Deferred callback and errback function
deferred.then(function(response)
{
array.forEach(response.dashboardResult.fieldValues, function (item,i)
{
document.write("BATCHJOBCHECKGROUP Name: " + item);
document.write("<br/> Result count: " + response.dashboardResult.getCount(item));
document.write("<br/><br/>");
});
}, function(error){
document.write("Error ocurred: " + error.message);
});
getLifecycleStatusStrings
()
Deferred
Retrieves a list of localized life cycle status strings from the Reviewer workspace. Each Reviewer result stored in the Reviewer workspace has a life cycle status code that matches one of the strings returned from this method execution. Use these strings to replace the numeric code values when displaying a list of Reviewer results to the user.
Returns:
getReviewerSessions
()
Deferred
Returns an array of sessions in a Reviewer workspace. Access the array through either the deferred object or the onGetReviewerSessionsComplete event.
Returns:
Example:
var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/";
var dashboardTask=new DashboardTask(url);
var deferred=dashboardTask.getReviewerSessions();
deferred.then(function(response)
{
array.forEach(response.reviewerSessions, function(item,i)
{
document.write("Session name: " + item.sessionName);
document.write("<br/>Session Id: " + item.sessionId);
document.write("<br/>User name: " + item.userName);
document.write("<br/>Version name: " + item.versionName);
document.write("<br/>");
});
},
function(error)
{
document.write("Error occurred: " + error.message);
}
);
Events
onCreateReviewerSessionsComplete
Dispatched by createReviewerSession.
Event Payload:
-
response
Object
Contains:
onError
Event Payload:
-
error
Error
Example:
// connect to the onError event of the task
function onErrorHandler(error)
{
alert ("An error occurred. Error message = " +
error.message +" Error code = " +error.code);
}
onGetDashboardFieldNamesComplete
Dispatched by getDashboardFieldNames.
onGetDashboardResultsComplete
Dispatched by getDashboardResults.
Event Payload:
-
response
Object
Contains:- Instance of DashboardResult dashboardResult
onGetLifecycleStatusStringsComplete
Dispatched by getLifecycleStatusStrings.
onGetReviewerSessionsComplete
Dispatched by getReviewerSessions.
Event Payload:
-
response
Object
Contains: