LCDS 2.5 brought a new assembler, SQLAssembler. SQLAssembler lets you connect your Flex client to your database. Usually, when you read/write data with LCDS, you create your own Java adapter to handle these operations. With SQLAssembler, instead of writing the Java code for accessing the database, you configure access to the database and write the SQL for read/write/delete directly into the data-management-config.xml file (this is a configuration file used by Flex data services). Basically, you write some simple XML with some SQL for each operation, and you don’t need to write a single line of Java. But, you get a full CRUD application, with all the benefits of Flex Data Services: collaboration, conflict resolution, paging. If you need for some operations to use stored procedure instead of SQL statements, there is no problem as SQLAssemberl has support for them.
Why should you use SQLAssembler?
I will not try to fool you. Probably it isn’t good for complex applications, where you have a lot of business logic on your server. But, it could come in very handy when you need to create a simple application, maybe a quick prototype for example. And the best thing is that if, for some reason, you decide that you need a custom assembler or HibernateAssembler instead of SQLAssembler, there should be little to change in the Flex client code, if anything at all. And, as you will see in this article, I can use this assembler to create a full CRUD application for one-to-many relationship database setup.
Thursday, July 17, 2008
Merapi - A Bridge Between AIR and Java

Merapi is a bridge between applications written in Java and those running in and created for Adobe AIR™ (Adobe Integrated Runtime™).
Merapi has been designed to run on a user's machine, along with an Adobe AIR™application and providea direct bridge between the Adobe AIR™ framework and Java, exposing the power and overall calabilities of the user's operating system, including 3rd party hardware devices.
With a light weight and straightforward API, developers can leverage the OS by writing Java companion applications for their AIR™ applications. Java programs treat Mirapi as a bridge to the running Adobe AIR™ application and vice-versa.
Developers can build their Flex, Flash and AJAX applications for Adobe AIR™, and use Mirapi to make them do things that AIR just can't do by itself.
The Merapi project team, is proud to announce that the private alpha release has been completed and is available to select members of the Flex/AIR/Java community. We've had a lot of interest and have been contacted by a variety of individuals who have expressed interest in joining our efforts.
Adobe New Magical Tool For RIA - THERMO
"Thermo" is an upcoming Adobe product that makes it easy for designers to create rich Internet application UIs. Thermo allows designers to build on familiar workflows to visually create working applications that easily flow into production and development.
Features :-
* Use drawing tools to create original graphics, wireframe an application design, or manipulate artwork imported from Adobe Creative Suite tools.
* Turn artwork from Adobe Photoshop, Illustrator, or Fireworks directly into functional components that use the original artwork as a “skin”.
* Define and wire up interactive behavior, such as what to do when a user clicks on something, without having to write code.
* Easily design UIs that work with dynamic data, such as a list of contacts or product information, without having access to the actual data source. Design-time sample data can be used as a realistic placeholder when laying out an application, testing interactivity, and choreographing motion.
Applications created in Thermo are Flex applications that can be loaded directly into Flex Builder, providing a great roundtrip workflow for designers collaborating with developers. The designer's work can be incorporated directly into the production application with no loss of fidelity, and designers can continue to refine the design throughout the iterative development process.
Friday, June 6, 2008
Changing Mysql Password
Last day i lost my mysql password , so i had to uninstall the whole database server and reinstall, then going mysql site i found a way to change my pass word , hope this may help u
Let’s look at all the ways to change MySQL password, for root and other users:
In MySQL the default password is empty. This is inherently unsafe and should be immediately changed. Here is how you can change MySQL default root password:
mysqladmin -u root password NEWPASSWORD
Here is how you can change OLDPASSWORD to NEWPASSWORD
mysqladmin -u LOGIN -p OLDPASSWORD NEWPASSWORD
Replace LOGIN with your login name, OLDPASSWORD with your current password and NEWPASSWORD with the new password.
Cheers
Varun Rathore
Let’s look at all the ways to change MySQL password, for root and other users:
In MySQL the default password is empty. This is inherently unsafe and should be immediately changed. Here is how you can change MySQL default root password:
mysqladmin -u root password NEWPASSWORD
Here is how you can change OLDPASSWORD to NEWPASSWORD
mysqladmin -u LOGIN -p OLDPASSWORD NEWPASSWORD
Replace LOGIN with your login name, OLDPASSWORD with your current password and NEWPASSWORD with the new password.
Cheers
Varun Rathore
Object Comparison In Flex / AIR
Object Comparison In Flex/AIR
To compare the objects whether they are same or not we can use following method of SerializeUtil Class
public class SerializeUtil
{
public static function ObjectToString(object: *): String
{
var ba: ByteArray = new ByteArray();
ba.writeObject(object);
return ba.toString();
}
public static function ObjectToByteArray(object: *): ByteArray
{
var ba: ByteArray = new ByteArray();
ba.writeObject(object);
ba.position = 0;
return ba;
}
}
To do the actual comparison just use these lines of code to compare the two objects.
if (SerializeUtil.ObjectToString(object1)==SerializeUtil.ObjectToString(object2))
{
// Objects are 'equal'
}
else
{
// Objects are not 'equal'
}
Thanks and Regards
Varun Rathore
To compare the objects whether they are same or not we can use following method of SerializeUtil Class
public class SerializeUtil
{
public static function ObjectToString(object: *): String
{
var ba: ByteArray = new ByteArray();
ba.writeObject(object);
return ba.toString();
}
public static function ObjectToByteArray(object: *): ByteArray
{
var ba: ByteArray = new ByteArray();
ba.writeObject(object);
ba.position = 0;
return ba;
}
}
To do the actual comparison just use these lines of code to compare the two objects.
if (SerializeUtil.ObjectToString(object1)==SerializeUtil.ObjectToString(object2))
{
// Objects are 'equal'
}
else
{
// Objects are not 'equal'
}
Thanks and Regards
Varun Rathore
Friday, May 16, 2008
Custom Event Creation and Data Passing
Passing Data With Custom Event
As being an event driven language Action Script provides the mechanism of sending any kind of object with
the event.The concept is more important when we are supposing to get value of any varialbe of mxml into
any another mxml which is far enough in the structure(Folder Structure)of our Application. It is very simple
to create any custom event for the occurence of any particular event.Within the same parent folder in which
your mxml containing the variable create a folder (let suppose with name ‘event’).In mxml let's suppose
variable of arrayCollecton ‘myCollection’ is defined and it is already assigned some data.
Now we will create a custom event ‘CustomEvent’ in the folder where your mxml(which is having that arrayCollection)is present.
Just create one action Script class file Copy and Paste the code below.
——————————————————————————————–
package myPro.events
{
import flash.events.Event;
public class CustomEvent extends Event
{
public var mybool:Boolean=true;
public var myCollection:ArrayCollection;
public function PropertyThumbEvent (type:String,myCollection,mybool:Boolean=true):void
{
super(type);
this.myArrayCollection = myArrayCollection;
this.b=b ;
}
override public function clone():Event
{
return new CustomEvent(type,myCollection,mybool);
}
}
}
——————————————————————————————–
Now at this mxml where ‘myCollection’ is present First add Metadata as below :-
——————————————————————————————–
[Event(name="myCustomEvent",type="myPro.events.myCustomEvent")]
——————————————————————————————–
Again from the same mxml just dispatch one event i.e. as:-
——————————————————————————————–
dispatchEvent(new CustomEvent(”myCustomEvent”,myCollection,true));
——————————————————————————————–
we can use it as follows:-
trace(event.myCollection)
As being an event driven language Action Script provides the mechanism of sending any kind of object with
the event.The concept is more important when we are supposing to get value of any varialbe of mxml into
any another mxml which is far enough in the structure(Folder Structure)of our Application. It is very simple
to create any custom event for the occurence of any particular event.Within the same parent folder in which
your mxml containing the variable create a folder (let suppose with name ‘event’).In mxml let's suppose
variable of arrayCollecton ‘myCollection’ is defined and it is already assigned some data.
Now we will create a custom event ‘CustomEvent’ in the folder where your mxml(which is having that arrayCollection)is present.
Just create one action Script class file Copy and Paste the code below.
——————————————————————————————–
package myPro.events
{
import flash.events.Event;
public class CustomEvent extends Event
{
public var mybool:Boolean=true;
public var myCollection:ArrayCollection;
public function PropertyThumbEvent (type:String,myCollection,mybool:Boolean=true):void
{
super(type);
this.myArrayCollection = myArrayCollection;
this.b=b ;
}
override public function clone():Event
{
return new CustomEvent(type,myCollection,mybool);
}
}
}
——————————————————————————————–
Now at this mxml where ‘myCollection’ is present First add Metadata as below :-
——————————————————————————————–
[Event(name="myCustomEvent",type="myPro.events.myCustomEvent")]
——————————————————————————————–
Again from the same mxml just dispatch one event i.e. as:-
——————————————————————————————–
dispatchEvent(new CustomEvent(”myCustomEvent”,myCollection,true));
——————————————————————————————–
we can use it as follows:-
trace(event.myCollection)
Creating FullScreen Flex/AIR/Flash Applications
Going Fullscreen in Actionscript
The main stage for the AIR application has a displayState property. The framework also contains a class, StageDisplayState, that defines three constants for the three different display states. By using these classes you can put your AIR application into any of the three display states .
PLAIN TEXTActionscript:
// Enter Fullscreen Interactive State
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
or
// Enter Standard Fullscreen State
stage.displayState = StageDisplayState.FULL_SCREEN;
or
// Enter Normal State
stage.displayState = StageDisplayState.NORMAL;
we can use these as follows :-
Going Fullscreen through JavaScript
The logic works exactly the same in JavaScript as it does in Actionscript, but the classpaths are different. You can see the examples below in Code Example 2.
PLAIN TEXTJavaScript:
// Enter Fullscreen Interactive State
window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE;
or
// Enter Standard Fullscreen State
window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.FULL_SCREEN;
or
// Enter Normal State
window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.NORMAL;
Cheers
Varun Rathore
The main stage for the AIR application has a displayState property. The framework also contains a class, StageDisplayState, that defines three constants for the three different display states. By using these classes you can put your AIR application into any of the three display states .
PLAIN TEXTActionscript:
// Enter Fullscreen Interactive State
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
or
// Enter Standard Fullscreen State
stage.displayState = StageDisplayState.FULL_SCREEN;
or
// Enter Normal State
stage.displayState = StageDisplayState.NORMAL;
we can use these as follows :-
Going Fullscreen through JavaScript
The logic works exactly the same in JavaScript as it does in Actionscript, but the classpaths are different. You can see the examples below in Code Example 2.
PLAIN TEXTJavaScript:
// Enter Fullscreen Interactive State
window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE;
or
// Enter Standard Fullscreen State
window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.FULL_SCREEN;
or
// Enter Normal State
window.nativeWindow.stage.displayState = runtime.flash.display.StageDisplayState.NORMAL;
Cheers
Varun Rathore
Thursday, May 15, 2008
Flex 4 (Gumbo)
Flex 4, codenamed Gumbo, is now beginning active development. The product plan is not yet complete, but a few themes are under consideration:
Design in Mind: provide a framework meant for continuous collaboration between designer and developer. Probably involves an additional component model that integrates with the existing Halo components.
Accelerated Development: take application development from concept to reality quickly. Features could include application templates, architectural framework integration, binding improvements.
Horizontal Platform Improvements: features that benefit all application and user types. Features could include compiler performance, language enhancements, BiDi components, enhanced text.
Broadening Horizons: expand the range of applications and use-cases that can leverage Flex. Features could include finding a way to make the framework lighter, supporting more deployment runtimes, runtime MXML.
Download Flex 4 build
Cheers
Varun Rathore
Design in Mind: provide a framework meant for continuous collaboration between designer and developer. Probably involves an additional component model that integrates with the existing Halo components.
Accelerated Development: take application development from concept to reality quickly. Features could include application templates, architectural framework integration, binding improvements.
Horizontal Platform Improvements: features that benefit all application and user types. Features could include compiler performance, language enhancements, BiDi components, enhanced text.
Broadening Horizons: expand the range of applications and use-cases that can leverage Flex. Features could include finding a way to make the framework lighter, supporting more deployment runtimes, runtime MXML.
Download Flex 4 build
Cheers
Varun Rathore
Flex Development Frameworks
1. Puremvc Framework
PureMVC is a lightweight framework for creating applications based upon the classic Model-View-Controller design meta-pattern.
2. Cairngorm Framework
Cairngorm Framework is the most widely accepeted framework with Flex development.
3. Prana Framework
Prana Framework is runtime control framework and made on the basis of spring framework.
4. Foundry
Foundry ( sbasfoundry ) is an ActionScript 3 / Java framework designed for Flex 2 applications development.
5. Guasax Flex Framework
Guasax is an ease of use programming framework to provide ordered and scalable Flex applications.
Life cycle of guasax framework is based in the MVC pattern to take on our program actions .
PureMVC is a lightweight framework for creating applications based upon the classic Model-View-Controller design meta-pattern.
2. Cairngorm Framework
Cairngorm Framework is the most widely accepeted framework with Flex development.
3. Prana Framework
Prana Framework is runtime control framework and made on the basis of spring framework.
4. Foundry
Foundry ( sbasfoundry ) is an ActionScript 3 / Java framework designed for Flex 2 applications development.
5. Guasax Flex Framework
Guasax is an ease of use programming framework to provide ordered and scalable Flex applications.
Life cycle of guasax framework is based in the MVC pattern to take on our program actions .
Wednesday, May 14, 2008
AIR Aplication Work Offline With Sqllite
We can make the AIR application work offline and synch with the database.
We can use sqllite databse for the offline display of data.
sqllite is just like mysql but it would create a *.db file in ur application folder
from where we can access the data.
A sample code for creating and executing the sqllite queries.
on creation complete we create a database contacts.
private function creationComplete():void
{
connection = new SQLConnection();
connection.open(File.applicationDirectory.resolvePath('contacts.db'));
var statement = new SQLStatement();
statement.text="CREATE TABLE IF NOT EXISTS contacts (ID INTEGER PRIMARY KEY AUTOINCREMENT, action TEXT, inputXML TEXT, outputXML TEXT)" ;
statement.sqlConnection=connection;
statement.execute();
var statement = new SQLStatement();
statement.text="CREATE TABLE IF NOT EXISTS offlineRequest (ID INTEGER PRIMARY KEY AUTOINCREMENT, action TEXT, inputXML TEXT)" ;
statement.sqlConnection=connection;
statement.execute();
}
This is very fast and effective too.
Cheers
Varun Rathore
We can use sqllite databse for the offline display of data.
sqllite is just like mysql but it would create a *.db file in ur application folder
from where we can access the data.
A sample code for creating and executing the sqllite queries.
on creation complete we create a database contacts.
private function creationComplete():void
{
connection = new SQLConnection();
connection.open(File.applicationDirectory.resolvePath('contacts.db'));
var statement = new SQLStatement();
statement.text="CREATE TABLE IF NOT EXISTS contacts (ID INTEGER PRIMARY KEY AUTOINCREMENT, action TEXT, inputXML TEXT, outputXML TEXT)" ;
statement.sqlConnection=connection;
statement.execute();
var statement = new SQLStatement();
statement.text="CREATE TABLE IF NOT EXISTS offlineRequest (ID INTEGER PRIMARY KEY AUTOINCREMENT, action TEXT, inputXML TEXT)" ;
statement.sqlConnection=connection;
statement.execute();
}
This is very fast and effective too.
Cheers
Varun Rathore
Subscribe to:
Posts (Atom)
About Me
- vrathore
- noida, dehli, India