ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
com.adobe.mosaic.mxml 

Service  - AS3 ADEP Composite Application

Packagecom.adobe.mosaic.mxml
Classpublic class Service
InheritanceService Inheritance EventDispatcher Inheritance Object
Implements IMXMLObject

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

The Service mxml component represents an IService instance from the composite application catalog that can be used across components. Required to load a Service are the complementary MXML components from this same package: ServerSession, Application, and Catalog. Those components, once initialized and authenticated against the Experience Server instance, provide the means to load this Composite Application Framework Service. This Service component contains a reference to the IService using the serviceNode property.

View the examples

Related API Elements



Public Properties
 PropertyDefined By
  catalog : Catalog
The Service's composite application catalog component.
Service
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  library : String
The value of the library name.
Service
  loaded : Boolean
[read-only] Checks if the underlying IService is instantiated.
Service
  name : String
The name of the Experience Service.
Service
  serviceNode : IService
[read-only] The underlying Composite Application Framework SDK IService.
Service
  shell : IShell
The associated IShell that the Service belongs to.
Service
Public Methods
 MethodDefined By
  
Constructor.
Service
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
  
Implementation of IMXMLObject initialized.
Service
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
Makes a request to load the Service by the value of the name property from the associated Catalog, and then attempts to add the service to the associated IShell.
Service
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
  The addServiceEventFailure defines a failure notification of an attempt to load a Service.Service
  The addServiceEventSuccess defines a successful notification of loading a Service.Service
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
Property Detail

catalog

property
catalog:Catalog

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

The Service's composite application catalog component.



Implementation
    public function get catalog():Catalog
    public function set catalog(value:Catalog):void

Related API Elements

library

property 
library:String

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

The value of the library name.



Implementation
    public function get library():String
    public function set library(value:String):void

loaded

property 
loaded:Boolean  [read-only]

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

Checks if the underlying IService is instantiated.



Implementation
    public function get loaded():Boolean

name

property 
name:String

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

The name of the Experience Service.



Implementation
    public function get name():String
    public function set name(value:String):void

serviceNode

property 
serviceNode:IService  [read-only]

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

The underlying Composite Application Framework SDK IService.



Implementation
    public function get serviceNode():IService

Related API Elements

shell

property 
shell:IShell

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

The associated IShell that the Service belongs to.



Implementation
    public function get shell():IShell
    public function set shell(value:IShell):void

Related API Elements

Constructor Detail

Service

()Constructor
public function Service()

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

Constructor.

Method Detail

initialized

()method
public function initialized(document:Object, id:String):void

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

Implementation of IMXMLObject initialized.

Parameters

document:Object — The document
 
id:String — The mxml id

loadService

()method 
public function loadService():void

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

Makes a request to load the Service by the value of the name property from the associated Catalog, and then attempts to add the service to the associated IShell. Both Catalog and Shell are required, and if either one is missing a log message will be generated. If the state of the catalog is either CatalogConstants.STATE_UNINITIALIZED or not CatalogConstants.STATE_LOADED, an event listener is added to listen for a CatalogLoadEvent.SUCCESS, at which time the catalog is considered loaded and a call to loadService() is triggered then.

Event Detail

addServiceEventFailure

Event
Event Object Type: com.adobe.mosaic.om.events.​AddServiceEvent
property ​AddServiceEvent.type = com.adobe.mosaic.om.events.​AddServiceEvent.FAILURE

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

The addServiceEventFailure defines a failure notification of an attempt to load a Service.

addServiceEventSuccess

Event  
Event Object Type: com.adobe.mosaic.om.events.​AddServiceEvent
property ​AddServiceEvent.type = com.adobe.mosaic.om.events.​AddServiceEvent.SUCCESS

Language Version: ActionScript 3.0
Product Version: Adobe Digital Enterprise Platform Experience Services - Composite Application Framework 10
Runtime Versions: AIR 2.6, Flash Player 10.2

The addServiceEventSuccess defines a successful notification of loading a Service.

This example demonstrates the component declaration for Service, first showing the declarations for the ServerSession, Application, and Catalog components.
     
     <fx:Declarations>
             <mosaic:ServerSession id="myServer"
                                      openSessionEventSuccess="myServer_connectedHandler(event)" 
                                      openSessionEventFailure="myServer_faultHandler(event)"                              
                                      url="{_serverUrl}" />
             <mosaic:Application id="myApp"
                                    loadApplicationEventSuccess="myApp_loadApplicationEventSuccessHandler(event)"
                                    loadApplicationEventFailure="myApp_loadApplicationEventFailureHandler(event)">
                 <mosaic:catalogs>
                     <mosaic:Catalog id="sampleCatalog" 
                                        name="sample_catalog"
                                        catalogLoadEventSuccess="myCatalogSuccess(event)"
                                        catalogLoadEventFailure="myCatalogFail(event)"
                                        serverSession="{myServer}"/>
                 </mosaic:catalogs>
             </mosaic:Application>
                 <mosaic:Service id="myService" 
                                catalog="{sampleCatalog}"
                                    shell="{myApp.shell}"
                                library="MyDataService-Weather" 
                                name="WeatherService"/>
         </fx:Declarations>