Skip to content
This repository was archived by the owner on Jun 11, 2023. It is now read-only.

Configuration File

fdelbos edited this page Nov 26, 2011 · 20 revisions

Configuration File

The FCat framework works with a configuration file that will enable us to define the entire application skeleton. You can give this file the name you want as long as it end with ".xml".

Here is a complete example of a configuration file:

<fcat-application>

    <group name="welcomeTabBarItem" title="Welcome" image="welcomegroup.png">

        <view class="WelcomeView" name="welcome" >
            <route action="userButton" destination="userform"/>
        </view>

        <view class="UserFormView" name="userform" title="User Form">
            <decorator class="FCatTextInputDecorator">
                <scroller>SrollView</scroller>
                <input>Login</input>
                <input>Email</input>
                <input>Password</input>
            </decrator>
        </view>

    </group>

    <group name="helpTabBarItem" title="Help" image="helpgroup.png">
        <view title="Help" class="FCatWebView" name="help">
            <param name="upButton">yes</param>
            <param name="htmlFile">myhtmlfile</param>
        </view>
    </group>

</fcat-application>

Groups

The group element defines a TabBarItem that contains a group of views.

<group name="[Unique name]" title="[TabBarItem title]" image="[TabBarItem icon]">

  • title : the title of the UITabBarItem that will hold the group.
  • image : the icon image of the UITabBarItem.
  • name : a unique name that identifies the UITabBarItem in the FCat application.

Views

group contains view that represents instances of UIVIewControllers. Indeed the framework will take care of the view creation for you.

<view class="[UIViewController]" name="[Unique name]" >

  • title : the title of the view in the UINavigationController .
  • class : the name of the UIViewController to instantiate.
  • name : a unique name that identifies the view in the FCat application.

Routes

The route element declares a route between 2 views. When the user push a button in the current view, it will cause the destination view to appear. Destination views can be declared later in the code.

<route action="[UIButton to trigger]" destination="[name of the destination view]"/>

  • action : the name of the UIButton in the UIViewController that will be mapped to the route.
  • destination : the name of the view to move to when the user click on the action button.

Params

It's also possible to inject parameters directly to a UIViewController by the means of the param element.

<param name="[Name of param]">[Value of the param]</param>

  • name : represents the name of the property declared in the UIViewController. Note that this property must be of type NSString *.

Decorators

Decorators are declared with the decorator element. They provide generic functionalities to views. For example the FCatTextInputDecorator allow for automatic management of text inputs in a view.

<decorator class="[FCatDecorator class name]">

  • class : is the name of the FCatDecorator to instantiate.

Decorators child's are dependents of the implementation of the decorator.

Clone this wiki locally