Recent Changes - Search:

Administrators

Developers

Articles

Cookbook

edit

How to migrate your applications from 0.0.7 to 0.0.8 manually

Mainly due to the new namespaces introduced in version 0.0.8, along with the minimization of the datatypes used by the Porcupine desktop, a direct upgrade is not feasible. This means that you have to follow a standard procedure in order to migrate your existing Porcupine applications.

It is now possible to gather your application's files in a single folder tree instead of having them scattered inside the "schemas", "pubdir" and "resources" folder trees. This way the development process gets significally faster.

  1. Before installing the new release, you must first gather all of your application's files in a single folder. Thus, create a new folder tree with the following structure (feel free to replace "MyApplication" with the real name of your application):
    
    /MyApplication
          |
          |__/schema
          |
          |__/images
    
    

  2. If your application defines new types of Porcupine Objects, then copy the file(s) that define these new types inside the "schema" folder. Do not forget to create a blank "__init__.py" file to make this directory a Python module. If your application's schema is a single Python file, then it is usually a good idea to remove the "schema" folder, and rename your Python file to "schema.py".

  3. Next copy any new images, required by your application inside the "images" folder.

  4. Almost every Porcupine application has its own published directory, under the "pubdir" folder. Copy all the files contained inside this folder inside the "MyApplication" folder.

  5. Copy your applications servlets, string resources and QuiX UIs inside the "MyApplication" folder.

  6. Extract your application's embedded script to a new JavaScript file. Open the properties dialog of your application and copy the application's script to the clipboard by pressing Ctrl-C. Create a new JavaScript file named "MyApplication.js" inside the "MyApplication" folder and then paste the script you have just copied. If your script file uses localized string resources convert it to a PSP file accordingly - usually named "MyApplication.js.psp". The required code looks something like this:
    <%
      from org.innoscript.filetrack.strings import resources
    
      sLang = request.getLang()
      sYes = resources.getResource('YES', sLang)
      sNo = resources.getResource('NO', sLang)
      sInfo = resources.getResource('INFO', sLang)
      .
      .
      .
    %>
    

  7. Extract your application's interface to a single QuiX file. Locate your application's object ID on the properties dialog. Open a browser and type "http://PORCUPINE_SERVER_NAME/porcupine.py/YOUR_APPLICATION_ID?cmd=run". Copy the XML displayed and paste it into a new QuiX file named "MyApplication.quix". Again this file should be inside the "MyApplication" folder. Likewise, if your initial interface definition file contains localized strings, convert this file to a PSP file, that imports and outputs the required strings, based on the preferred language of the client.

  8. Add two new registrations to "config.xml". The first one for the application's JavaScript (or PSP) file and the second one for the application's interface QuiX (or PSP) file. These registrations usually are (the action attribute should be modified accordingly for PSP files):
    
      <context path="myapplication.quix" method=".*" client=".*" lang=".*" action="myapplication.quix"/>
      <context path="myapplication.js" method=".*" client=".*" lang=".*" action="myapplication.js"/>
    
    

  9. Before installing Porcupine 0.0.8, keep a copy the "package" node of your application's registrations inside the "conf/store.xml" file, in order to restore this node to the new installation.

  10. Install Porcuine 0.0.8 and restore your application's package node inside the new "store.xml" configuration file.

  11. Copy the new folder tree inside the Porcupine installation. One good approach is to create Python packages based on the name of your company's/personal website domain name. Therefore, if your web site's domain is something.com, create the "com.something" Python package and paste your application's folder inside the "something" folder.

  12. If your new object definitions derive from objects other than the system objects, update your inheritance chain from "schemas.org.innoscript.XXXX" to "org.innoscript.desktop.schema.XXXX"

  13. Your application's namespace has now changed to "com.something". As a result, you must make some replacements throughout your application's code. Start by updating the registrations inside the "store.xml" configuration file. Then proceed by making the appropriate replacements inside your Python and JavaScript scripts inside the "com/something/MyApplication" folder.

  14. Add your application's published directory by adding a new node to the "pubdir.xml" configuration file (the folder must be published with the same name).
    
      <dir name="myapplication" path="com/something/`MyApplication"/>
    
    

  15. Ensure that the "config.xml" file located inside "com/something/MyApplication" folder, has all the required registrations (including those of the images).

  16. Re-create all the objects required for your application to operate including the application object, security groups, policies and containers. Notice that the application object schema has changed. All you need is to define its icon and its QuiX UI definition file. In our case, this URL is "myapplication/myapplication.quix".

  17. If you have constants referencing these objects in your code do not forget to make the required replacements.

  18. Restart Porcupine.

  19. Test and debug your application.
Page last modified on October 29, 2006, at 10:02 PM