Skip to main content

Home/ SoftwareEngineering/ Group items tagged actionscript3

Rss Feed Group items tagged

kuni katsuya

8. Type Conversions (Java ~ ActionScript3) - Confluence - 0 views

  • 8. Type Conversions (Java ~ ActionScript3)
  • 8. Type Conversions (Java ~ ActionScript3)
kuni katsuya

Interview of GraniteDS founders | RIAgora - 0 views

  • explained the origin of GraniteDS and the differences with LiveCycle Data Services
  • ActionScript3 reflection API
  • GraniteDS 2.2
  • ...8 more annotations...
  • JSR-303 (“Bean Validation”) ActionScript3 framework for form validation
  • validation framework is a specific adaptation of the JSR-303 (Bean Validation) specification to Flex: like its Java counterpart, it relies on validation annotations placed on bean properties and provides an engine API that lets you validate your forms without writing by hand a specific validator for each of your input fields
  • code generation tools provided by GraniteDS so that when you write your Java entity bean with validation annotations, they are automatically replicated in your ActionScript3 beans
  • problem with LCDS is mainly that it promotes a strict “client / server” architecture, with – roughly speaking – a heavy Flex client application connected to a server almost reduced to a database frontend
  • big majority of  these organizations use BlazeDS, a free and open-source subset of LCDS
  • need more advanced mechanisms than just Remoting start looking for open-source libraries to enable deeper integrations with the Java business layer, and GraniteDS is for sure the most popular project
  • “Flex Data Services” (now renamed to “Live Cycle Data Services”)
  • Flex Data Services seemed too “client-centric”
kuni katsuya

In Relation To...  Bean Validation for Flex developers - 0 views

  • Bean Validation for Flex developers
  • GraniteDS have added support for Bean Validation into their project and hence Bean Validation is usable by all Flex users
  • Because they do not run on the JVM, they basically have reimplemented the full specification in Flex: you can annotate your ActionScript3 objects with constraints: it supports all the standard constraints and you can write your own constraints you can execute the validation logic and retrieve the error report you can make use of most of the feature including advanced ones like groups, group sequence etc
  • ...3 more annotations...
  • for GraniteDS users keeping their Java domain model and ActionScript3 domain model in sync via Gas3, the constraints are kept in sync
  • a couple of gotchas to be aware of
  • the constraint implementation is in the same class as the constraint declaration (not a problem in a dynamic language) @Pattern has a sightly different semantic because the regexp engine in Flex is a bit different. instead of the features provided by ConstraintValidatorContext, you can define a properties attribute in your constraints to make it belong to several sub-properties. not as flexible but good enough in many cases.
kuni katsuya

Getting started with the Facebook SDK and ActionScript 3 | Adobe Developer Connection - 0 views

  • Getting started with the Facebook SDK and ActionScript 3
  • invoke the Facebook API to login as well as to get details about the user, friends, photos, and other information
  • perform such tasks via the Facebook Graph API
  • ...3 more annotations...
  • JavaScript SDK with ActionScript 3
  • FB.init – initialize Facebook API FB.login - login to Facebook FB.api - perform a Graph API call on Facebook
  • Facebook JavaScript API calls:
kuni katsuya

8. Type Conversions (Java ~ ActionScript3) - Confluence - 0 views

  • Type conversions in GDS follow the standards defined in Adobe documentation
  • here,
  • GDS will neither convert AS3 String to Java numeric types or boolean, nor AS3 numeric types or boolean to String
  • ...3 more annotations...
  • AS3 Date
  • deserialized as java.util.Date
  • with one important exception:
kuni katsuya

Chapter 5. AS3 Code Generator - 0 views

  • AS3 Code Generator
  • GraniteDS comes with an ActionScript3 code generator that writes AS3 beans for all Java beans
  • ActionScript 3 generator is able to write AS3 typed client proxies for exposed remote services
  • ...6 more annotations...
  • Gas3 may also replicate validation annotations in order to use the Flex side validation framework
  • implemented as an Eclipse plugin
  • Ant task.
  • Maven Plugin (Flexmojos)
  • flexmojos-maven-plugin
  • org.sonatype.flexmojos
kuni katsuya

10. MXML & AS3 Web Compiler - Confluence - 0 views

  • GraniteDS comes with a powerful MXML/ActionScript3 compiler you may deploy in your servlet container. This servlet will compile your MXML code on the fly each time you have modified it and return a SWF
  • download the graniteds-webcompiler-***.zip bundle on SourceForge.
    • kuni katsuya
kuni katsuya

3. Gas3 Code Generator - Confluence - 0 views

  • 3. Gas3 Code Generator
  • Known Limitations
  • Gas3 does not support inner classes
  • ...26 more annotations...
  • except of enum type
    • kuni katsuya
       
      not quite sure what this means...
  • must declare your classes in separated source files if you want them to be correctly handled by the generator
  • Java enums
  • enum.gsp
  • JPA entity beans
  • entity.gsp
  • Java interfaces
  • interface.gsp
  • Java services
  • remote.gsp
  • Java events
  • bean.gsp
  • All other Java classes
  • bean.gsp
  • beanBase.gsp
  • beanBase.gsp
  • remoteBase.gsp, or tideRemoteBase.gsp
  • entityBase.gsp, or tideEntityBase.gsp
  • @Entity
  • @MappedSuperclass
  • @RemoteDestination
  • @TideEvent
  • templates are bundled in the granite-generator.jar
  • accessible as resources via the class loader
  • GraniteDS comes with an ActionScript3 code generator that writes AS3 beans for all externalized JavaBeans, with specific support for lazily loaded EJB 3 entities
  • 3. Gas3 Code Generator
kuni katsuya

GraniteDS: Gas3 template for complex enums | Javalobby - 0 views

  • GraniteDS: Gas3 template for complex enums
  • changed enum.gsp from class:org/granite/generator/template/enum.gsp
  • I posted  a new version on github (master-branch) that
  • ...3 more annotations...
  • works with GraniteDS 3.0.0. 
  • https://github.com/graniteds/graniteds_builder 
  • fixed and committed to github
kuni katsuya

5. Exception Handling - Confluence - 0 views

  • Exception Handling
  • 5. Exception Handling
  • server exceptions
  • ...41 more annotations...
  • can be handled on the
  • client-side
  • by defining a
  • fault callback
  • each remote call
  • very tedious
  • possible to define common handlers for particular fault codes on the client-side, and exception converters on the server-side, to convert server exceptions to common fault codes
  • define an
  • ExceptionConverter
  • class
  • Converter
  • ExceptionConverter
  • accepts(Throwable t, Throwable finalException)
  • convert( Throwable t, String detail, Map<String, Object> extendedData)
  • t.getMessage(), detail, t
    • kuni katsuya
       
      * instead of *wrapping* the server-side exception and rethrowing it to the client, ** extract only details relevant to the client (eg. include: human-friendly error message and any helpful parametrized data, exclude: stack traces), ** "wrap" it in a generic ServiceException, which gets "thrown" remotely to the client * client can check ServiceException.getCode() to implement behavior tailored to server-side exception 'type'
  • ENTITY_NOT_FOUND
    • kuni katsuya
       
      ENTITY_NOT_FOUND - 'fault code' understood by client
  • This class will
  • intercept
  • all EntityNotFound exceptions on the server-side, and convert it to a proper ENTITY_NOT_FOUND fault event.
  • exception converter has to be
  • declared on the GDS server config :
  • scan="true" in granite-config.xml
  • META-INF/granite-config.properties
  • in the jar containing the exception converter class
  • granite-config.xml
  • <exception-converters> <exception-converter type="com.package.SomeExceptionConverter"/> </exception-converters>
  • Flex side
  • Handler
  • Handler
  • IExceptionHandler
    • kuni katsuya
       
      **I**ExceptionHandler??? really?  ;)
  • accepts(emsg:ErrorMessage)
  • handle(context:BaseContext, emsg:ErrorMessage)
  • register it as an exception handler for the
  • Tide context
  • in a static initializer block to be sure it is
  • registered before anything else happens.
  • addExceptionHandler(EntityNotFoundExceptionHandler);
  • ExceptionConverter
  • 5. Exception Handling
  • 5. Exception Handling
  • 5. Exception Handling
kuni katsuya

Chapter 12. ActionScript 3 Reflection API - 0 views

  •  ActionScript 3 Reflection API
  • describeType
  • method returns
  • ...5 more annotations...
  • XML data
    • kuni katsuya
       
      why gawd, whhhhhhhhhyyy...
  • describing its parameter object and is therefore not type-safe and its use is subject to many syntax errors.
  • GraniteDS provides a Java-like reflection API that encapsulates describeType calls and offers a type-safe, object-oriented, set of reflection classes and methods
  • caches its results for better performance
  • supports advanced features such as ApplicationDomain and namespaces
kuni katsuya

Remote call using class as parameter - Google Groups - 0 views

  • public class ClassHolderDTO<T> {    private Class<T> classToTransfer;// get/set boilerplate}
  • Resource
  • Class<Resource> entityClass
  • ...18 more annotations...
  • Class as parameter
  • serverside
  • Remote call using class as parameter
  • Does GraniteDS could manage date and TimeZone ?
  • Flash Player (GMT +X) -> IExternizable methods (GMT + X - X = GMT + 0) - > AMF over HTTP (GMT + 0) -> Granite AMF0Deserializer (GMT + 0) -> Granite Converter (GMT + 0 + Y = GMT + Y) -> Java Services (GMT + Y)Java Services (GMT + Y) -> Granite Converter (GMT + Y - Y = GMT + 0) -> Granite AMF0Deserializer (GMT + 0) -> AMF over HTTP (GMT + 0) -> IExternizable methods (GMT + 0 + X = GMT + X) -> Flash Player (GMT + X)
  • We use
  • GMT + 0
  • for AMF for convention
  • define a
  • fixed timezone
  • for your AMF that is over HTTP
  • GMT + X
  • : timezone for your flex client
  • GMT + Y
  • : timezone for your server
  • don't want to modify the default templates
  • override the readExternal / writeExternal methods and do the conversion here.
  • The patch is to use a custom template for generating your as files with a conversion to GMT 0 in the implementations of IExternalizable methods.On the server-side you add a Converter to convert dates GMT 0 to dates GMT + Y.
    • kuni katsuya
       
      see better suggestion below (ie. override instead of replace)
kuni katsuya

Chapter 5. AS3 Code Generator - 0 views

  • 5.2. Generated ActionScript 3 Classes
  • Gas3 uses the principle of "Base" and customizable inherited classes that let you add methods to generated classes without facing the risk of losing them when a new generation process is executed
  • 5.3. Java Classes and Corresponding Templates
  • ...13 more annotations...
  • summary of templates used by the generator depending on the kind of Java class it encounters:
  • these templates are bundled in the granite-generator.jar archive, in the org.granite.generator.template package and accessible as resources via the class loader
  • class: protocol is used because all standard templates are available in the classpath
  • Alternatively, you may use the file: protocol to load your template from the filesystem. These templates can be specified either by using absolute paths (eg. file:/absolute/path/to/mytemplate.gsp) or paths relative to your current Eclipse project root directory (eg. path/to/mytemplate.gsp).
  • ActionScript 3 generator is able to write AS3 typed client proxies for exposed remote services
  • Compared to the usual Flex RemoteObject, this can greatly help development by bringing
  • auto-completion
  • improved type-safety
  • in Flex when using remote services.
  • replicate validation annotations in order to use the Flex side validation framework
  •  Known Limitations
  • Gas3 does not support inner classes
  • must declare your classes in separated source files if you want them to be correctly handled by the generator
kuni katsuya

GraniteDS - deserialize ActionScript object to a Java Map object - Ross Henderson - 0 views

  • GraniteDS – deserialize ActionScript object to a Java Map object
  • key of type String and a value of type List
  • HOWEVER, the value has to be an ArrayCollection, not an Array.
  • ...2 more annotations...
  • Dictionary object is very similar to Java’s Map object.
  • Granite claims to implement the same serialization/deserialization matrix as BlazeDS (with two small exceptions).
1 - 17 of 17
Showing 20 items per page