ESRIA网络监视器是一个演示应用程序,在多个视图中显示网络上的设备。 三个视图分别为网络拓扑,设备类型和网格。 每个设备显示实时数据使用 LiveCycle 数据服务 ES,并且允许用户单击它的数据模块时显示更为详细的内容。 代替数据库的是服务器上含有布局和初始设备信息加载数据XML 文件。 实例中的这些数据是在服务器上随机生成的。
网络拓扑结果动态监控
查看节点中更为详细的数据
如果你希望了解更多关于这个案例的详细,可以下载源码导入FLEX3即可调试。
你需要做以下准备:
- 安装 LiveCycle 数据 Servcies ES。
- 解压缩的 LiveCycle 数据 Service ES 运行 Web 应用程序,内容。
- 将"/classes/"目录复制到 WEB-INF。
- 从下载文件上面指定将复制到 WEB-INF / FLEX / user_classes 的 Cairngorm.Swc 和 CairngormEnterprise.Swc /。
- 添加以下代码到 WEB-INF/flex/remoting-config.xml 的<service>标记后 。
<destination id="networkMonitor">
<properties>
<source>com.esria.samples.networkMonitor.NetworkMonitor</source>
</properties>
</destination>
- 接着添加以下代码到WEB-INF/flex/messaging-config.xml的<service>标记后 。
<default-channels>
<channel ref="my-rtmp"/>
</default-channels>
<destination id="feed">
<properties>
<network>
<session-timeout>0</session-timeout>
</network>
<server>
<max-cache-size>1000</max-cache-size>
<message-time-to-live>0</message-time-to-live>
<durable>false</durable>
</server>
</properties>
</destination>
- 启动 Java 应用程序服务器。
- 打开http://localhost:{port}/{context-root}/main.mxml.
<?xml version="1.0" encoding="utf-8"?> <!-- The main application file for the NetworkMonitor app. --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:control="com.esria.samples.networkMonitor.control.*" xmlns:service="com.esria.samples.networkMonitor.business.*" xmlns:view="com.esria.samples.networkMonitor.view.*" backgroundColor="#FFFFFF" creationComplete="onCreationComplete()" width="978" height="790" backgroundImage="@Embed('assets/application_background.gif')" viewSourceURL="srcview/index.html"> <mx:Style source="assets/styles.css"/> <mx:Script> <![CDATA[ import com.adobe.cairngorm.control.CairngormEvent; import com.adobe.cairngorm.control.CairngormEventDispatcher; import com.adobe.viewsource.ViewSource; import com.esria.samples.networkMonitor.event.GetDevicesEvent; import com.esria.samples.networkMonitor.event.SubscribeToFeedEvent; import com.esria.samples.networkMonitor.model.NetworkMonitorModelLocator; import com.esria.samples.networkMonitor.view.StartFeedServerPopUp; import mx.binding.utils.BindingUtils; import mx.core.IFlexDisplayObject; import mx.managers.PopUpManager; private function onCreationComplete():void { // GetDevicesCommand is a sequence which checks the feed status after the device list is returned. BindingUtils.bindProperty(this, "feedRunning", NetworkMonitorModelLocator.getInstance().application, "feedRunning"); // Get the list of devices. In lieu of a database the data is stored in data/devices.xml. CairngormEventDispatcher.getInstance().dispatchEvent(new CairngormEvent(GetDevicesEvent.GET_DEVICES)); } // Triggered when feedRunning is updated in the networkMonitor model. public function set feedRunning(b:Boolean):void { if (!b) // If the feed is not running open the popup so the user can start it. { var popUp:IFlexDisplayObject = PopUpManager.createPopUp(this, StartFeedServerPopUp, true); PopUpManager.centerPopUp(popUp); } else { CairngormEventDispatcher.getInstance().dispatchEvent(new SubscribeToFeedEvent()); } } ]]> </mx:Script> <service:Services /> <control:NetworkMonitorController /> <view:ViewControlBar /> <view:DeviceView /> <view:Detail /> <mx:TraceTarget level="0" /> </mx:Application>
下载案例源码
down/source/NetworkMonitor.zip
案例在线体验
http://examples.adobe.com/flex3/devnet/networkmonitor/main.html
源自:AIRIA.CN