11
May

Adobe Share ActionScript library goes community - Updated! Now with PDF Support!

sharelogolong.jpg

Don’t you just love an exciting headline. If you haven’t heard by now, Share (Document Services API) is an online service provided by Adobe that allows you to share, publish, and organize documents online. Share is already a good service, but it can be an even better service with a little help from all of us. How can we make the service better?

1. Use the service and give feedback on the Share Forum. Whether you’re happy or not they want to hear about it. Have a feature idea, pass it on.
Share Forum
Share API Forum

2. Tell other people about the service. Its 1gb of free space for your documents. Who doesn’t like free.
https://share.acrobat.com

3. Create and share your own projects around the service.

4. Contribute to open source projects that use the Share API.

There are many open source libraries that allow you to easily use the Share Service in your applications (listed at the bottom). One of these libraries is the ActionScript library. Developed internally at Adobe, it has the full original functionality of the service but has fallen behind in the latest revisions of the Share Service. So when speaking to Fang Chang (Adobe Product Manager in charge of the Share APIs) this past week I offered to help bring an updated version of the ActionScript library into the hands of the community. Fang who is a very patient man, (listened to all my feature idea ramblings) felt like it would be a great move. So here we are.

What has been done?

1. The as3 library has been updated to work with the new endpoint and pdf creation support has been added
2. Updated AirShare demo for the release version of AIR.
3. The code has been checked into subversion

4. Documentation has been generated

5. A release has been made that includes the updated source/example.

Example of upload with pdf creation:

import com.adobe.share.api.ShareAPIToken;
import com.adobe.share.api.ShareAPIEvent;
import com.adobe.share.api.ShareAPIUser;
import com.adobe.share.api.ShareAPI;
 
private var _shareAPI:ShareAPI = new ShareAPI("<api key>", "<secret>");
private var _shareAPIUser:ShareAPIUser = new ShareAPIUser("<share user name>", "<share password>");
 
private var _file:File = new File();
 
private function initApp():void{
	var shareAPIToken:ShareAPIToken = _shareAPI.login(_shareAPIUser);
 
	shareAPIToken.addEventListener(ShareAPIEvent.API_AUTHENTICATED, function():void{
		_file.browse();
		_file.addEventListener(Event.SELECT, onFileSelected);
		_file.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, onFileUploadComplete);				
	});
 
}
private function onFileSelected(event:Event):void{
	_shareAPI.uploadFile(_shareAPIUser, _file, null, _file.name, "", true, true);
}
private function onFileUploadComplete(event:DataEvent):void{
	trace("complete");
}

Want to contribute to the Library?
Please contact me or select join from the project site.

Other Share Libraries:
Java Library
Ruby (Developed by Hideyuki KATO) Ruby
Python (Developed by Vivek Kapoor) Python
Cold Fusion (Developed by Ray Camden) Cold Fusion

28
Apr

Web Expo 2.0 thoughts: Getting my hands Meshy and is Curling a game that will really take off?

web2.jpg

I was busy last week and unable to make it to most of the show, but I did use my free expo pass on thursday morning to see the Keynotes, a mesh demo, and take a pass through the expo hall. Overall it was worth it. At the very least I now have a new t-shirt for every day of the month.

mesh.jpg

During the brief visit I sat in on a Mesh Demo. If you don’t know what Mesh is, its something between FolderShare, Groove, and .Mac with web services (if you dont’ understand what these things are then go here (mesh.com) for a better explanation. It has been awhile since Microsoft released something that made me feel itchy. You know the way you felt itchy when the iPhone first came out. That I got to have that itch. An itch that must be scratched.

In the beginning of the demo I was apprehensive. Would you be able to show me an open platform that could back up Meshs ability to run on anything? Or would you show me another FolderShare (which i love) that runs on windows and runs on mac if you don’t mind that its powerpc and hasn’t been updated in years. In the end I found myself pleased with Ori Amigas presentation of how the service level architecture works. In the presentation Microsoft had a list of other technologies that they would work with the community on getting libraries built for. One on the list was Flash, which immediately made me go hmm… After the show I asked Ori if when I got home I would find a crossdomain.xml file on the API server. To this he responded by saying it was something they were working out the details on. So no, but yes, I think. He also said that they are only allowing a limited amount of 3rd party developers in at the moment. In the demo Ori showed syncing between a Mac, Vista, Online desktop and to put it simply I liked it. After getting home, I signed up for Mesh and when going to add my mac as a device it just said “coming soon”. That being the case, I’m going to be on hold with this technology for a bit. Overall, I’m pleasently pleased with the potential (you know i’m happy when alliteration just comes out) and am looking forward to using Mesh. I even went over to the Microsoft booth and thanked them for giving me something to be excited about. They seemed slightly caught off guard by my complements and they tried to give me more shirts. I settled for just seeing genuine smiles all around. (they didn’t know that i already had 2 of those shirts :))

Next up: Curl

curl.jpg

Curl Nitro is an emerging RIA technology that is trying to position itself as a competitor for AIR and Silverlight. I already feel like I’ve spent too much time on Curl for the moment so i’m just going to give you a link to a blog entry by Gary Gibert about Adobe vs Curl. It contains pretty much what you would expect including the required AIR vs Curl employee flame war in the comments. So here you go.

View Gary Gilbert Article

The comment I left at the end of the article:

Wow thats a lot of talking. I just wanted to chime in to say that i also wandered over to the Curl booth during 2.0 and spoke with Richard. First Richard is a nice guy, he’s a nice guy who happens to be a small fish in an ever growing pond (soon to be ocean).

Admittedly i have not read all of the comments here. Frankly i’d rather spend this beautiful day playing frisbee at the park. But I do feel like just stating basically what I told Richard after he gave me a product demo with the “performance” spiel.

If you’re going to make these performance comparisons then you should make two applications. One AIR and one CURL that do the same thing and show off performance in various scenarios (data load, 3d, etc…). Then provide the source code for both applications.

An after thought I had about it is make an awesome application that uses curl. Showing me a demo of a spinning DNA strand will get you no where when courting flash/flex developers. Its hot but I want something more substantial if we’re going to be in it for more than a one night stand.

Adobe and the dev community is constantly showing me hot and substantial AIR/Flex applications. To me the idea of taking on Silverlight and AIR head on like in your curl.com home page airplane animation analogy (btw done using flash) is comical in a very sad way. You know Ha Ha sad, not Ha Ha funny.

So pony up some applications done in CURL people want to use. Not because its CURL but because they’re cool and useful applications. And show some clear differences on why CURL is better because it fulfills some needs AIR developers have but are not getting. Then maybe we’ll consider putting it on our ever growing tool belts.

On the plus side I did mention that Adobe always buys the beer and they offered to take me out for one after the show. I wasn’t able to take them up on it but its a good first step in any developer relationship.

Off to the park. -s

29
Mar

Handout updated to use Share improvements (Well, the ones you can use more than 5 times)

Adobe Share has received a much needed update to its document embed capability. The previous version required keen eyesight or the use of a magnifying glass to read the embedded docs. The new version has received the “fullscreen” button treatment. I consider this the only real way to read these documents. Really… how many times have you read embedded documents in blog pages even if they have adequate scaling controls in place (Scribed, etc…)?

Magnifying Glass

The second update to Share is the ability to generate PDF versions of your uploaded documents. Which is really awesome all “five” times you’re able to do it. As advertised on the login page you get 5 conversions. There doesn’t seem to be any way to get additional conversions and there isn’t any explanation on whether more will be possible in the future (that I could find). I recommend you just ignore that “Convert to PDF” button for now. Why? Because if you’re anything like me the “neat” factor will be far outweighed by the “aggravation” factor in this case.

Sharelimit

If in the future they do open up the PDF creation, then I will definitely add it to the Handout program. In conclusion it is good to see improvements being made to the Share service. I expect these improvements to get more exciting in the future, hopefully with ties coming between applications and services such as Buzzword, Share, Digital Editions, etc…

Get the latest version of Handout
Read more about Share updates at the Share Blog

13
Mar

How to get Safari Technical Books Online for free +more

I’m completely serious about this next sentence. Get a library card. The San Francisco public library (and many others) offer Safari Online for free. The library also has these things on shelves called books, they are made of paper(comes from trees) and have words in them. I highly recommend checking them out.

sfmain.jpg

Personally I love the library, I’m not afraid to say it. Try it out and you will too.

Although sometimes at the SF Main library Nicolas Cage will show up and just stare at you. He doesn’t want your seat or anything, he just stares.
niccage.jpg

SF Library Card Sign-up
Safari SF library Link

09
Mar

My code look pretty one day (or turning your GeSHi install into a service and using it with AS3)

File this one under “when I could have been creating something useful, I created this”

Hmmmm

I’ve been using PrivatePaste.com quite often of late and thought hmm… it would be simple to create a quick as3 library for using the service. Unfortunately PrivatePaste isn’t intended to be used as a web service. This means we can post and get a result, but it will be html. The site also lacks a crossdomain.xml file. While parsing the HTML using a regular expression, it occurred to me that privatepaste just uses GeSHi. A php open source library for syntax highlighting.

Since I already have the GeSHi wordpress plugin setup on this blog, I figured why mess around with parsing an HTML page when I can just make a quick syntax highlighting service myself. All you need to do is add the following file to the directory containing GeSHi. If you’ve installed the wp-syntax plugin (or any highlighting plugin that uses GeSHi) for your wordpress blog then its under /wp-content/plugins.

include('geshi.php');
 
if ( get_magic_quotes_gpc() ) $_POST['source'] = stripslashes($_POST['source']);
 
$source = $_POST['source'];
$language = $_POST['format'];
$path = 'geshi/';
 
$geshi = new GeSHi($source, $language, $path);
 
if($_POST['linenumbers'] == "true")
	$lineoption = GESHI_NORMAL_LINE_NUMBERS;
else
	$lineoption = GESHI_NO_LINE_NUMBERS;
 
 
$geshi->enable_line_numbers($lineoption);

echo $geshi->parse_code();

Thats it, you now have a GeSHi service. To use your service in ActionScript 3 you can use as3geshilib that I’ve included in the download:
GeSHi AIR

private function parseCode():void{
	var geshiService:GeshiService = new GeshiService();
 
	geshiService.addEventListener(GeshiResultEvent.ON_GET_PARSE_CODE, function(event:GeshiResultEvent):void{
			trace(event);
			htmlDisplay.htmlText = event.data as String;
		});
 
	geshiService.parseCode("SELECT * FROM user_table", GeshiFormatType.SQL, true);
}
geshiservice.zip Includes geshiservice.php, as3geshilib - source included

In the end, what we really have here is an example of how to make a quick php service and use it in ActionScript. Which I guess is not a complete waste of time…

If you just need syntax highlighting in your AS3 project then I would recommend checking out this AS3 code highlighting library http://labs.searchcoders.com/text/. I haven’t checked it out yet, but plan to the next time my code runs off on a tangent.

07
Mar

Stefan Sagmeister at Design Matters: For designers, developers, everyone.

Stefan Sagmeister

When your average developer hears about a design conference or lecture they often don’t give it a thought. Its like a developer sitting in a meeting while designers argue over fonts. Early in my career I often didn’t pay designers any mind, but as I matured I realized that there was a lot to learn from them and that design isn’t all about fonts and colors. Sagmeister is a designer that when he gives a lecture every developer should shut their laptops and pay attention.

Stefan is in a unique position of being able to take basic principles he has learned from life and turn them in to design (and make a living at it). These principles aren’t design principles, they’re life principles. A simple set of ideas that if you can live by them could actually improve your life.

Here is the list (Things I have learned in my life so far) that he went over in his presentation lastnight at AIGA DesignMatters in SF:

sageverythinglarge.jpg

Everything I do always comes back to me.
Complaining is silly. Either act or forget it.
Thinking life will be better in the future is stupid. I have to live now.
Being not truthful works against me.
Organizing a charity group is suprisingly easy.
Drugs feel great in the beginning and become a drag later on .
Over time I get used to everything and start taking it for granted.
Money does not make me happy.
Traveling alone is helpful for a new perspective on life.
Assuming is stifling.
Keeping a diary supports my personal development.
Trying to look good limits my life.
Worrying solves nothing.
Material luxuries are best enjoyed in small doses.
Having guts always works out for me.

In the end it was a really enjoyable (and funny) lecture. And as for the developers out there. Listen to the designers and creative directors you work with. They may have more to offer than you think.

Contribute things you have learned in your life to the website

Information on upcoming AIGA events (Devs sign-up you won’t regret it)
Sagmeisters website
Watch an interview of Stefan Sagmeister
Watch a talk given by Stefan Sagmeister

Thanks to my girl Kelly for turning me on to this guy and to Lee a creative director I used to work with who always encouraged me to attend events like these.

04
Mar

Silverlight to run on linux! Oh wait that was last year.

Silverlight

So I’ve heard a few people today mention that Silverlight is going to be running on new nokia handsets. (Article 1, Article 2)

I especially enjoyed the end of the article 1.

Nokia is only prepared to say that a Silverlight developers’ kit is “intended” to be available during 2008, and that versions for S40 and Nokia Internet Tablets will be “confirmed later”.

Given how enthusiastically Nokia has endorsed every other Web 2.0 technology, its reticence is both uncharacteristic, and a little worrying.

Come on. Can’t microsoft stay focused on anything for more than 10 minutes. Please just show me another demo of silverlight running on my giant touchscreen coffee table. It works great when my cats not sleeping on it.

Microsoft Surfacecatdrawersm.jpg

In conclusion. Microsoft please fix my Vista Media Center First. I would like a Netflix Watch Now plugin and to not have to reboot it every couple of days.

You know what I do like, SQL Server. Good job with that.

Thank you Ben for giving me my mornings rant. Its like most people without coffee.

Link to last years article on Silverlight for linux

03
Mar

Pownce Actionscript 3 Library Released - Full API V2.0 Implementation (Upload files and everything)

Now that Pownce has released an official API covering features such as posting files, I decided to go ahead and make an AS3 library for it. I just posted it to googlecode and have only done minimal testing on it. I would appreciate any feedback.

The Pownce team did a terrific job with the API. Easy to use and consistent. I had minimal issues while creating the as3 library.

In my opinion (yeah you can skip this) Pownce is a far better user experience than Twitter. Its like a gobot and a transformer or a dell laptop and a macbook or chocolate torte and hohos. That is the best I an come up with that the moment, yes.

torteHoHos

I could be missing something here… but this API in my mind is a leap forward in the race with twitter.

// Imports omitted for brevity
private const APP_KEY:String = "<your app key>";
 
private var _pownceService:PownceService;
private var _testUsername:String = "<Pownce username>";
private var _testPassword:String = "<Pownce password>";
 
private function initApp():void{
	_pownceService = new PownceService(APP_KEY);
	_pownceService.setAuth(_testUsername, _testPassword);				
}
 
// Example of posting a file
public function testPostAFile():void{
	var file:FileReference = new FileReference();
 
	_pownceService.addEventListener(PownceResultEvent.ON_POST_A_FILE, function(event:PownceResultEvent):void{
			var pownceResult:PownceNotesResult = event.data as PownceNotesResult;
 
			if(pownceResult.success){
				trace((pownceResult.notes[0] as PownceNote).body);
			}else{
				trace(pownceResult.statusCode);
				trace(pownceResult.message);
				trace(pownceResult.request);
			}
		});
 
	file.addEventListener(Event.SELECT, function(event:Event):void{
			_pownceService.postAFile("all", event.currentTarget as FileReference, "File upload test");
		});
	file.addEventListener(ProgressEvent.PROGRESS, function(event:ProgressEvent):void{
			trace(event.bytesLoaded + "/" + event.bytesTotal);
		});
 
	file.browse();
}
private function testGetNoteList():void{
 
	_pownceService.addEventListener(PownceResultEvent.ON_GET_NOTE_LIST, function(event:PownceResultEvent):void{
			var pownceNoteResult:PownceNotesResult = event.data as PownceNotesResult;
 
			if(pownceNoteResult.success){
				trace(pownceNoteResult.notes.length);
			}else{
				trace(pownceNoteResult.statusCode);
				trace(pownceNoteResult.message);
				trace(pownceNoteResult.request);
			}
		});
 
	_pownceService.getNoteList(_testUsername,null, 100, -1, -1);
}

I’m going to continue to test the library and improve the documentation. Let me know if I missed anything (outside of OAUTH).

Add me to your Pownce http://pownce.com/InitApp/

Existing issue:
One method is not currently working. It is the retrieval of the send to list. I’ve posted information about the issue to the google pownce group and hopefully it will be resolved soon.

29
Feb

Posting a Note/Link to Pownce with ActionScript and the New Pownce v2.0 API

So this morning Pownce finally released a true API that allows us to use the full functionality of Pownce. A while back I posted information on how to do this in a reverse engineered method, but now we can do it without the feeling that we might be doing something bad (although that can be fun sometimes to can’t it).

The code sample below shows how to Authenticate to the service using HTTP Basic Authentication and posts a note/link.

Steps to take
1. Get a pownce account if you don’t have one.
2. Register to get an application key.
3. Use the following code. Change “app_key” to your application key. Change “login” and “password” to user you want to post with.


Private Paste Link to Code

import mx.utils.Base64Encoder;
 
private const APP_KEY:String = "<app_key>";
 
public function initApp():void{
	sendNote(
		"Example of note in the new API.",
		"http://pownce.com/initapp",
		"<login>",
		"<password>"
		);
}
public function sendNote(note:String, link:String, login:String, password:String):void{
	var urlLoader:URLLoader = new URLLoader();
	var urlRequest:URLRequest = new URLRequest();
	var urlVariables:URLVariables = new URLVariables();
 
	var authHeader:URLRequestHeader = new URLRequestHeader("Authorization", "Basic " + base64Encode(login + ":" + password));
 
	urlVariables.note_to = "public";
	urlVariables.url = link;
	urlVariables.note_body = note;
 
	urlRequest.requestHeaders.push(authHeader);
	urlRequest.url = "http://api.pownce.com/2.0/send/link.xml?&app_key=" + APP_KEY;
	urlRequest.data = urlVariables;
	urlRequest.method = URLRequestMethod.POST;
 
	urlLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus);
	urlLoader.addEventListener(Event.COMPLETE, onComplete);
 
	urlLoader.load(urlRequest);
}
private function onHTTPStatus(event:HTTPStatusEvent):void{
	trace(event);
}
private function onComplete(event:Event):void{
	trace(event);
}
private static function base64Encode(data:String) : String
{
    var encoder:Base64Encoder = new Base64Encoder();
	var bytes:ByteArray = new ByteArray();
	bytes.writeUTFBytes(data);
 
    encoder.encodeBytes(bytes);
    return encoder.flush();
}

If you want to hear more of my occasionally relevant information then add me to your friends in pownce: http://pownce.com/InitApp/


Note: I did this example using Flex and used mx.utils.Base64Encoder. If you’re not using Flex you’ll need to use an alternate package for your Base64 encoding.

16
Feb

The Sony Style Cage Match

When you hear the word notebook you think of something you can just throw in your bag. Something you can carry around with you anywhere without notice, like a comb or wallet. Lets face it, when it comes to computers, notebook doesn’t equal notebook.

Currently I’m in the process of trying to find that “true” notebook. The computer that I can “always” carry with me and yet is powerful enough to develop on (flash, flex). After much research and investor meetings (involves my girlfriend and many back rubs), I’ve narrowed the search down to either the Macbook AIR or a Sony VAIO TZ.

Macbook Sony TZ

Being in the final round of the decision making process I decided to visit the Sony Style Store at the Metreon, and the Apple Store in downtown SF. First I stopped over at the Metreon which also has a theatre where I watched Jumper the movie. I wish I could say it was a great movie, but it wasn’t. The most annoying part was how Skywalker jr/sr kept mentioning being in a Marvel Team-Up comic, too bad his super power isn’t acting. This is mentioned to be fair about my mind set when visiting the Sony Store.

Sony Metreon

The layout at the Sony Store is fairly sheik. Its somewhere between Tokyo cyber-chic and Sharper Image chic. I realize that is a wide range. Toyko being bad-ass and Sharper image just being, why would I want to pay $400 dollars for air purifier/alarm clock bad. Anyway, its right in the middle. When you walk in you realize that Sony has cool toys, the kind of toys you just want to pick up and hug, and pet, and love. They give you the kind of body buzz excitement you used to get on that once a year trip to toys-r-us when you were a kid.

bodyslam.jpg

This is where the fun stops, lets start with the security guards. They have the look of former pro-wrestlers who couldn’t quite make it and are aiming to make one more body slam happen before they retire. Honestly, I’m extremely timid about picking up any of the cool toys for fear that I may be that last body slam.

aibo1.jpg

So what can we do to resolve the security guard issue? First, lets change their CIA-esque attire. Put them in AIBO t-shirts and put smiles on their faces. Then, move them from hanging over my shoulder to the front of the store where they greet people as they come in. They could say things like… I don’t know “Welcome” and “Have fun!”. Remove their Rocky 4, The Russian, “i must break you” presence and replace it with the “protective older brother” that loves you, and is just there to look out for you and make sure you’re having a good time.

Happy wrestler

Now lets move on to the sales people. The guy might as well have been trying to sell back to me my overclocked, 200MHz pc circa 2000 with the IBM processor that overheated so bad that I would just leave the case off the computer and set it next to an open window during the Michigan winter to keep it running smooth. What I’m trying to say is that they lack passion for what they sell. When I ask you about the TZ in comparison to the Macbook AIR, there is no reason to boot in to the Shutdown defensive safe mode. You would think that I’m a lawyer putting them on the stand with simple questions about battery life. The bottom line is that Sony computers are high quality computers and its cool to represent that. I believe that they can stand next to the Macs, and I wouldn’t be in the store shopping if I didn’t. Especially since I’ve admitedly been a bit of a Mac zealot over the last few years. I was looking for a reason to get the TZ at the store and all I got from the Sales person was a cold stare, and re-read of the card on the stand next to the notebook. (I can read on my own thank you)

Apple Sales Person

The review of the sales person at the Sony Store wouldn’t have been so harsh if my experience at the Apple Store hadn’t been the polar opposite. When I asked the Apple person about the AIR and the TZ they proceeded to take me to a computer and pull up, “using the Internet”, specs on both computers. Not to get off on a tangent here but having the Internet connection available on all of the computers just seams like a no-brainer to me. With the Internet there, I’m more likely to stop in, spend more time there, and more likely to buy there. Anyways, back to the apple sales person. They gave me a fair and balanced comparison of the two computers. Of course they leaned more to the AIR but they in no way dogged the TZ. Above all, the friendliness of the apple sales people showed through, and I felt like this is someone I could hang out with. And most of all… at no time while at the apple store did I feel like I was in danger of receiving a pile-driver.

pro-wrestling-11.gif

Believe it or not I’m still on the fence with this decision. I do like the Sony but feel I’m lacking in “special moves”. I have perfected the “magnum” but that only seems to work on my girlfriend.

The Magnum





flickr