Packagecom.esri.aws.services
Classpublic class ReportActivator
InheritanceReportActivator Inheritance BaseArcWebActivator Inheritance mx.core.UIComponent

ReportActivator registers an implementation of IReport to the Framework.

View the examples.

See also

IReport


Protected Methods
 MethodDefined by
  
This method must be overriden by the extending class to return an instance of an IArcWebService.
ReportActivator
  
getClassName():String
This method must be overriden by the extending class to return the fully qualified class name of the service to be registered.
ReportActivator
Method detail
createArcWebService()method
protected override function createArcWebService(useHTTPS:Boolean, arcwebHost:String):IArcWebService

This method must be overriden by the extending class to return an instance of an IArcWebService.

Parameters
useHTTPS:Boolean — the service created should use HTTPS.
 
arcwebHost:String — the service created should use this ArcWeb host.

Returns
IArcWebService — An instance of an IArcWebService.
getClassName()method 
protected override function getClassName():String

This method must be overriden by the extending class to return the fully qualified class name of the service to be registered.

Returns
String — The fully qualified class name of the service to be registered.
Examples
Basic_Report_getSiteReports
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:awx="http://www.arcwebservices.com/2007/awx"
    pageTitle="Basic Site Demographic Report"
    implements="mx.rpc.IResponder"
    creationComplete="onComplete()"
    >
    <mx:Script>
        <![CDATA[
            import com.esri.aws.awx.geom.GeoPoint;
            import com.esri.aws.osgi.framework.ServiceTracker;
            import com.esri.aws.osgi.framework.IServiceReference;
            import com.esri.aws.services.IReport;
            import com.esri.aws.services.ReportInfo;
            import com.esri.aws.services.ReportOptions;
            import com.esri.aws.services.Site;
            import flash.utils.getQualifiedClassName;
            import mx.collections.ArrayCollection;
            import mx.controls.Alert;
            import mx.rpc.IResponder;

            private var m_report:ReportInfo;
            private var reportTracker:ServiceTracker;
            
            private function onComplete():void
            {
                reportTracker = new ServiceTracker(Framework.getInstance().systemContext, getQualifiedClassName(IReport));
                reportTracker.open();                
            }

            private function getSiteReport():void
            {
                var reportService:IReport = reportTracker.getService() as IReport;
                
                if (reportService)
                {                    
                    var site:Site = new Site();
                    site.siteLocation = new GeoPoint(-117.18908, 34.055219);
                    site.ringRadii = [2];
                    site.ringUnits = "miles";
                    site.siteName = "Location #1";
                    var rOptions:ReportOptions = new ReportOptions;
                    rOptions.dataSource = "ArcWeb:ESRI.TapestryAreaProfile.US";
                    rOptions.reportFormat='pdf';
                    reportService.getSiteReports(site,[rOptions],false,this);
                    m_info.htmlText = "Creating report ...";
                }
            }
            public function result(data:Object):void
            {
                var reports:ArrayCollection = ArrayCollection(data);
                m_report = reports.getItemAt(0) as ReportInfo;
                m_info.htmlText = "Site report in " + m_report.reportFormat + " format using the '" + m_report.dataSource
                                + "' data source:<br><u><a href='" + m_report.reportURL + "'>" + m_report.reportURL + "</a></u>";
            }
            public function fault(info:Object):void
            {
                Alert.show(info.toString());
            }
        ]]>
    </mx:Script>
    <awx:Framework id="m_framework" apiKey="[MY-API-KEY]">
        <awx:ReportActivator/>
    </awx:Framework>
    <mx:Button click="getSiteReport()" label="Click to create a 2-mile site report" fontSize="14" />
    <mx:Text id="m_info" fontSize="14" text=" "/>
</mx:Application>