Archive for the ‘Adobe’ Category

Spring BlazeDS Integration 1.0 is available

Thursday, June 11th, 2009

The final version of Spring BlazeDS Integration 1.0 is available now. Since RC2, SpringSource enhanced the documentation and made some improvements on the messaging adapter. More information about the final version are available on the blog of SpringSource and in the offical annoucement.

You can download the BlazeDS Integration here and the documentation can found here.

Tour de LiveCycle and LiveCycle Cafe

Thursday, June 11th, 2009

Adobe published to AIR applications around Adobe LiveCycle. The first application is the big brother of Tour de Flex, called Tour de LiveCycle. This applications provides all nessecary information to start programming and using Adobe LiveCycle.

Tour de LiveCycle at Adobe Developer Connection: Link

The other application call LiveCycle Cafe and provides the latest news, upcoming events and other information around Adobe LiveCycle ES. So you can’t miss anything what’s going with Adobe LiveCycle ES.

LiveCycle Cafe at Adobe Developer Connection: Link

Actionscript3 based Google Analytics Solution for Flash and Flex

Thursday, June 11th, 2009

If you wanted to track a Flash or Flex based application with  Google Analytics, you had to use the ExternalInterface to call the function of the JavaScript library. While search for a solution which isn’t using JavaScript, I found out that Google now provides some ActionScript3 libraries for Google Analytics.

You can find the documentation here and the libraries here.

The nice thing about the library is that you have the choice whether you want to use a ActionScript-Only solution or combine JavaScript and ActionScript. The only difference between both solutions is one parameter when calling of constructor of the tracker.

Using annotated RemoteServices with the Spring BlazeDS Integration

Saturday, May 16th, 2009

On Wednesday, I found the time to test the annotation based configuration of the Spring BlazeDS Integration. Because it isn’t as easy as I thought, I wrote this little guide with all necessary configurations. You can download the sample project here.

First you have to create a new Flex Project in Flex Builder, select as Application server type “J2EE” and use LiveCycle Data Service as Remoting. Click the button “Next”.

annotated_spring_blazeds_step1

Now you have to select the BlazeDS WAR file and click the button “Finish”.

annotated_spring_blazeds_step2

Under Project > Properties > Flex Compiler you have add -services and behind the path to the services-config.xml (Screenhot), like in all other BlazeDS oder LiveCycle DS Applications. During the compile process the compiler creates an Actionscript class with the information of this file. The services-config.xml can found under the WEB-INF/flex. This file contains the definition of the MessageBroker and references to the messaging-config.xml and the remoting-config.xml. In the remoting-config.xml, you can find the definitions of the RemoteObjects and in the messaging-config.xml all messaging configurations.

services-config-xml

You can delete these two files because the RemoteObjects and Messaging will now defined in your Spring application. You must also delete the references to these files in the services-config.xml. The content of the services-config.xml should now look like this.




    
        

        
           
        

    


    
        
        

        
    

    

        
            
        

        
            
            
                false
            
        

        
            
            
                true
                4
            
        
        
	
		
		
			true
			5
			60000
			1
			200
                	
				
				
				
				
				 
				
				
				
				  
				
				
				
				
				
				  
				
				
				
                	
		
	        

        
            
        

        
    

    
        
            
                [BlazeDS] 
                false
                false
                false
                false
            
            
                Endpoint.*
                Service.*
                Configuration
            
        
    

    
        
            false
            
        
    


Now you have to configurate the Dispatcher Servlet, which get the information from the Flex application. Normally, you can find the definition of the MessageBroker Servlet in the web.xml. The Spring BlazeDS integration defines the MessageBroker in applicationContext.xml and uses a Dispatcher Servlet to transfer the Flex request to the MessageBroker. So, you have to replace the Flex related configuration in the web.xml. The file should now look like this:



	AnnotatedService

	
		contextConfigLocation
		
			/WEB-INF/config/web-application-config.xml
		
	
	
	
	
		org.springframework.web.context.ContextLoaderListener
	
	
	
		dispatcherServlet
		org.springframework.web.servlet.DispatcherServlet
		1
	

	
    	dispatcherServlet
    	/messagebroker/*
 	

     
		main.html
	

Now, you need a configuration file for the DispatcherServlet. Because I named the DispatcherServlet instance “dispatcherServlet”, I have to create a file with the name “dispatcherServlet-servlet.xml” in the folder WEB-INF.





The next step is to configurate the MessageBroker in applicationContext.xml. Till now, you can use also for not annotated configuration of Spring BlazeDS integration.

	
		
	

A annotated configuration needs some additional lines to scan the source for the spring annotations. The base-package specifies where Spring should start to search for annotations.

	
	

The applicationContext.xml should look like this:




	
	
 
	
		
	


The last step is to add the annotation in the Java class. You have to add the @Services, the @RemoteDestintion and the protocol you will use for the transfer above the class definition. When a method should be accessable via BlazeDS, you have to add above this method @RemoteInclude annotation otherwhise the @RemoteExclude annotation.

package test;

import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.flex.remoting.RemotingExclude;
import org.springframework.flex.remoting.RemotingInclude;
import org.springframework.stereotype.Service;

@Service
@RemotingDestination(channels={"my-amf","my-secure-amf"})
public class SampleService {

	// accessable via BlazeDS
	@RemotingInclude
	public String getMessage(String name){
		return "Hello "+name;
	}

	// not accessable via BlazeDS
	@RemotingExclude
	public String getMessage2(String name){
		return "Hello "+name;
	}
}

The name of the RemoteObject is same as Java class name but with the first letter is a lowercase. In my example the name of the RemoteObject is “sampleService”.



	
	
		
	
	
	

I hope this guide helps setting up a Spring BlazeDS application using annotations.

Next Flex Builder renamed to Flash Builder

Saturday, May 16th, 2009

Yesterday Ted Patrick officially announced that the upcoming version of Flex Builder will renamed to Flash Builder via Twitter. The last months Adobe forced to speak about the Flash Platform, the new interaction design tool for Flex application was called Flash Catalyst and now the next foreseeable step comes: Flex Builder becomes Flash Builder.

I’m not really sure, what I should think about the hole renaming. From the stand point of Product Marketing, it’s clear. The end result of all IDEs is a SWF running in the Flash Player. In the entreprise world, Flash has no good reputation. This is cause the millions of bad animations and ad banner produced with Flash in the last years. I don’t think the renaming of the product makes it easier to convince decision maker to use Flex for their applications. If Flash hadn’t this negative connotation this renaming wouldn’t be as critical as it is. It looks like we must start talking about the Flex Framework instead of Flex.

More information about the renaming can found on the blogs of the Adobe evangelists: Duane Nickull, Lee Brimelow and Serge Jespers.

PS: Ted Patrick, who announced the renaming changed the name of his blog from “Ted on Flex” (onflex.org) to “Ted on Flash” (onflash.org) about 3 months ago.

PSS: SAP calls it Flex based solutions also Flash Islands and not Flex Islands.

Spring BlazeDS Integration 1.0.0.RC1 Released

Thursday, May 7th, 2009

Today, Spring published the first Release Candiate of the Spring BlazeDS Integration. http://www.springsource.org/spring-flex

One of the new features is the annotation-based configuration of Remote Desitinations. You can include and exclude function, which should publish as Remote Objects. The annotation-based configuration really simplifies the configuration of BlazeDS, if you have a big and complex application. Loving it.
An other feature of this release is the full integration of the BlazeDS Message Service.

Next Thursday, Adobe and SpringSource having a Connect Session/eSemiar about the Spring BlazeDS Integration.

Registration: http://www.adobe.com/cfusion/event/i…2539&loc=en_us

dttl.tv relaunched!

Tuesday, May 5th, 2009

On time for the World Table Tennis Championships in Yokohama, the website of the German Table Tennis League (dttl.tv) was relaunched last week. The main element of the relaunched website is a new video player, based on Adobe Flex and the Adobe Flash Media Server. You can find all games of the German Table Tennis League in full length, interviews and the top rally of the day.

On May 15th 2009, the first live stream (19th match day of the German Table Tennis League) of the new website will avalaible.

To manage all the videos and streams, the player has a backend system based on BlazeDS, Spring and Hibernate.

Have fun and visit the website of the best Table Tennis League worldwide to see some of the most brillant table tennis players.

PureMVC Skeleton for Flash Media Server Applications

Tuesday, March 3rd, 2009

While searching for some Flash Media Server informations, I found a PureMVC Skeleton for Flash Media Server Applications on Stefan Richter’s Website. The skeleton provides the logic for the connection to Flash Media Server, but not any implementation of a video player.  I will use the skeleton in a video portal project, which I’m planning for a customer at the moment. Nice stuff.

Using JasperReports in your Flex Application

Sunday, February 15th, 2009

Last week, I came cross the Flash Viewer for JasperReports. JasperReports is an OpenSource Java Framework to build Reports based on different data sources. We’re using in our projects JasperReports to generate PDF reports, too.

The Flash Viewer Project is using the Flex SDK to render the JasperReports for the HTML or Web based application. All source files of the viewer are available, so that you can customize the viewer for your needs.

But you can’t replace a interactive Flex chart component with the report viewer, because the viewer only generates a static output of the report. You can also using the JFree Chart extensions of the JasperReports, but neither the Charts nor the Text Information are selectable. If you’re changing any data of the report, you have to fill the report again in your Java Backend and rerender the report with the viewer.

So, using the viewer make only sense if you using it as preview of the report or if your reports aren’t as complex and interactive. And the best thing about the viewer is that you can use the same source file for your web and print output.

Additional Infos:

To use the Flash Viewer, you have to setup a Java web server like (Tomcat…) and run the webapp of the Flash Viewer. You get the webapp, if you download the project zip of the Flash Viewer. To display a report, you have to compile the report definition (jrpxml file) and fill the the compiled report. After that, you can use the Flash Viewer to display the report. The project zip contains a sample report, which demostrates how to use the flash viewer.

Number in Flex3 and the decimal separator

Tuesday, February 3rd, 2009

Today, I decided to write my first blog post in English. The reason for this post is the implementation of Number in current Flex3 SDK. I haven’t used Number as input for a while, the last time about one or one and half years ago. What had changed during this time: You can’t directly parse a String into Number if you using a comma as decimal separator.I used the resource bundle properties to change the decimal and thousand separator.

SharedResources.properties:

# CurrencyFormatter, NumberFormatter, Slider
decimalSeparatorFrom=.
decimalSeparatorTo=,
thousandsSeparatorFrom=,
thousandsSeparatorTo=.

validators.properties:

# Currency/Number Validator
allowNegative=true
decimalSeparator=,
maxValue=NaN
minValue=NaN
thousandsSeparator=.

If you trying parse the String into Number using current 3.2.0 Flex SDK, the result is always NaN. In Flex 2 this transformation worked perfect.

var s:String = “0,5”

var n:Number = Number(s);

=> n = NaN

Also the parseFloat function can’t parse the String into Number. The function cuts off the decimal value of the Number if you using a comma. The only way to do this transformation is using a regular expression to replace the comma with a point and than transform the String into a Number. If you have multiple input fields with numbers, this is no satisfying solution.

When I read some JIRAs at the Adobe Bug and Issue Management System, I found a couple of bugs which are related to this problem. The NumberValidator and CurrencyValidator doesn’t work correct if you using a comma as decimal separator. They can’t validate if the number is in the range of min and max values of the validator. Before comparing the input against the min and max values they transform the String into Number by using following code.

var x:Number = Number(input);

The result of this transformation using a comma as decimal separator is always NaN.  Line 295 of the NumberValidator and line 343 of the CurrencyValidator Adobe uses this transformation. So, the validation of min and max couldn’t work using a comma.

Please, Adobe correct the implemtation of Number.