ArcGIS Data Reviewer API for JavaScript
Show:

DashboardTask Class

Extends _DRSBaseTask

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 String

    The DataReviewerServer Server Object Extension (SOE) URL.

Example:

            var url="http://localhost:6080/arcgis/rest/services/reviewer/MapServer/exts/DataReviewerServer/"
            var dashboardTask=new DashboardTask(url);        

Methods

createReviewerSession

() Deferred

Inherited from _DRSBaseTask:

Creates a new Reviewer session. The Reviewer session stores results from check and batch job execution.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds ReviewerSession.

getDashboardFieldNames

() Deferred

Requests Dashboard results field names.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an array of dashboard field names.

getDashboardResults

(
  • fieldName
  • filters
)
Deferred

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 String

    Field 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:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an instance of DashboardResult.

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

Inherited from _DRSBaseTask:

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:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an array of lifecyclestatus strings.

getReviewerSessions

() Deferred

Inherited from _DRSBaseTask:

Returns an array of sessions in a Reviewer workspace. Access the array through either the deferred object or the onGetReviewerSessionsComplete event.

Returns:

Deferred: Dojo object. The callback function in the deferred object will contain a response object that holds an array of ReviewerSession.

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

Inherited from _DRSBaseTask:

Dispatched by createReviewerSession.

Event Payload:

onError

Inherited from _DRSBaseTask:

Event Payload:

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.

Event Payload:

onGetDashboardResultsComplete

Dispatched by getDashboardResults.

Event Payload:

onGetLifecycleStatusStringsComplete

Inherited from _DRSBaseTask:

Dispatched by getLifecycleStatusStrings.

Event Payload:

  • response Object


    Contains:

    • Array lifecycleStatusStrings

onGetReviewerSessionsComplete

Inherited from _DRSBaseTask:

Dispatched by getReviewerSessions.

Event Payload: