app_generators/rx_app/templates/mainapp.mxml in dima-restfulx-1.2.2 vs app_generators/rx_app/templates/mainapp.mxml in dima-restfulx-1.2.3
- old
+ new
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<mx:<%= application_tag %> xmlns:mx="http://www.adobe.com/2006/mxml"
- xmlns:generated="<%= base_package %>.components.generated.*"
+ xmlns:generated="<%= base_package %>.views.generated.*"
paddingBottom="8" paddingLeft="8" paddingRight="8" paddingTop="8"
layout="horizontal" styleName="plain" initialize="init()">
<mx:Script>
<![CDATA[
<% if use_air -%>
@@ -12,16 +12,17 @@
import org.restfulx.events.PullStartEvent;
import org.restfulx.events.PushEndEvent;
import org.restfulx.events.PushStartEvent;
import org.restfulx.controllers.ChangeController;
import org.restfulx.services.ISyncingServiceProvider;
- import org.restfulx.services.http.XMLHTTPServiceProvider;
<% end -%>
import org.restfulx.services.air.AIRServiceProvider;
<% end -%>
<% if use_gae -%>
import org.restfulx.services.http.GAEHTTPServiceProvider;
+<% else -%>
+ import org.restfulx.services.http.XMLHTTPServiceProvider;
<% end -%>
import org.restfulx.Rx;
import <%= base_package %>.controllers.<%= command_controller_name %>;
<% if use_air -%>
<% if distributed -%>
@@ -51,13 +52,19 @@
<% end -%>
<%= command_controller_name %>.initialize([AIRServiceProvider],
AIRServiceProvider.ID, "<%= base_package %>");
<% if distributed -%>
+<% if use_gae -%>
Rx.changes.setSyncProviders(
ISyncingServiceProvider(Rx.services.getServiceProvider(AIRServiceProvider.ID)),
+ Rx.services.getServiceProvider(GAEHTTPServiceProvider.ID));
+<% else -%>
+ Rx.changes.setSyncProviders(
+ ISyncingServiceProvider(Rx.services.getServiceProvider(AIRServiceProvider.ID)),
Rx.services.getServiceProvider(XMLHTTPServiceProvider.ID));
+<% end -%>
Rx.changes.addEventListener(PushStartEvent.ID, onPushStart);
Rx.changes.addEventListener(PushEndEvent.ID, onPushEnd);
Rx.changes.addEventListener(PullStartEvent.ID, onPullStart);
Rx.changes.addEventListener(PullEndEvent.ID, onPullEnd);
@@ -91,19 +98,28 @@
private function onNetworkStatusChange(event:StatusEvent):void {
online = (socketMonitor.available) ? true : false;
if (online) {
+<% if use_gae -%>
+ Rx.defaultServiceId = GAEHTTPServiceProvider.ID;
+<% else -%>
Rx.defaultServiceId = XMLHTTPServiceProvider.ID;
+<% end -%>
} else {
Rx.defaultServiceId = AIRServiceProvider.ID;
}
}
private function getCurrentProviderName(id:int):String {
switch (id) {
+<% if use_gae -%>
+ case GAEHTTPServiceProvider.ID:
+ return "GAE";
+<% else -%>
case XMLHTTPServiceProvider.ID:
- return "Rails";
+ return "XML/HTTP";
+<% end -%>
case AIRServiceProvider.ID:
return "AIR (SQLite)";
default :
return "No idea";
}