Thursday, July 21, 2011

Adding qooxdoo-contrib in production server

If you made this post, I can understand that your work needs to go public ... unless you do it for yourself and you're happy knowing something else and no sharing it.

In this post I'll explain what we need to do for making your application public for all eyeOS users.

First we need to make eyeOS compatible with qooxdoo-1.4 for that we will download the latest sdk from qooxdoo.org here. By the time I wrote this post, there's the 1.5 version available to download, honestly I didn't check if works yet.



Unzip the file in your home, in my case I use Ubuntu server, so I use the /home/user to unzip it. You'll find a folder like qooxdoo-1.4.2-sdk. Now we tweak the framework for eyeos, just paste the following code in your config.json from /home/user/qooxdoo-1.4.2-sdk/framework/

{
  "include" :
  [
    {
      "as": "appconf",
      "path" : "${QOOXDOO_PATH}/tool/data/config/application.json"
    },

    {
      "path" : "image.json"
    }
  ],

  "export": ["build", "debug"],


  "let" :
  {
    "APPLICATION"  : "qx",
    "QOOXDOO_PATH" : "..",
    "LOCALES"      : [ "de", "en", "es", "fr", "it", "nl", "no", "sv","ro" ]
  },

  "jobs":
  {

    "build" :
    {
      "library" :
      [
        {
          "manifest" : "Manifest.json"
        },
 {
   "manifest" : "/home/user/qooxdoo-contrib/Aristo/trunk/Manifest.json"
 },
 {
   "manifest" : "/home/user/qooxdoo-contrib/QxDyGraphs/trunk/Manifest.json"
 }
      ],


      "include": ["qx.*", "aristo.Aristo", "qxdygraphs.*"],
      "exclude": ["=qx.test.*"],

      "environment" :
      {
        "qx.debug" : false,
        "qx.aspects" : false,
 "qx.application": "eyeos.Application",
 "qx.theme": "aristo.Aristo"
 
      },

      "compile-options" :
      {
        "paths" :
        {
          "file"     : "/var/www/eyeos/eyeos/extern/js/qx.js"
        },
        "code"  :
        {
          "format"   : "on",
          "optimize" : ["basecalls", "variables", "privates", "strings"]
        }
      },
      
      "compile" : { "type" : "build" },

      "copy-resources" :
      {
        "target" : "/var/www/eyeos"
      }
    },
    "debug" :
    {
      "library" :
      [
        {
          "manifest" : "Manifest.json"
        }
      ],


      "include": ["qx.*", "aristo.Aristo", "qxdygraphs.*"],
      "exclude": ["=qx.test.*"],

      "environment" :
      {
        "qx.debug" : true,
        "qx.aspects" : false,
 "qx.application": "eyeos.Application",
 "qx.theme": "aristo.Aristo"
      },

      "compile-options" :
      {
        "paths" :
        {
          "file"     : "/var/www/eyeos/eyeos/extern/js/qx.js"
        },
        "code"  :
        {
          "format"   : "on",
          "optimize" : ["basecalls", "variables", "privates", "strings"]
        }
      },
      
      "compile" : { "type" : "build" },

      "copy-resources" :
      {
        "target" : "build"
      }
    }
}
}

We still need to build the new eyeos framework, I assume that your public eyeos is stored in /var/www folder of your system, otherwise change it in your config.json file to point to the place where your eyeos is.

What I actually need is an user with rights to copy into the destination folder, in my case must be root who does that:
sudo ./generate.py build
and to be sure we have the correct rights we issue:
sudo chown www-data.www-data /var/www/eyeos -R

Now we are sure our production version of eyeos has the correct qooxdoo libraries, so we can copy our application into the apps folder.

Don't forget to change the owner of the new folder and files contained to make it work properly.

Currently I have a public version with all the apps that I publish here. Because I use my personal computer I won't publish the web address, but if you're really interested contact me and I'll grant you access.

No comments:

Post a Comment