1. Server Configuration

 Documentation Summary
 Page Summary

Tide Server Configuration

It is possible to use the client part of the Tide framework with any AMF provider (AMFPHP, RubyAMF, ...) as it is built upon the RemoteObject API. However the full capabilities of the framework are available only when using the server integration provided with Java frameworks and the GraniteDS AMF provider.

The server configuration consists of four parts:

  • Add the necessary GDS/Tide libraries to the server application
  • Configure the GDS servlet in web.xml
  • Configure the Tide destination in services-config.xml
  • Configure the Tide security options in granite-config.xml

All these parts mainly depend on the chosen server-side technology and are described in more details in the next subsections. Note that this setup is only required at the beginning of your project and can be reused "as is" for other projects.

Enabling Server Components for Tide

The default security policy is that no server component can be remotely accessed through Tide. You will get a "component not found" error if you try to call anything from Flex.

There are four possibilities to enable server components:

  • Enable all components whose class name matches a specified regex:
    <tide-component type="org\.granite\.example\..*"/>
  • Enable all components whose name matches a specified regex:
    <tide-component name="org\.granite\.example\..*"/>
  • Enable all components whose class extends a specified class or interface:
    <tide-component instance-of="org.jboss.seam.framework.Query"/>
  • Enable all components annotated with a specified annotation:
    <tide-component annotated-with="org.granite.tide.annotations.TideEnabled"/>

A typical configuration for a simple Seam application would be:

granite-config.xml
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE granite-config PUBLIC
    "-//Granite Data Services//DTD granite-config internal//EN"
    "http://www.graniteds.org/public/dtd/2.0.0/granite-config.dtd">

<granite-config>
    ...
    <tide-components>
        <tide-component instance-of="org.jboss.seam.security.Identity"/>
        <tide-component type="com\.myapp\..*"/>
        <tide-component annotated-with="org.granite.tide.annotations.TideEnabled"/>
    </tide-components>
    ...
</granite-config>

The @TideEnabled annotation can be placed on each component instead of relying on the class name.

If you do not want to have a compilation dependency on granite.jar, you can use any other custom annotation and a declaration like: <component annotated-with="path.to.my.Annotation"/>.

If you use EJB 3 components, you can enable all your application EJBs with:

granite-config.xml
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE granite-config PUBLIC
    "-//Granite Data Services//DTD granite-config internal//EN"
    "http://www.graniteds.org/public/dtd/2.1.0/granite-config.dtd">

<granite-config>
    ...
    <tide-components>
        <tide-component instance-of="org.jboss.seam.security.Identity"/>
        <tide-component annotated-with="javax.ejb.Stateless"/>
        <tide-component annotated-with="javax.ejb.Stateful"/>
    </tide-components>
    ...
</granite-config>

If the Seam application framework is used, all framework classes can be enabled with:

granite-config.xml
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE granite-config PUBLIC
    "-//Granite Data Services//DTD granite-config internal//EN"
    "http://www.graniteds.org/public/dtd/2.1.0/granite-config.dtd">

<granite-config>
    ...
    <tide-components>
        <tide-component instance-of="org.jboss.seam.framework.Home"/>
        <tide-component instance-of="org.jboss.seam.framework.Query"/>
    </tide-components>
    ...
</granite-config>

 


Browse Space

- Pages
- Blog
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

Other Features

Add Content


Copyright © 2011 Granite Data Services S.A.S. All Rights Reserved.