Good to know.  I will see if I can get the compiler to handle that correctly.  
I didn’t know that was a valid scenario.

From: Greg Dove <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Wednesday, February 5, 2020 at 7:33 PM
To: "[email protected]" <[email protected]>
Subject: Re: Cairngorm problem add remote object MXML.


There does not appear to be a default property, like an array to put the 
'children' in. I think it just creates the children as instances and makes sure 
they have id properties on the mxml-generated subclass that the instances are 
assigned to.

The services are then identified and categorised by iterating the accessors of 
the ServiceLocator subclass via reflection and checking their types and then 
registering them.
Although it is and mxml instance of ServiceLocator, it is also an enforced 
singleton which is accessed elsewhere from code. At least that is how it 
appears to be set up to me.

I already took a look at the code and have made (not many) local changes and 
have the Cairngorm swc compiling via maven for both js and swf. I have not 
tested it. Things like weak event listeners are gone.
The main issue I think will be the Event.ADDED and Event.REMOVED for ViewHelper 
automated register/unregister. Maybe we can have a CaingormViewBase class with 
support for these, or perhaps we can use the ADDED/REMOVED_FROM_STAGE emulation 
support that Crux uses, and that might be all that is needed, but it may not 
always work the same.

I'll try to tidy it up and share it tomorrow. The licence is BSD and is 
permissive 
(https://sourceforge.net/adobe/cairngorm/code/HEAD/tree/cairngorm/trunk/frameworks/cairngorm/License.txt<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fadobe%2Fcairngorm%2Fcode%2FHEAD%2Ftree%2Fcairngorm%2Ftrunk%2Fframeworks%2Fcairngorm%2FLicense.txt&data=02%7C01%7Caharui%40adobe.com%7C2fe18768c44f425da38508d7aab54b0c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637165567937202553&sdata=R%2BwcTLD56eWn4zeku2z6FNY2%2BSRQ2x0EBd0nM5sw38c%3D&reserved=0>)
 - It seems to be to be similar to others like MIT etc, but I don't know 
specifically what the rules are for Apache with that licence (in terms of 
possibility to include in Royale itself).





On Thu, Feb 6, 2020 at 3:40 PM De Carli Gustavo 
<[email protected]<mailto:[email protected]>> wrote:
Alex :

In flex use the swc. I am seeing the same thing that you are commenting, I do 
not understand where it assigns the remote objects to the ServiceLocator. This 
would have to be added to the "services" attribute of the RemoteObjects class. 
I will try to assign by code without using the mxml to see if it does not 
generate the error "null0".

El mié., 5 feb. 2020 a las 23:15, Alex Harui 
(<[email protected]<mailto:[email protected]>>) escribió:
I grabbed ServiceLocator.as and was able to produce the null0 problem, but the 
cause is that ServiceLocator does not have a default property.  Did your MXML 
work in Flex?  What ServiceLocator property would be assigned the 
mx:RemoteObject?

-Alex

From: De Carli Gustavo 
<[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, February 5, 2020 at 12:00 PM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: Cairngorm problem add remote object MXML.


I download 
https://sourceforge.net/adobe/cairngorm/code/<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsourceforge.net%2Fadobe%2Fcairngorm%2Fcode%2F&data=02%7C01%7Caharui%40adobe.com%7C2fe18768c44f425da38508d7aab54b0c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637165567937202553&sdata=L1iQGvIeKgs8iiPlYZufzLCVLOltWIc%2BVMne1oafoA8%3D&reserved=0>,
 and change.

import flash.utils.describeType;
   --> import org.apache.royale.reflection.describeType;

import flash.utils.Dictionary;
   --> import org.apache.royale.utils.ObjectMap;

And this method


/**

* Return all the accessors on this object.

* @param serviceLocator the IServiceLocator instance.

* @return this object's accessors.

*/

protected
function getAccessors(
serviceLocator : IServiceLocator ) :
XMLList

{

/*

var description : XML = describeType( serviceLocator );

var accessors : XMLList = description.accessor.( @access == "readwrite" ).@name;


return accessors;

*/


return describeType( serviceLocator).accessors(@access ==
"readwrite" ).@name;

}




El mié., 5 feb. 2020 a las 16:04, Alex Harui 
(<[email protected]<mailto:[email protected]>>) escribió:
Carlos, What Flash APIs is Cairngorm dependent on?

-Alex

From: Carlos Rovira <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, February 5, 2020 at 10:05 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Re: Cairngorm problem add remote object MXML.

Hi,

Cairngorm depends on Flash APIs, so make a Royale migration could be not easy, 
or requires some expertise.
You can use Crux instead that has support for Cairngorm style Commands. Crux is 
the same as Swiz Framework for Flex but rewritten to work in Royale, and 
supports much more like dependency injection, Inversion of control, event 
handling, ...
You have 3 examples in the examples/crux folder you can check.
I recommend you Crux over Cairngorm since Swiz was born to substitute Cairngorm


El mié., 5 feb. 2020 a las 18:24, De Carli Gustavo 
(<[email protected]<mailto:[email protected]>>) escribió:
Alex

<version>0.9.7-SNAPSHOT</version>

Thank

El mié., 5 feb. 2020 a las 14:02, Alex Harui 
(<[email protected]<mailto:[email protected]>>) escribió:
What version of the compiler are you using?

What does the ServiceLocator source look like?  It might be an issue with 
defaultProperties for non-DOM objects.

-Alex

From: De Carli Gustavo 
<[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Date: Wednesday, February 5, 2020 at 7:35 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: Cairngorm problem add remote object MXML.



I am trying to transcribe gairngorm, at runtime it gives me an error in the 
construction of the ServiceLocator, I understand that it is an error of the 
MXMLDataInterpreter. Anyone have any idea of the problem.
Thank
Gustavo.

1. CODE


<?xml version="1.0" encoding="utf-8"?>

<cairngorm:ServiceLocator
xmlns:fx="http://ns.adobe.com/mxml/2009<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.adobe.com%2Fmxml%2F2009&data=02%7C01%7Caharui%40adobe.com%7C2fe18768c44f425da38508d7aab54b0c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637165567937212548&sdata=psS7VZWb2xNnODeQYSokZCLQiX9fu3J2BbmoRY6L7zg%3D&reserved=0>"

xmlns:mx="library://ns.apache.org/royale/mx<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fns.apache.org%2Froyale%2Fmx&data=02%7C01%7Caharui%40adobe.com%7C2fe18768c44f425da38508d7aab54b0c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637165567937212548&sdata=T63L0FhYYuaAQgeWMGjPlj%2Bw70avYjxpGp4tY8JjXRI%3D&reserved=0>"

xmlns:cairngorm="com.adobe.cairngorm.business.*">


<mx:RemoteObject
id="srvSeguridades"

destination="seguridades"

result="event.token.resultHandler(event)"

fault="event.token.faultHandler(event)"

endpoint="http://localhost:8080/messagebroker/amf"/>


</cairngorm:ServiceLocator>






2. LINE OF ERROR (RED)
/

**
 * @constructor
 * @extends {com.adobe.cairngorm.business.ServiceLocator}
 */
services.Servicio = function() {
  services.Servicio.base(this, 'constructor');

  /**
   * @private
   * @type {mx.rpc.remoting.mxml.RemoteObject}
   */
  this.srvSeguridades_;

  /**
   * @private
   * @type {Array}
   */
  this.mxmldd;

  /**
   * @private
   * @type {Array}
   */
  this.mxmldp;

  this.generateMXMLAttributes
  ([1,
mx.rpc.remoting.mxml.RemoteObject,
3,
'id',
true,
'srvSeguridades',
'destination',
true,
'seguridades',
'endpoint',
true,
'http://localhost:8080/messagebroker/amf',
0,
2,
'result',
this.$EH0,
'fault',
this.$EH1,
null0,   <- ERROR
0
  ]);

};


3. Trace  console log

Servicio.js:61 Uncaught ReferenceError: null0 is not defined
    at new services.Servicio (Servicio.js:61)
    at Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray 
(MXMLDataInterpreter.js:126)
    at 
Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances 
(MXMLDataInterpreter.js:271)
    at main.Main.mx.core.UIComponent.createChildren (UIComponent.js:923)
    at main.Main.mx.core.Container.createChildren (Container.js:136)
    at main.Main.mx.core.Application.createChildren (Application.js:122)
    at main.Main.mx.core.UIComponent.initialize (UIComponent.js:871)
    at main.Main.mx.core.UIComponent.addedToParent (UIComponent.js:417)
    at main.Main.mx.core.Container.addedToParent (Container.js:123)
    at Main_mx_managers_SystemManager.org.apache.royale.core.UIBase.addElement 
(UIBase.js:402)


--
Carlos Rovira
http://about.me/carlosrovira<https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7C2fe18768c44f425da38508d7aab54b0c%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637165567937222548&sdata=acQ1VFcFmkdmF9xHudjSJqVOoOKeB2M2O1wREo0dA1g%3D&reserved=0>

Reply via email to