• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Chromattic usage in eXo Social
 

Chromattic usage in eXo Social

on

  • 816 views

A presentation made by eXo Platform SEA. We introduce Chromatic usage in eXo Social with several key features. Hope you enjoy it!

A presentation made by eXo Platform SEA. We introduce Chromatic usage in eXo Social with several key features. Hope you enjoy it!

Statistics

Views

Total Views
816
Views on SlideShare
816
Embed Views
0

Actions

Likes
1
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Chromattic usage in eXo Social Chromattic usage in eXo Social Presentation Transcript

    • Chromattic how to use Vu Cong Thanh & Le Van Vien Social Team 18/08/2011
    • Agenda
      • What & why Chromattic?
      • Annotation APIs
      • APT in Chromattic.
      • Config & dependency
      • Example
    • What is Chromattic?
      • Is an object mapper framework that uses Java Content Repository as back end storage.
      • Open source under the LGPL license.
      • Hosted in Google code:
      • http://code.google.com/p/chromattic/
    • JCR
      • JCR by nature is not type safe.
      • Work with nodes.
      • Manage session by myself.
    • Chromattic
      • Provide a type safe object model for JCR.
      • Use Java 5 annotation.
      • Integrate at Java compiler level via the Annotation Processor Tool.
      • Efficient lazy loading.
    • Annotation APIs
    • Annotation APIs
      • Chromattic supports 2 types
      • PrimaryType: Mapping between a node type and a java class.
      • MixinType: When a class declares a mixin annotation without being bound to a node mapping, this class can be involved in a one to one relationship with the EMBEDDED type. The mixin is added to a node when a one to one relationship of type mixin is created.
    • Annotation APIs
      • Id: annotates a bean property getter to return the current identifier of the related jcr node
      • Path: annotates a bean property getter to return the current path of the related jcr node
    • Annotation APIs
      • MappedBy: defines the name of the property that is used to maintain one to many relationship with path or reference.
      • Name: annotates a bean property to map it against the current name of the related jcr node.
      • Property: defines the mapping between the property of a node type and a java bean property of the annotated class.
    • State Of Chromattic Entity
    • Annotation APIs
      • Create: define a creator method to create transient instances of a Chromattic entity
      • FormattedBy: BaseEncodingObjectFormatter implements ObjectFormatter
      • DefaultValue: define the default value of a property
      • OneToMany: defines the one side in a one to many relationship
    • Annotation APIs
      • RelationshipType
      • HIERARCHIC: a hierarchic relationship uses the natural parent child relationship to associate nodes. It is valid either for one to one or one to many relationship.
      • REFERENCE: a reference relationship uses reference a typed property to associate nodes. It is only valid for one to many relationships.
      • PATH: a path relationship uses path a typed property to associate nodes. It is only valid for one to many relationships.
      • EMBEDDED
    • Config & dependency
    • Config & dependency Config: in file configuration.xml with plugin RepositoryService
    • Config & dependency Config phase <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.1</version> … </plugin>
    • Config & dependency Config phase <executions> <execution> <id>default-compile</id> <goals> <goal>compile</goal> </goals> <phase>compile</phase> <configuration> <compilerArgument>-proc:none</compilerArgument> </configuration> </execution> </executions>
    • Config & dependency
      • Config
      • Generate implementation when compile
    • Config & dependency Dependency <dependency> <groupId>org.chromattic</groupId> <artifactId>chromattic.api</artifactId> <version>1.1.0-beta6</version> <scope>provided</scope> </dependency> Annotations, event, format, query
    • Config & dependency Dependency <dependency> <groupId>org.chromattic</groupId> <artifactId>chromattic.core</artifactId> <version>1.1.0-beta6</version> <scope>provided</scope> </dependency>
    • Config & dependency Dependency <dependency> <groupId>org.chromattic</groupId> <artifactId>chromattic.metamodel</artifactId> <version>1.1.0-beta6</version> <scope>provided</scope> </dependency>
    • Config & dependency Dependency <dependency> <groupId>org.chromattic</groupId> <artifactId>chromattic.apt</artifactId> <version>1.1.0-beta6</version> <scope>provided</scope> </dependency>
    • Config & dependency Dependency <dependency> <groupId>org.chromattic</groupId> <artifactId>chromattic.spi</artifactId> <version>1.1.0-beta6</version> <scope>provided</scope> </dependency>
    • Config & dependency Dependency <dependency> <groupId>org.chromattic</groupId> <artifactId>chromattic.exo</artifactId> <version>1.1.0-beta6</version> <scope>test</scope> </dependency>
    • APT in Chromattic
    • APT in Chromattic
      • ChromatticBuilder
      • The builder configures and creates a Chromattic at runtime.
        • SESSION_LIFECYCLE_CLASSNAME: The JCR session life cycle class name.
        • ROOT_NODE_PATH: The path of the root node. The default value is the path of the JCR workspace root node.
        • CREATE_ROOT_NODE: A boolean option that creates the root node designated by the ROOT_NODE_PATH when it does not exist.
    • APT in Chromattic
      • Chromattic
      • The Chromattic object provides the entry point for runtime interactions.
    • APT in Chromattic
      • ChromatticSession
      • The session manages Chromattic objects at runtime, its is obtained from a Chromattic instance. A session is meant to be used by one thread and not shared among threads.
    • APT in Chromattic
      • ChromatticLifeCycle
      • The chromattic life cycle object is a plugin allows to bootstrap a chromattic builder and make it managed either locally or globally.
      • Some parameters:
        • domain-name: the life cycle domain name.
        • workspace-name: the repository workspace name associated with this life cycle.
        • entities: list value that contains the list of chromattic entities that will be registered against the builder chromattic builder.
    • APT in Chromattic Proxy generation based on APT
    • Example