Straight from the AMFPHP code.

AMFSerializer.php (line ~346)
if(isset($d->_explicitType))
{
    $classname = $d->_explicitType;
    unset($d->_explicitType);
}

AMFPHP uses it on the Serialization side to set the classname and then
unset's the value.

Renaun

--- In [email protected], "Peter Farland" <[EMAIL PROTECTED]> wrote:
>
> Nope, AMFPHP must internally be doing this work for you (isn't it
the one that actually produces the AMF binary for the response and not
your code?).
>  
> Pete
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of Julian Sander
> Sent: Tuesday, October 17, 2006 11:35 AM
> To: [email protected]
> Subject: Re: [flexcoders] Re: VO Mapping, some basic questions
> 
> 
> Hi Peter,  
> 
> thanx for your insite.  It reafirms what I though was happening. 
None the less, I am curious how the mechanism works now.  In AmfPHP 
there is a wrapper that will convert a simple array to a RecordSet
called Arrayf.  Among other things it passes the _explicitType
property back.  I assume that AS 2, or the flash player then reads
that and casts the data to an instance of RecordSet.  It must be this
way as I have never written any parsing engines for returned data
using AmfPHP.  Should I assume that the Flash 9 player does this as
well, or more specificaly that the Flash VM for AS3 does this?
> 
> I get the feeling as if there is some very basic block of info I am
missing....
> 
> cheers, Julian 
> 
> 
> 
> Julian Sander
> Burbacherstraße 58
> 53129 Bonn
> 
> t/f     +49 228 21 27 15
> m      +49 172 250 6524
> 
> http://sander-is.com
> 
> 
>  
> 
> 
> On 17.10.2006, at 17:10, Peter Farland wrote:
> 
> 
>       
> 
>       Julian, remember that the client deserialization of AMF responses
is controlled by native code in the Flash Player - unless there is
specific handling code written in ActionScript to preprocess the
result before it is returned to you, the presence of _explicitType
would not cause a typed object to be created on the client automatically.
>        
>       I haven't seen the PHP code, but I would imagine that the presence
of an _explicitType property causes the serialized AMF object to the
include extra information for the class name in the binary definition
of the object... it is only through this mechanism that the native
code in the Flash Player will create a typed object for a registered
class on deserializing a response. Flex is built on top of
ActionScript so it too relies on the native deserialization behavior
of the Flash Player.
>        
>       The _explicitType property must be a way for PHP to allow untyped
PHP objects be returned as typed ActionScript objects (or perhaps also
an alias mechanism for those that possess type information already?).
Either way this is a copy of the _remoteClass property mechanism from
Flex 1.0/Flex 1.5 (though note this approach was abandonded in Flex 2.0).
>        
>        
> 
> ________________________________
> 
>       From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Julian Sander
>       Sent: Tuesday, October 17, 2006 3:41 AM
>       To: [email protected]
>       Subject: Re: [flexcoders] Re: VO Mapping, some basic questions
>       
>       
>       It seems like we are speaking right past eachother :)? It is not
the server side of the equation I am missing.? In the AMF0 payload the
parameter _explicitType is passed.? In AS2 I use Object.registerClass
to map the class writen as a String in _explicitType (ie
"com.renaun.samples.login.vo.BookVO" ) to a AS2 Class found
at?com.renaun.samples.login.vo.BookVO.? What I want to know is if the
parameter _explicitType works in Flex as well?
>       
>       
>       Cheers, Julian
> 
>       Julian Sander
>       Burbacherstra58ߥ 
>       53129 Bonn
> 
>       t/f ? ? +49 228 21 27 15
>       m? ? ? +49 172 250 6524
> 
>       http://abstractfactory.de <http://abstractfactory.de/> 
> 
> 
> 
>       
>       <438570115>
>       
> 
> 
> 
> 
>       On 17.10.2006, at 00:06, Renaun Erickson wrote:
> 
>       AMFPHP's _explicitType implementation is used to define it however you
>       want. So for my example of the BookVO, the php VO would look like:
>       
>       class BookVO {
>       public $_explicitType = "com.renaun.samples.login.vo.BookVO";
>       public $name;
>       public $bookid;
>       public $publishdate;
>       public $createddate;
>       
>       }
>       
>       And the PHP service class is:
>       
>       include "../vo/BookVO.php";
>       
>       class Login {
>       
>       function Login() {
>       $this->methodTable = array(
>       
>       "checkLogin" => array(
>       "description" => "Simple Login",
>       "access" => "remote",
>       "arguments" => array ()
>       )
>       
>       );
>       // Initialize db connection
>       }
>       
>       function checkLogin() {
>       $arr = array();
>       $book = new BookVO();
>       $book->name = "Adobe Flex 2: Training from the Source";
>       $book->bookid = "032142316X";
>       $book->publishdate = date( "F j, Y, g:i a", mktime(0, 0, 0, 8, 31,
>       2006) );
>       $arr[] = $book;
>       $book = new BookVO();
>       $book->name = "ActionScript 3.0 Cookbook : Solutions and Examples
>       for Flash Developers";
>       $book->bookid = "0596526954";
>       $book->publishdate = date( "F j, Y, g:i a", mktime(0, 0, 0, 9, 1,
>       2006) ); 
>       $arr[] = $book;
>       $book = new BookVO();
>       $book->name = "Programming Flex 2 : The Comprehensive Guide to
>       Creating Rich Media Applications with Adobe Flex";
>       $book->bookid = "059652689X";
>       $book->publishdate = date( "F j, Y, g:i a", mktime(0, 0, 0, 11, 1,
>       2006) );
>       $arr[] = $book; 
>       
>       return $arr;
>       }
>       
>       }
>       
>       Renaun
>       
>       --- In [EMAIL PROTECTED] <mailto:flexcoders%40yahoogroups.com>
ups.com, Julian Sander <dr.swank@> wrote:
>       >
>       > Hi Renaun,
>       > 
>       > thanx for the responce! I have gotten this far as well. What I am 
>       > not clear on is what is being passed int eh responce from the server 
>       > to Flex that makes the alias work? Is it still the _explicitType 
>       > property or is there something else?
>       > 
>       > cheers, Julian
>       > 
>       > Julian Sander
>       > Burbacherstraße 58
>       > 53129 Bonn
>       > 
>       > t/f +49 228 21 27 15
>       > m +49 172 250 6524
>       > 
>       > http://sander- <http://sander-is.com/> is.com
>       > 
>       > 
>       > 
>       > 
>       > On 16.10.2006, at 21:24, Renaun Erickson wrote:
>       > 
>       > > AMFPHP uses _excplicitType or advancedmappings.php to make mapping
>       > > easier. With PHP 5 there is some class introspection code that
makes
>       > > it possible to find the object mapping automacitally. Both SabreAMF
>       > > and WebORB for PHP supports the auto object mapping.
>       > >
>       > > As FDS and Coldfusion connectivity is based on Java it also is very
>       > > capable of class introspection and auto mapping.
>       > >
>       > > Basically the mapping as nothing to do with Flex.
>       > >
>       > > Now in regards to your question about Flex side of the VO mapping.
>       > > Here is a sample AS VO file I use in my WebORB for PHP example.
>       > >
>       > > package com.renaun.samples.login.vo
>       > > {
>       > >
>       > > import flash.net.registerClassAlias;
>       > >
>       > > [RemoteClass(alias="com.renaun.samples.login.vo.BookVO")]
>       > >
>       > > [Bindable]
>       > > public class BookVO
>       > > {
>       > > public var name : String;
>       > > public var bookid : String;
>       > > public var publishdate : String;
>       > > public var createddate : Date;
>       > >
>       > > }
>       > >
>       > > }
>       > >
>       > > You can even type the objects in ArrayCollections by this code:
>       > >
>       > > [Bindable]
>       > > [ArrayElementType("com.renaun.samples.vo.BookVO")]
>       > > private var books:ArrayCollection;
>       > >
>       > > Renaun
>       > >
>       > > --- In [EMAIL PROTECTED]
<mailto:flexcoders%40yahoogroups.com> ups.com, "dr.swank" <dr.swank@>
wrote:
>       > > >
>       > > > Hi List,
>       > > >
>       > > > I am working with CakePHP 1.2, CakeAMFPHP, and Flex2 SDK to
develop
>       > > a fairly complex
>       > > > community portal. I can't say too much due to client
restrictions,
>       > > so I will ask my
>       > > > questions is a very broad way.. :)
>       > > >
>       > > > I know that, in AMFPHP for AMF0 there was a var sent back to
Flash
>       > > called _excplicitType
>       > > > which, when used with Object.registerClass() would map the
reurned
>       > > value object to the
>       > > > appropriate class. I had all that working, so how it runs is
not a
>       > > problem. My issue comes
>       > > > up with AMF0 anf Flex2:
>       > > >
>       > > > 1. what is/are the flag/flags that Flex looks for to map returned
>       > > objects to their
>       > > > counterparts inside the FLex App?
>       > > >
>       > > > 2. Is Cairngorn the better way to deal with this issue?
>       > > >
>       > > > For those who are not familiar with CakePHP, it is a Data
Modeling
>       > > Framework ( well,
>       > > > among other things) which returns Models and assosiated
values. So
>       > > if a User had many
>       > > > Ariticles, then Cake would retun a User object which would
contain a
>       > > Article object
>       > > > containing all the articles for the User.
>       > > >
>       > > > Any hint, tips, etc would be greatly appritiated,
>       > > >
>       > > > cheers, Julian (aka drSwank)
>       > > >
>       > >
>       > >
>       > >
>       >
>





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to