My favorites | Sign in
Project Logo
                
Search
for
Updated May 07, 2008 by botelho.daniel
Labels: Tutorial, Phase-Deploy, Featured
HowToConfigure  
Here it's explained how to configure you're application

Configure

'''Note:''' This tutorial assumes that you have create an application called "opensocial" and an application module called "app".

The first part to create an OpenSocial application is to configure it. Because an OpenSocial application is a gadget you need to say to symfony that it should render the "indexSuccess.php" as a gadget. In this plugin you can find an gadget-layout under "sfOpenSocialPlugin/misc/app/templates/" and you need to set the "indexSuccess.php" layout as a gadget-layout. This is done by setting your "apps/opensocial/modules/application/config/view.yml" like this:

indexSuccess:
  http_metas:
    content-type: application/xml

  layout: gadget_layout

If you've used "init-opensocial-app"( look at HowToConfigure ) task you already have this configured and you don't need to do it again.

After you had configured the gadget you need to configure the OpenSocial application and in this plugin you can choose two ways of doing it:

  • You can configure it, using the file "app.yml";
  • Or using the ModulePrefs class to configure it in the Action.

Configuring the application means to set key-values pairs like:

  • title : Optional string that provides the title of the gadget
  • description : Optional string that describes the gadget.
  • etc...
Most of this values are optional but some containers use them. For more information about those values look at Gadget Preferences. Here it's an example of how an "app.yml" file should be configured:

# default values
all:
  opensocial:
    base_url: http://www.palcoprincipal.com
    api_version: 0.7

    module_prefs: #ref: http://code.google.com/apis/gadgets/docs/reference.html#Moduleprefs_Ref
      title: My First OpenSocial Application
#      directory_title
#      title_url
      description: This application was created by sfOpenSocialPlugin
      author: Daniel Botelho
      author_email: botelho.daniel@gmail.com
#      author_affiliation
#      author_location
#      screenshot
      thumbnail: http://www.palcoprincipal.com/images/logos/logo_palco_3.jpg
#      height
#      width
#      scaling
#      scrolling
#      singleton
#      author_photo
#      author_aboutme
#      author_link
#      author_quote

    locale:
      - lang: en
        country: us
#        messages
#        language_direction

    requires: 
      - feature: opensocial-0.7 
#      - feature: dynamic-height
#      - feature: setprefs
#      - feature: settitle
#      - feature: tabs
#      - feature: drag
#      - feature: grid
#      - feature: minimessage
#      - feature: analytics
#      - feature: flash
#      - feature: finance


    user_prefs: # ref: http://code.google.com/apis/gadgets/docs/reference.html#Userprefs_Ref
#      - name: difficulty # the name of the User Preference
#        display_name: asd
#        urlparam: asd
#        datatype: asd
#        required: asd
#        default_value: asd
#        enum_value:
#          - {value: enum1, display_value: xx }
#          - {value: enum2, display_value: xx}

    content:  # ref: http://code.google.com/apis/gadgets/docs/reference.html#Content_Ref
      type: html
#      href
#      cdata

But for this application to work properly should put in 'all_opensocial_base_url' your symfony project base url. This base_url is used to allow to automatically include stylesheet and Javascript files (look at OpenSocialHelper for more information)


Sign in to add a comment
Hosted by Google Code