Skip to main content

Home/ SoftwareEngineering/ Group items tagged graniteds

Rss Feed Group items tagged

kuni katsuya

ListCollectionView/ArrayCollection tip for using GraniteDS - Ross Henderson - 0 views

  • The reason why GraniteDS generates properties of type ListCollectionView is simple : it internally uses collections implementations that extend ListCollectionView and not ArrayCollection. But as you have described when you manually assign collections, you should use ArrayCollection. It’s exactly the same as in Java when you do List list = new ArrayList().
  • ListCollectionView/ArrayCollection tip for using GraniteDS
  • new ListCollectionView();
  • ...4 more annotations...
  • instead of this:
  • do this:
  • new ArrayCollection();
  • I’m not really sure what the deal is
    • kuni katsuya
       
      see comment from william (wdrai) below (graniteds guy)
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 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

Chapter 10. Integration with CDI - 0 views

  • 10.3.5. Security GraniteDS provides a client-side component named identity that ensures the integration between the client RemoteObject credentials and the server-side container security. It additionally includes an easy-to-use API to define runtime authorization checks on the Flex UI.
  • CDI identity component (of class org.granite.tide.cdi.Identity) predictably provides two methods login() and logout()
  • identity component is integrated with server-side role-based security and can be used to get information or show/hide UI depending on the user access rights:
  • ...2 more annotations...
  •  enabled="{identity.hasRole('admin')}"
  • button labeled Delete will be enabled only if the user has the role admin
kuni katsuya

Compare GraniteDS for Rich Internet Applications (RIA) | Granite Data Services - 0 views

  • comparison of GraniteDS to other common integration frameworks for Flex / JaveEE RIA applications
kuni katsuya

3. Gas3 Template Language - Confluence - 0 views

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

[#GDS-933] GAS3 does not handle Java generics with abstract class implementations - Gra... - 0 views

  • GAS3 does not handle Java generics with abstract class implementations
  • Fix Version/s: 3.0.0.M1
kuni katsuya

Adobe Community: Updated Groovy template for GraniteDS Builder (gas3) - 0 views

  • Updated Groovy template for GraniteDS Builder (gas3)
  • also stripped out the specialized GraniteDS datatypes in favor of the LCDS serialization convention that Adobe uses (i.e. a Java map should translate to an 'Object' type, a Java enum should translate to a 'String', and Java collections should always serialize as 'ArrayCollection')
  • didn't do a 'base' version and a version that doesnt get touched by the code generator, but you could easily do so by modifying this template
  • ...3 more annotations...
  • two versions
  • for Managed entities:
  • meant for non managed entities:
kuni katsuya

Chapter 11. Client-Side Validation API (JSR 303) - 0 views

  • Client-Side Validation API (JSR 303)
  • GraniteDS introduces an ActionsScript3 implementation of the Bean Validation specification and provides code generation tools integration so that your Java constraint annotations are reproduced in your AS3 beans
kuni katsuya

Chapter 10. Integration with CDI - 0 views

  • Integration with CDI
  • GraniteDS provides out-of-the-box integration with CDI via the Tide API
  • tideAnnotations
  • ...5 more annotations...
  • tideInterfaces
  • tideRoles
  • exceptionConverters
  • amf3MessageInterceptor
  • define the list of interface/class names that enable remote access to CDI beans
kuni katsuya

Chapter 15. Data Management - 0 views

  • Data Management
  • Tide maintains a client-side cache of entity instances and ensures that every instance is unique in the Flex client context
  • Tide provides an integration between the Flex/LCDS concept of managed entities and the server persistence context (JPA or Hibernate).
  • ...10 more annotations...
  • All entities marked as [Managed] are considered as corresponding to Hibernate/JPA managed entities on the server
  • It is highly recommended to use JPA optimistic locking in a multi-tier environment (@Version annotation
  • In conclusion, the recommended approach to avoid any kind of subtle problems is to have a real uid property which will be persisted in the database
  • but is not a primary key for efficiency concerns
  • Here all loaded collections of the Person object will be uninitialized so uperson contains only the minimum of data to correctly merge your changes in the server persistence context
  • Tide uses the client data tracking (the same used for dirty checking, see below) to determine which parts of the graph need to be sent.
  • Dirty Checking and Conflict Handling
  • Data Validation
  • Tide integrates with Hibernate Validator 3.x and the Bean Validation API (JSR 303) implementations, and propagate the server validation errors to the client UI components
  • Data Paging
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

2. Flex application initialization - Confluence - 0 views

  • Application initialization
  • correct integration singleton for your application
  • depends on the server framework
  • ...7 more annotations...
  • Spring, Seam, Ejb, Cdi
  • It's even possible to use the Tide framework if you don't use GraniteDS as the AMF remoting provider by initializing the application with the singleton Tide.
  • Client-side setup for remoting
  • initialize manually the Flex remoting channels that will be used by Tide
  • use the DefaultServiceInitializer component
  • of course don't forget to change the context root to your web app path
  • { contextRoot: "/my-app" }
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
‹ Previous 21 - 40 of 106 Next › Last »
Showing 20 items per page