1. Configuration

 Documentation Summary
 Page Summary

Tide Configuration

The configuration consists of four parts:

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

All these parts are mainly dependent on the chosen server-side technology and are described in more detail 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 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 Seam components:

  • Enable all components whose class name matches a specified regex:
    <component type="org\.granite\.example\..*"/>
  • Enable all components whose name matches a specified regex:
    <component name="org\.granite\.example\..*"/>
  • Enable all components whose class extends a specified class or interface:
    <component instanceof="org.jboss.seam.framework.Query"/>
  • Enable all components annotated with a specified annotation:
    <component annotatedwith="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/1.2.0/granite-config.dtd">

<granite-config>
    ...
    <tide-components>
        <component instanceof="org.jboss.seam.security.Identity"/>
        <component type="com\.myapp\..*"/>
        <component annotatedwith="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 source dependency on granite-tide.jar, you can use any other custom annotation and a declaration like: <component annotatedwith="path.to.my.Annotation"/>.

If you use EJB 3, 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/1.2.0/granite-config.dtd">

<granite-config>
    ...
    <tide-components>
        <component instanceof="org.jboss.seam.security.Identity"/>
        <component annotatedwith="javax.ejb.Stateless"/>
        <component annotatedwith="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/1.2.0/granite-config.dtd">

<granite-config>
    ...
    <tide-components>
        <component instanceof="org.jboss.seam.framework.Home"/>
        <component instanceof="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.