One year in Guavus

Guavus

At this point I am really proud to say that I ama  Guavuan, the knowledge which I got here, the late nights workings, the brain stroming, the issues, the reasearch and the devlopement  everything is memorabale moments in my life. I can say only one word I feel my life here.

Thanks for my team and special thanks for Sandeep and Adi, to make me feel strong and helping to come with my real strengths.

and many thanks to Dr kool (Anukool) who is my energetic director.

Mapping ActionScript and Java objects (compatible datatypes)

Java type

ActionScript type (AMF 3)

enum (JDK 1.5)

String

java.lang.String

String

java.lang.Boolean, boolean

Boolean

int
If value < 0xF0000000 || value > 0x0FFFFFFF, the value is promoted to Number due to AMF encoding requirements.

java.lang.Short, short

int
If i < 0xF0000000 || i > 0x0FFFFFFF, the value is promoted to Number.

java.lang.Byte, byte[]

int
If i < 0xF0000000 || i > 0x0FFFFFFF, the value is promoted to Number.

java.lang.Byte[]

flash.utils.ByteArray

java.lang.Double, double

Number

java.lang.Long, long

Number

java.lang.Float, float

Number

java.lang.Character, char

String

java.lang.Character[], char[]

String

java. math.BigInteger

String

java.math.BigDecimal

String

java.util.Calendar

Date
Dates are sent in the Coordinated Universal Time (UTC) time zone. Clients and servers must adjust time accordingly for time zones.

java.util.Date

DateDates are sent in the UTC time zone. Clients and servers must adjust time accordingly for time zones.

java.util.Collection (for example, java.util.ArrayList)

mx.collections.ArrayCollection

java.lang.Object[]

Array

java.util.Map

Object (untyped). For example, a java.util.Map[] is converted to an Array (of Objects).

java.util.Dictionary

Object (untyped)

org.w3c.dom.Document

XML object

null

null

java.lang.Object (other than previously listed types)

Typed Object
Objects are serialized using Java bean introspection rules and also include public fields. Fields that are static, transient, or nonpublic, as well as bean properties that are nonpublic or static, are excluded.

openAMF : Flex and Java Example

Here is a HelloWorld example by using openAMF connectivity with java.

I just tried invoke a method in the java class using flex. Unfortunately I had only one way to invoke my java class from Flex that is a traditional method of flash using NetConnection. I strongly belive that there is some other way. if anyone knows please suggest.

here is the files

java : here

[4.37 MB because it contains all lib files required for openAMF]

flex : here

Flex : Copy functionality in DataGrid

The following example shows the customize data grid by applying a copy and paste functionality.

The idea is very simple but i think its useful, the data copied in clipboard can directly paste in excel and it will pasted in proper columns rather than in a single column, I tested this on Excel 2007.

for the running examples click here

for the complete source here

package com.ib.custom
{
import flash.events.ContextMenuEvent;
import flash.events.Event;
import flash.system.System;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;

import mx.controls.Alert;
import mx.controls.DataGrid;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.core.EventPriority;
import mx.events.CloseEvent;
import mx.events.ListEvent;

public class IBDataGrid extends DataGrid
{
[Bindable] public var enableCopy : Boolean = true;
// for creating conext menu item for coping functionality
private var copyContextItem:ContextMenuItem;
// for storing the header text at only once.
private var headerString : String = ”;

private var dataToCopy:String = ”;
public function IBDataGrid()
{
super();
}

// I am creating a copy context item and its handler in creation complete of DATAGRID if and only if enableCopy is true.
override protected function createChildren():void{
super.createChildren();
var flag:Boolean = false
if(enableCopy){
contextMenu = new ContextMenu();
createContextMenu();
addEventListener(ListEvent.ITEM_CLICK,
itemClickHandler,
false, EventPriority.DEFAULT_HANDLER);
flag = true;
}
}

private function createContextMenu():void{
copyContextItem = new ContextMenuItem(“copy row/s”);
copyContextItem.enabled = false;
copyContextItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,copyDataHandler);
contextMenu.customItems.push(copyContextItem);
// comment the following line if you want default items in context menu.
contextMenu.hideBuiltInItems();
}

private function copyDataHandler(event:Event):void{
dataToCopy = ”;
if(selectedItems != null){
dataToCopy = getSelectedRowsData();
dataToCopy = ((headerString == ”) ? getHeaderData() : headerString)+”\n” + dataToCopy;
copyContextItem.enabled = true;
System.setClipboard(dataToCopy);
}
}

private function handleAlertClose(event:CloseEvent):void{
trace(“handling .. the event”);
if(event.detail == 1)
{

}

}
private function getHeaderData():String{
headerString = ”;
for(var j:int = 0; j< columnCount; j++){
if((columns[j] as DataGridColumn).visible)
headerString += (columns[j] as DataGridColumn).headerText +”\t”;
}
return headerString;
}

private function getSelectedRowsData():String{
var rowsData : String = ”;
for(var i:int =0;i<selectedItems.length;i++) {
for(var j:int = 0; j< columnCount; j++){
if((columns[j] as DataGridColumn).visible)
rowsData += selectedItems[i][(columns[j] as DataGridColumn).dataField] +”\t”;
}
rowsData+= “\n”;
}
return rowsData;
}

private function itemClickHandler(event:ListEvent):void
{
copyContextItem.enabled = true;
}
}
}

– imtiyaz

MFUG 2

Mumbai Flex User Group Second Meet:

Mumbai Flex User Group second meet is executed in Grey Matter India Technologies Pvt. Ltd, Borivell, Mumbai. Its a memorable day for all of us. We are so thankful to Grey Matter for hosting our meet. lot of fun and knowledge sharing is happened in this meet.We are discussed the following things in this meet.

* Singleton Design Pattern by Vinay

* RIA applications by Suketu Vyas.

* MVC Design Pattern by Imtiyaz

* Java vs Action script by Imtiyaz.

The total count of heads for todays meet is aroud 12.

Take a look of MFUG Team

MFUG2 GroupMFUG2 Sub Group

Taken with a mobile cam, image is not stabilized well sorry guys.

You can the download the documents and examples which we are discussed from the following links.

Java Vs Action script

MVC Architecture * ppt * src

Few more adding later…

Where it has happened.

Grey Matter India Technologies Pvt. Ltd.

I st Floor, Plot 31,

Said Darshan Tower,

Opp Suvidya,

Gorai 1,

Borivali (w),

Mumbai.

When it has happened :

1:00 PM to 5:30 PM

Sunday, 05 August 2007.

Who are participants :

Suketu, Imtiyaz, Vijay, Rahul, Martin, Barkha, Tarun
Abhay, Kapil, Rajendar, Venkata, Vinay and Raghavendra.

How it was happened :

Coping the information from vinay’s mail.

Rahul manikar was the first guy to come
He discussed about the usability certification which he recently did
Was a punctual guy 🙂

Martin gave a dashing entry and gave us some insight what happend in pune

Barkha gave a entry with a smile discussed about the Flex and java projects

suketu came in grabed everyones attention.He gave a beautiful presentation and the punch line was “EXPERIENCE MATTER”
The main thing which i learnt was simulating an real life experience adds to great Experience

vijay came with a speed and discussed about coldfusion and flex .Also he talked about the flex application

Imtiyaz,venkata, raghavendra were the last to add to the meeting as finding the location took them to a beach 🙂

Imtiyaz with his enthu gave presentation on MVC architecture and how to implement it in flex
He also talked about the comparsion on flex and java which took the major time but was very informative with active participation from all the members

I talked about singelton pattern and its implementation in flex and some examples

Tarun,Abhay,Kapil were all new to flex and they too enjoyed the meet and the session must have inspired them to work on this technology with a fullfledge spirit

Due to lack of time we missed vijays presentation on flex and php

Suketu finally gave summary to the whole meeting and gather info of all the member so no one miss the 3rd Mumbai FUG which will be somewhere in mid of september

Suketu also promised to pass all the links which he wanted to show us and pass on the member info to all the member

Finally my special thanks to GMI and to all the member who was present in the meeting.

– Thanks Vinay for detailed description.