June 3rd, 2008 · Posted by hhashemi · No Comments

IE6 Transparent PNGs

One of the undocumented features of the Appcelerator WebSDK is the built-in support of transparent PNG images for IE6. A simple Google search will show you many, many different Javascript code snippets that you can put in your app to apply the PNG transparency filter on your images. But we thought we could provide this in our framework for you so you don’t have to worry about it.

The only problem has been that you couldn’t control exactly which images you want the filter to apply to. For example, if the filter applied to a div that had a background-image and a position, then potentially nothing inside that div would be clickable. And you also probably don’t want the extra processing on PNG images that don’t have any transparency to begin with.

So on the next released version of the WebSDK (2.1.3), we’ll have a .htc file that you can use in your CSS to control which images you want the PNG fix to apply to. For example you can do

.png 
{
   behavior: url(/images/iepngfix.htc);
}

to apply on all elements that have the class “png” or you can do

img, div 
{
   behavior: url(/images/iepngfix.htc);
}

to simply apply on all img and div elements.

Having these .htc files may not be the best thing in the world, but at least you can have control on where the PNG fix is applied.

Popularity: 5% [?]

Tags: Documentation

March 4th, 2008 · Posted by Andrew Zuercher · 3 Comments

Implementing an Appcelerator Plugin

Purpose

The Appcelerator framework allows for the extension of the build and deployment process so that you can add components and modify the behavior of your service implementations. It is quite powerful and not only restricted to services, plugins for example could span across to the modification of applications and the entire build and deployment process for that matter. For simplicity, this article will identify how to create a new component added to our java service for monitoring performance.

Install Appcelerator

I’ve assumed that you’ve successfully downloaded and installed Appcelerator from http://www.appcelerator.org/products. Once you’ve gone through the installer you can get the java service

1
  app install:service java

You may want to get an existing plugin (I needed the java:spring plugin to implement my plugin):

1
  app install:plugin java:spring

Plugin Creation

Lets assume that our plugin is going to be called java:perf, to create the plugin project:

1
2
  cd $HOME/workspace
  app create:plugin . java:perf

This will create a sub directory named java_perf, now you will want to create a proper license entry in your build.yml for example check out build.yml. You now have the opportunity to modify the entry points in your java_perf.rb. I personally wanted to setup my install script so that:

  • it dynamically builds the jar when we add the plugin to a project
  • modifies the spring.xml to include the bean entries for my component

All of this is in before_add_plugin(event) callback. If you want to see where this is called, check out add_plugin.rb. Once my coding is complete (added my source files to java_perf/src), I created the plugin distribution:

1
rake zip

Install the plugin

As you noticed, I haven’t covered debugging the plugin just yet, this is because I want to first set up the plugin for installation and then work with it in my install directory. Lets install it to the local machine:

1
app install:plugin java_perf.zip

Add the plugin to my project

I thought that I’d create a blank java project real quick

1
2
cd workspace
app create:project . myproject java

now we can add the spring plugin and our new java:perf plugin to our project

1
2
3
cd myproject
app add:plugin java:spring
app add:plugin java:perf

You can now directly modify the java_perf.rb file in your install directory

  • windows: c:/Program Files/Appcelerator/releases/plugin/java_perf/1.0
  • unix: /usr/local/Appcelerator/releases/plugin/java_perf/1.0
  • mac os: /Library/Appcelerator/releases/plugin/java_perf/1.0

I suggest that you continue to modify the java_perf.rb this way to debug it and then finalize by copying back over to $HOME/workspace/java_perf

Next Steps

As a final parting you can release your new plugin so that others may be able to leverage it

1
2
cd $HOME/workspace/java_perf
app release java_perf.zip

-andrew

this article is cross posted at:
http://zuerchtech.com/2008/3/4/implementing-an-appcelerator-plugin

Popularity: 15% [?]

Tags: Documentation · Example · Opinion

February 26th, 2008 · Posted by Andrew Zuercher · No Comments

Effectively Implementing Appcelerator RIAs and Services

Purpose

The Appcelerator framework allows for the extension of the build and deployment process so that you can add components and modify the behavior of your service implementations. It is quite powerful and not only restricted to services, plugins for example could span across to the modification of applications and the entire build and deployment process for that matter. For simplicity, this article will identify how to create a new component added to our java service for monitoring performance.

Install Appcelerator

I’ve assumed that you’ve successfully downloaded and installed Appcelerator from http://www.appcelerator.org/products. Once you’ve gone through the installer you can get the java service

1
  app install:service java

You may wan to get an existing plugin:

1
  app install:plugin java:spring

Plugin Creation

Lets assume that our plugin is going to be called java:perf, to create the plugin project:

1
2
  cd $HOME/workspace 
  app create:plugin . java:perf

This will create a sub directory named java_perf, now you will want to create a proper license entry in your build.yml for example check out build.yml. You now ave the opportunity to modify the entry points in your java_perf.rb. I personally wanted to setup my install script so that:

  • dynamically builds the jar when we add the plugin to a project
  • modified the spring.xml to include the bean entries for my component

All of this is in before_add_plugin(event) callback. If you want to see where this is called, check out add_plugin.rb. Once my coding is complete (added my source files to java_perf/src), I created the plugin distribution:

1
rake zip

Install the plugin

As you noticed, I haven’t covered debugging the plugin just yet, this is because i want to first set up the plugin for installation and then work with it in my install directory. Lets install it to my local machine:

1
app install:plugin java_perf.zip

Add the plugin to my project

I thought that I’d create a blank java project real quick

1
2
cd workspace
app create:project . myproject java

now we can add the spring plugin and our new java:perf plugin to our project

1
2
3
cd myproject
app add:plugin java:spring
app add:plugin java:perf

You can now directly modify the java_perf.rb file in your install directory

  • windows: c:/Program Files/Appcelerator/releases/plugin/java_perf/1.0
  • unix: /usr/local/Appcelerator/releases/plugin/java_perf/1.0
  • mac os: /Library/Appcelerator/releases/plugin/java_perf/1.0

I suggest that you continue to modify the java_perf.rb this way to debug it and then finalize by copying back over to $HOME/workspace/java_perf

Next Steps

As a final parting you can release your new plugin so that others may be able to leverage it

1
2
cd $HOME/workspace/java_perf
app release java_perf.zip

Popularity: 12% [?]

Tags: Documentation · Example · Opinion