Sunday, October 21, 2012

(Almost) Free Flex Course and Tutorial

Since parting company with Adobe in November 2011, I have wondered what to do with my Flex and AIR expertise.  My new company (Technoracle Advanced Systems Inc.) is focusing in a new direction and we have an alpha produce that can translate PDF forms into mobile forms that run on any device.  Anyone wanting to leverage their Adobe LiveCycle ES investment to run on mobile might want to take a close look at what we are doing.  

While focusing on this, I have also been working on a conveyance of state of the art knowledge of CS 6.  I feel that this knowledge accumulated in Flex and AIR is worth sharing and is a good value from Mac Pro Video.    If anyone is seeking a series of tutorials for Adobe CS6 Flash Builder, I have begun recording a 15-20 part series in how to use this technology.  it will be released in a series of video courses over the nest few months.  Beginning with Flash Builder 101, the introduction, the courseware will eventually end in developing complex mobile applications that use accelerometers, dynamic maps, GPS and more.

MacProVideo has commissioned a series of video tutorials, each covering around 20 unique lessons.  As an Adobe MAX Master for two consecutive years, I like to imagine that the courses I have developed are worth of being in the top 0.5% (requirements for MAX Master).  The result has been to put these into production.

Here are are the links to the first courses.  The curriculum has a lot fo thought put into it in order to make it the most effective way to learn the technology in the least amount of time.

The Intro to Flash Builder 101 is available at http://www.macprovideo.com/tutorial/flash-builder-101-intro-to-flash-builder.  If you are familiar with setting up applications and building Hello World, this may be a bit primitive but things progress faster from here.

Flash Builder 102: Working with Layout Containers continues the learning path to get to the basics of how to architect and design your application's layout.  The complete instructions to build a functional word processor are also included.

Flash Builder 103: Building a Fille Browser Application advances the learning curve very quickly and shows how to add images and deploy the built-in graphical themes that get you quickly design and building an attractive UI (User Interface). You’ll also learn how to set up the FileBrowserDataGrid object – the heart of this powerful app.  This will show you how to work with the File Systems on both desktop and mobile applications.

The next batch of 3 more videos will build on this knowledge and take it further.  Please note that while the company offering the courses is named "Mac Pro Video", the courses are designed too be effective for both PC and OSX versions of CS6.

Also - for the first 100 people who buy this, I will include source code for mobile applications if you email me at duane at technoracle-systems for com.   This is an offer limited to November 15 and not endorsed officially by  Mac Pro Video, just a special promise from me ;-)










Monday, October 01, 2012

Document tracking at it's finest!

One of Technoracle Advanced Systems (my new company) customers has launched a great service today that allows document users to track the use of and control their documents over the lifecycle of the document.  They have built a very simplified and powerful web based interface to enable users to avoid many huge problems of document management.

The company is called Docktrackr and we are excited to also write this post to invite readers to access this version of docTrackr.  DocTrackr allows you to remotely control access to your Microsoft Office and PDF documents even after sharing them with others:
  • Collaborate and exchange information more securely than ever
  • Remotely destroy your documents at your discretion even after sharing them
  • Control who can access your documents
  • Know in real time how your recipients are using your documents
The best part is that no additional software required. The recipients of your documents only need Adobe Reader or Microsoft Office to open the files.  They have done a lot of work with DocTrackr and we (Technoracle) would like to extend the invitation to try it by emailing support@doctrackr.com or visting http://support.doctrackr.com/ to get an account.

Congratulations to Uli, Clement and Alex!


Thursday, August 09, 2012

How to Render PDF Forms in Mobile

Being ex-Adobe alumni, a lot of questions asking how to best render Adobe PDF forms on mobile devices come this way.  Some are about XFA forms on mobile devices, some Acrobat forms on mobile devices, but all of these have the same answer.   Don't!   Yes, this sounds abrupt and there is a multi-million dollars investment into PDF forms that would be great to turn on to mobile, but PDF was not designed for mobile.  Let's examine a few aspects of why.

First, the core PDF specification needs to be understood.  Portable Document Format (PDF) documents were designed to run on many different desktop computers.  A PDF document is "distilled" from different types of components.  There are a few basics types of objects and that is where the differences from image file formats like JPG or TIFF start.  PDF documents have headers, which are very small and contain only rudimentary information.  The second part is the body which contains objects.  Objects are numbered and can be of many types themselves.  There are cross references and then the trailer.  Besides these, the types of things you might find inside a PDF document are fonts, XMP metadata, a signature dictionary, the PDF envelope, attachments, annotations, embedded files such as images and more.

They are great for that but the model is different for the execution environment.  Mobile devices rotate the screen when the user twists the device.  A PDF is often laid out in absolute x,y coordinates which do not work well on mobile devices.  PDF's also have scripting in not one but two different languages - formCalc and JavaScript.  A PDF may have event listeners for things like "hover" which has no equivalent on a mobile device.  Tabbing order, listening for events like a window being active and more are not relevant.  BLOAT!  The long and short of this point is that PDF was just not designed for mobile.

Now Adobe and others have done a good job of rendering normal PDF's on mobile, but forms, especially flowable, multi-page PDF forms, present some huge challenges.  With soft keyboards (the popup keyboards on popular smart phones for example), the rest of the document must ensure that the form fields are not covered when then user is typing.

So what do you going to do if you have made a huge investment into something like Adobe LiveCycle ES for forms based business processes and now have to support mobile devices?  Technoracle has a solution for this today.  You also can re-write your forms from scratch (costly) or build custom native applications for each platform.  



Wednesday, July 25, 2012

Immediate Jobs at Tehnoracle

Technoracle immediately requires the two positions.  To apply, please send resumes to engineering (at) technoracle-systems (dot) com.  Both require next to perfect English language skills.


Job Req. #019

Title: Sr. iOS developer.

Department: Engineering/Agile environment
Type: Full Time
Min. Experience: Experienced in Audio/Video, network calls and graphics (skinning). We are looking for a gifted iOS developer with an eye for carefully crafted and well-designed product. If you have already shipped successful apps in the App Store that use streaming audio and video, are familiar with the RTMP protocol and can develop cutting edge applications that will work in bandwidth constrained environments, please send us your resume.

Responsibilities:
Build both iPhone and iPad apps
Work closely with product management, designers, and other teams
Rapidly fix bugs and solve pressing problems
Must work rapidly and be able to suggest new ways to solve engineering challenges
Location not important.

Requirements:
Excellent OO programming skills in Objective-C
Experience building high performance applications in memory and bandwidth constrained platforms
Strong network background
Must have audio/video streaming experience.
Strong sense of design and user experience
Have a passion for long hours and hard work.


Bonus Points:
Developed and released iPhone and iPad applications in the App Store
Previous startup experience
Android, Windows or BlackBerry native programming experience. Candidate must be able to start immediately fulltime.  


Job Req. #020 

Title: Sr. Android developer.


Department: Engineering/Agile environment
Type: Full Time Min.
Experience: Experienced in Audio/Video, network calls and graphics (skinning). We are looking for a gifted Android developer with an eye for carefully crafted and well-designed product. If you have already shipped successful apps that use streaming audio and video, are familiar with the RTMP protocol and can develop cutting edge applications that will work in bandwidth constrained environments, please send us your resume.

Responsibilities:
Build both smartphone and tablet applications with a system to reuse logic.
Must have strong network knowledge and Java skills
Work closely with product management, designers, and other teams
Rapidly fix bugs and solve pressing problems
Must work rapidly and be able to suggest new ways to solve engineering challenges
Location not important.

Requirements:
Excellent OO programming skills in Java
Able to use Android NDK for low level processing
Experience building high performance applications in memory and bandwidth constrained platforms
Strong network background
Must have audio/video streaming experience.
Strong sense of design and user experience
Have a passion for long hours and hard work.

Bonus Points:
Developed and released applications using audio, video streaming
Experience with WOWZA
Previous startup experience
iOS, Windows or BlackBerry native programming experience.
Candidate must be able to start immediately fulltime.

Thursday, July 19, 2012

Dude - Where is my C2DM?

So a project we're working on at Technoracle requires push notifications.  For iOS builds we are using Apple's APNS, which is very secure and reliable.  I had an issue with C2DM and went to the Google Developer website and was blind sided by this message:




Dang!  For the uninitiated, C2DM is Cloud to Device Messaging.  Those little red notifications you see on your phone letting you know that you have actionable items to look at works by a small daemon running in the background at all times, waiting for messages.  The messages are composed of several logical parts but the basic message contains a section describing the application destination, then another about the message.

C2DM vs GCM?

So what is GCM and why is it better?  Google Cloud Messaging is built from the lessons learned from C2DM, or so it appears to us.  Like C2DM, it's main purpose is to transfer messages to Android powered devices to let them know there is a message on a server waiting for them to do something with.  C2DM was very lightweight and easy to implement.  GCM offers some improved options.  From the google GCM website:

"a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device."

We are excited to try it and look forward to this improvement.

More reading:

To learn more about GCM, you can join the android-gcm group and read the following documents: 

Getting Started  Read this document to learn the basic steps involved in developing Android applications based on GCM.

Architectural Overview Read this document for a description of the underlying concepts and architecture in GCM.

Demo App Tutorial Read this document to walk through setting up and running the GCM demo app.

Advanced Topics Read this document to get a more in-depth understanding of key GCM features.

Migration Read this document if you are a C2DM developer moving to GCM.

GCM also provides helper libraries for client and server development.

Monday, June 25, 2012

Apple Removes Claims of "Macs being immune to viruses"


I originally bought a Mac computer based on a perception of better performance.   One of the side benefits was that OSX, the operating system behind Apple's computers, allows any virus or malware to be easily identified and removed.  As an old hand with Unix and Linux, I am more than familiar with the commands to identify any processes running on a system.  For the general public however, many simply believed that Apple computers did not get hit with viruses.  As someone who wrote malware as an experiment in high school, I can tell you this is simply not true.   Any system is prone to attack.  The Mac systems have historically been much less of a target though and relatively safe, even in the hands of newbies.  If you're running any *nix based system, grabbing a terminal and typing in "top" gives you the table or processes.  Processes cannot hide from SUDO.




Today Apple admitted this reality.  They quietly switched out a statement that claimed OSX based computers from Apple are immune to viruses with a less-forward statement: 'It's built to be safein the aftermath of the Flashback Trojan.    The Flashback Trojan (not related to Adobe Flash) infected hundreds of thousands of Macs earlier this year. 


So what can you do to protect yourself?  One tip is to set up a new user account that is not an administrator level account and use that.  The limited account will not have sufficient privileges to install the malware and you will be summoned to switch to a more privileged user to install any new packages.  UNIX was designed around these principals and it fosters awareness.


If you are not updating your software, you might also be exposing yourself to vectors for attack.  Be careful with this however as Apple also has made some upgrades that will create instability with other software such as it's own Final Cut Pro of which older versions do not run well with 10.7 OSX.


Be aware.  Apple computers are popular, which make them a target.  If you really want to be on the cutting edge, try using a VMWare image of Ubuntu and doing most of your business in that environment.  A VMWare image is sandboxed and cannot affect it's host.

Thursday, June 14, 2012

Anatomy of a Cloud Failure

Technoracle has published many articles on Cloud Computing, a technology of virtualizing computer functionality.  The virtualization occurs when a network or system's physical topology no longer aligns to it's logical topology.

Today an event happened that once again should serve as a reminder that cloud computing might not always be the best solution.  At around an hour ago Pacific Daytime Time, reports starting surging in that instances of Neo4J on the cloud were failing.  These messages initially were focused on Heroku, a generally very reliable cloud provider.  It became quickly apparent that the outages were hitting Amazon Web Services EC2 instances as well as other cloud providers.  The messages at YCombinator revealed how groups became aware of these outages:

michaelfairley 48 minutes ago | link
This is a more widespread EC2/EBS issue: http://status.aws.amazon.com/ reply DigitalSea 41 minutes ago | link I couldn't see any red circles indicating an issue with EC2/EBS.

reply michaelfairley 37 minutes ago |
link The circle is green with a little "note" on it. "8:50 PM PDT We are investigating degraded performance for some volumes in a single AZ in the us-east-1 region." reply

DigitalSea 29 minutes ago |
link Wouldn't that only affect a small subset of visitors. For example why would I be seeing any issues if I'd be hitting an Asia-pacific volume instead of a us-east region one? Seems like it goes deeper than that. reply mechanical_fish 4 minutes ago | link One problem which we've seen before is: If a large percentage of AWS infrastructure goes down, the customers don't just quietly suffer. Instead they scramble to try and launch infrastructure in other zones or regions, which creates a cascading series of load spikes throughout the AWS system. AWS is a fascinating science experiment. Pity about the websites, though. -----

michaelfairley 12 minutes ago |
link It's now yellow with this: "9:27 PM PDT We continue to investigate this issue. We can confirm that there is both impact to volumes and instances in a single AZ in US-EAST-1 Region. We are also experiencing increased error rates and latencies on the EC2 APIs in the US-EAST-1 Region." AWS has been historically bad at reporting the severity of their outages promptly. reply

The conversation can be viewed here - http://news.ycombinator.com/item?id=4114846

The spread of this from one cloud provider to another in such rapid succession shows the fragility interconnected systems have an how they are susceptible to these types of events.  With time, it is hoped that the lessons learned from these types of events will help us all build better systems. 

At the time of this posting, the event is still unfolding.

Wednesday, June 06, 2012

Cheap water heaters: Rheam & Hillside Still Suck

I get so many hits on this piece I wrote about their failure to honor a simple warranty.

http://technoracle.blogspot.ca/2007/05/buying-hot-water-heater-read-this-first.html

I feel this is once again worth mentioning as people have been constantly reading this and either thanking me for helping them change their minds and buy from a reputable company or to suggest a class action lawsuit based on getting ripped off as I did.   Rheam and Hillcrest Plumbing,  partners in crime.

Tuesday, May 29, 2012

Where Facebook is Heading?

Recently there has been a lot of hyperbole around Facebook.  The acquisition or Instagram for $1 billion, the rumors of a Facebook phone and now the potential acquisition of Opera.  I predicted the IPO would be a bad investment and the recent news consolidates my feelings about a company that is running amok. Why would Facebook, a company that according to some can't even build a good mobile application, consider buying a browser?  At Technoracle, we are not analysts but once in a while like to express opinions on current trends.

An acquisition of Opera would not be very beneficial for either company, nor would it be of much use in generating revenue for Facebook.  Facebook is a platform and Opera users already use Facebook.  We seriously doubt it would mean every Opera user would instantly become a new Facebook user.  Even if they did, to what end?

We are not alone in these thoughts either.  Trip Chowdry writes

"Buying Opera will likely be another stupid acquisition, the previous one being Instagram," 

Trip Chowdhry is a managing director of equity research at Global Equities Research.  We differ on rationale slightly.  Trip notes that buying Opera would potentially narrow Facebooks's ecosystem, not expand it.    The one item that Facebook needs to desperately expand upon is revenue generation.  Some investors have launched lawsuits alleging alleges that the defendants (Zuckerberg et al) hid the company's weakened growth forecasts from investors prior to the acquisition.  Whether this is true or not, growing revenue is one thing that keeps Wall Street happy.

Rather than go out and acquire technology, Facebook needs to wrangle in revenue producing companies or monetize their current investments. The IPO is done, the war chest is full of money.   Now is the time to build the business model that ensures long term success.  Remember MySpace?  The public is fickle and Facebook is not infallible.  MySpace's fall from grace happened so quickly most bands don't even bother with it anymore.

The acquisition of Instagram is also causing head shaking.  Instagram, as many have noted, is not technically a large amount of work to recreate.  They do have a solid install base which could be a play for users yet I suspect that two developers could re-create the applications in a week.  Filters are not hard to build.  Sharing photographs is a feature already built in to most modern camera equipped phones today.

The current Facebook API's and mobile applications are basically wrappers around the website.  So what is the long term plan here?  Let's try and sum up what we see happening.

Is it possible that Facebook wants to enter the contextual, POS advertising market?  Imagine this scenario.  You are walking down the street and your Facebook phone buzzes.  It alerts you that one of your Facebook friends is 100 meters away.  A backend algorithm has deduced that both of you like Starbucks (tm) and it sets up a DM to your friend suggesting you meet at the starbucks adjacent to your corner for a quick beverage.  It also provides you with a code for a discount on Starbucks which is tracked and revenue shared back to Facebook.

This scenario could offer a white boxed customer loyalty program for many businesses.  Unlike the Groupon model where drastic discounts can cause issues, Facebook could potentially use a 4Square type model to build a new contextual advertising market place.

For this scenario,  you would need the following components:

1. Large social graph
2. A GPS enabled phone or mobile app that can use GPS data
3. Either a proper mobile app or an HTML5, location aware browser that can be used to display the data
4. A deeper understanding of consumer spending habits and impulse purchases
5. A way to share the memories or post photos

Is this where Facebook is heading?

Thursday, May 24, 2012

My Thoughts on Adobe Creative Cloud vs CS 5.5.

Recently there has been a lot of advertising urging me to "upgrade" from CS 5.5 to the Adobe Creative Cloud.  I am hesitant for a few reasons.  The first is pricing.  Right now introductory pricing is between free (introductory trial) $29.95 and $79.95 per year.  This is noted as "Introductory pricing.  My concern is that instead of buying the software as I have in the past, I am not in a model whereby I will be paying rent every month.  There is no guarantee that pricing will not go up in the future either.  I am concerned about a new model where I pay monthly revenues every month, even if I do not require or use the software.

The next part is fairly obvious.  Storage will cost money.  The $79.95 plan (roughly $950 per year), comes with twenty (20) GB of storage.  I have episodes of Duane's World that are over 100 GB.  How much is this going to cost me?  Maybe I archive it locally?

Some good points should be the performance.  I will definitely be trying some of the more computationally expensive tasks from the free account to test.  Another benefit is that all my files (well 20GB of them) are with me wherever I go.

Adobe has put a lot of thought into this and it will be interesting to see what percentage of CS 5 and 5.5. users actually jump to the cloud or upgrade further.  I'm not a good designer (as is obviously by my blog design) and probably cannot make use of most of the features. This makes me happy to stay on 5.5.

I'd like to hear stories from those on the Creative Cloud.  What kind of experience are you having?

Friday, May 18, 2012

Apple 10.7.4 IMPORTANT NOTICE BEFORE UPGRADING!

I had a hard drive issue the other day and decided to upgrade and re-install my OS on a new drive.  I started by installing OSX Snow Leopard and then upgraded to Lion 10.7, which immediately prompted some updates to the OS, leaving me with 10.7.4. My machine is a Mac Pro running 2 X 3 GHz Quad-Core Intel Xenon processors.



To my horror, when I went to install Sorenson Squeeze 5, which is market on the outside package as "Universal" install for Mac meaning it runs on both PPC and Intel architectures.  When you open the folder, there are two installers - one for Intel based Macs (like mine) and one for PPC based Macs.


PPC is no longer supported but to my horror, when I tried to install the Intel version, I got the following message.


I got the same behavior with several other "universal" installs so I set up a call with Apple to discuss this, thinking it is obviously a bug.  The call took place at 9:00 AM PDT and I am going to share with you what was said to me.  BTW = if anyone from Apple wants to know who the person was, the case was Express Lane Case 315474064: Scheduled Support Call.    First  the Apple guy told me it was because Lion no longer supports PPC.  I told him that up until the day before, I had my Final Cut Pro and Sorenson running on this same machine with the Lion OSX.  He was unapologetic and told me I just had to just pay Apple to upgrade to a newer version of Final Cut Pro.  My reaction was to put my hands up and say "don't shoot" but I politely suggested this sort of behaviour was not appropriate given the stamp "Universal" means it runs on Intel.   I also told him that by him telling me I had to go and upgrade all my software was akin to robbery.   I told him I was going to blog about this and he got really worried and said he had not said anything and I should refer to the website.    He said "I didn't say that and anything you say you are making up".

Sorry pal.  The truth is the truth and this blog stays here!  That's final.  Nio court gag order will take this down.

Well, I am blogging about because other people might want to know about this.  There is an error and I hope someone from Apple reads this and sorts it out.   Please be warned! 



Dear Apple:  Please explain what "universal" really means?  From their website:

"Now every new Mac ships with an Intel processor. Experience delightful responsiveness from the smallest Mac mini to the most beefed-up Mac Pro. Use one of more than 7,000 universal applications that take full advantage of the Intel chip."

Hmmmm.

Wednesday, May 16, 2012

Adobe LiveCycle ES3 (version 10.0) Download

Adobe has recently announced that Adobe LiveCycle ES3 is available as a download.  This announcement was met with some great enthusiasm by the community, none less than us here at Technoracle.  The brand itself had been subject of much speculation regarding it’s future and we are happy to see the investment into LiveCycle continue.  This re-invigorates our own investment to work with this excellent SOA platform.

Having now been accepted into the Adobe Enterprise Solution Partner Program, we are extremely excited to be amongst the first in the world to offer you, the customers, the ability to purchase Adobe LiveCycle ES3 and professional services around it, starting from initial project consulting to complete project management.  In case you haven’t heard, there are several new features that many enterprises have asked for.   Our great former colleagues Jeff Stanier and Dave Welch have done a spectacular job of making this release a “must have”.

LiveCycle ES3 first and foremost incorporates the Data Services ES3 module (version 4.6.1), an optimized Java server framework that can enhance and simplify the development of rich, data-intensive enterprise and mobile applications.  This includes several mobile platforms such as iOS, Android etc.

ES3 also offers a new SAP to Java connector for creating front-end interfaces to SAP systems. Alongside this update are connectors for FileNet 5 and easier SharePoint server farm deployment and integration.

Our favorite new feature is within LiveCycle Designer.  When you add a new submit button, Designer allows you to select an encryption method and choose from from several XML encryption/decryption algorithms.   This will help with many accounts we are currently working on.
Out mobile MEAP-lite platform is also a good way to add custom mobile functionality for wireless device integration into business process.  Companies like Uberity have already released a great free and open source mobile SMS module including the full source code and binaries at http://blog.uberity.com/2012/02/extending-adobe-livecycle-es-to-use-sms-in-business-processes/

So why wait?  Get started today.   Contact us, a company founded by former top LiveCycle ES rock stars and engineering managers.  Leave a omment if you wish to inquire about our services around LiveCycle ES3.

Tuesday, May 15, 2012

Neo4J Tutorial #4: Registering a shutdown hook

In the previous tutorials on Neo4J, we discussed what Neo4J is, how to start it and use Cypher for basic queries and getting started with Neo4J and Java.  In the third of these, we had hinted there are some things you should do that are best practices in a proper environment.

To start this tutorial, please first follow the 3rd of the series from http://technoracle.blogspot.ca/2012/05/third-neo4j-tutorial-getting-started.html

You' notice that on Neo4J's pages, they discuss a shutdown hook.  So what exactly is that and why would anyone use it?


If you examine the code on the previous tutorial, you will see that you can shutdown a database by simply calling grapDB,shutdown();  These lines of code are shown above.  Note that calling shutown() only tries to shutdown the database.  The Shutdown hook simply ensures that the database shuts down cleanly.

To add a shutdown hook to the code in the previous tutorial, navigate to the createDB() method and register a shutdownhook handler right under the line where you create the database.  With the new line added, your code should look like this:


At this time, you may notice red X's as this introduces errors into the project.  We have registered a shutdown hook which takes a single argument of  the graphDB instance it will register the hook for.  Now it is time to write the hook.  




registerShutdownHook() is a static method that returns nothing (void).  The syntax above is a bit confusing given line 91 calls addShutDownHook on a new thread and closes around line 99, hence the erroneous looking but much required "});" syntax.  This essentially encapsulates the functionality.    The shutdown hook ensures that the Neo4j instance shuts down nicely when the VM exits (even if you "Ctrl-C" the running instance before it has finished running.  Try running this example now with the modifications and you should see the following print out in your console.





Tuesday, May 08, 2012

Third Neo4J Tutorial: Getting Started with Java

In this tutorial we will learn how to talk to Neo4J using Java.  There are a few tutorials from Neo Technologies which are very useful however I have my unique style of teaching and want to explain this technoracle-style.

First, if you haven’t already familiarized yourself with Getting Start with Neo4J and the Getting Started with the Neo4J Cypher Shell, check out those two articles.

Here are the steps to communicating with Neo4J from a Java environment.  This tutorial should take you about 30 minutes to complete.

SETUP

1.  Ensure you have the right version of Java and the Java JDK environment set up properly. On a Mac, this is probably already done for you. On a PC, you might have to manually download and install the right version of Java and set the PATH and JAVA_HOME environmental variable from scratch. 

2. Download and install Neo4J. In this tutorial I am using Neo4J 1.8 M01 release. I installed it on my OSX 10.7.3 laptop under my home directory (/Users/dnickull/Software/Neo4J_1.8/)

3.  Ensure you have the correct version of Eclipse installed. For this tutorial, I downloaded Eclipse Indigo Service Release 1, Build id: 20110916-0149.  I use the version entitled Eclipse IDE for Java EE Developers.

STARTING THE PROJECT

4.  Within Eclipse, select File -> new -> Java Project and give the new project a name. In my case I m calling mine “Neo_1.8”. Select Next.

5.  Under the second new project page, select Java Build Path (1) the libraries tab (2) and then click on Add External Jars (3). This will allow you to browse for external jar files.


6. Browse to the directory you installed Neo4J under and look under the “libs” directory. 



 7. Click on one of the *.jar files under that directory and hit the mnemonic key to select all (Command –A on OSX, Control A on PC). Click Add and Finish (even if you're not from Finland ;-). 

 8. In Eclipse, right click (Control click on PC) on the “src” folder of your newly created Eclipse project and select New -> Package. In the dialog window, add a new package name. In the figure below, I added com.technoraclesystems.neo4jutils. Hit the Finish button.



9. Right click (PC) or Control Click (OSX) on the newly created package name and select “New -> Java Class”. Provide a name for your class. In the example below I created a public class called HelloNeo4J.  Click Finish



10. Add the following import statements into your project.


11. Next we have to create the path to the actual Neo4J instance you installed. This is done with one line of code. Just below the class declaration, add the following line replacing the path with your path to the Neo4J 1.8. Note that the path on a PC will use the “\” chafacter instead of the “/” character and you will also have to escape it by placing a second “\” in front of each path separator.  THis should be the first line under your public class HelloNeo4J { statement.



12. For this simple tutorial, we will create 5 new class member variables as shown below on lines 19 - 23. Note that I have closed the imports statements but Eclipse keeps the lines numbers intact.



13. The variables will be used as follows in the program.
          a. myString – concatenates various strings to print back to the console
          b. graphDB – an instance of Neo4J to work with
          c. myFirstNode – a neo4J node
          d. mySecondNode – a second neo4J node
          e. myRelationship – the simple relationship between the two nodes.

 14. The next item to create is a static method to declare the list of relationships In this case we are using the word “KNOWS”, which sub-types the neo4J interface RelationshipTypes (API Docs).




15. A relationship type is mandatory on all relationships and is used to navigate the node space. RelationshipType is in particular a key part of the traverser framework but it's also used in various relationship operations on Node. RelationshipType is designed to work well with Java 5 enumerationss. This means that it's very easy to define a set of valid relationship types by declaring an enum that implements RelationshipType and then reuse that across the application.

16. Now we need to implement our main() method. The main method has 3 basic parts. The first is to instantiate myNeo4JInstance, an embedded instance of Neo4J. There are then consecutive calls to createDb(), removeData() and shutdown().  Add the stub code for these methods.



17. The first method to complete will be the createDb(). Add the following lines of code to this method.

NOTE: This is a bare bones, minimal tutorial.  In production, there are several other items to take care of such as registering a shutdown hook to ensure the database stops properly.  This would normally be done at this stage.  Read more about the importance of the shutdown hook here http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-setup.html


THE TRANSACTION 

18. The first line calls the GraphDatabaseFactory method to create a new instance of the embedded Neo4J which takes one argument, the DB_PATH we set up earlier.  The second line start a new transaction named tx.


19. The next line will set up a new Transaction with the identifier “tx” and calls the graphDB’s createNode() method. The transaction basically has two main parts:

 try { 
        //Some logic 
         tx.success 
       } finally { 
         tx.finish(); 
 } 

20. The idea is that your application logic goes under the try. All your application logic should be executed before the tx.success() statement. If all goes well, tx.success marks the transaction as successful but does not actually commit it. This is only done when tx.finish() is called. If tx.falure() is thrown during the logic phase, the database is rolled back. This is about as simple and elegant as it gets.

Here is how our logic will go to create a very simple graph of two musicians who know each other.


21. Lines 44 and 45 set properties for myFirstNote while lines 46-47 do the same for mySecondNode.  Starting on line 49, a relationship is created between those two nodes using the type from our Java enum, namely "KNOWS".  This is all printed to string before tx.success() is called.  tx.finish() is where the transaction is actually committed.

22. Next we will tackle the removeData() method, which will be executed next in the main method. This essentially undoes all the work we just completed. Modify the contents as follows. Note that this uses the exact same transaction construct as when we created the database.


23. Line 70 basically provides a start context for the transaction by looking for myFirstNode and calls the delete() method on the relationship.    The same delete() method is then called on both other nodes.

24. The last portion of the code to write is to shutdown the database. Luckily once more the engineers from Neo4J have provided a great method for doing this, aptly named shutdown().


RUN THE PROJECT

25. That is it!  If you run your project, all should go well and you should see the following in your console.



If you would like the source code for this project, please email me duane at nickull dot net.  Also, this is very important to remember.  This is a very basic tutorial.  It is very important to learn about other methods and hooks such as the synch hook, shutdown hook and how to clear the database in order to use Java safely with Neo4J.  There is a great tutorial at http://docs.neo4j.org/chunked/stable/tutorials-java-embedded.html that explains more and the Java API docs are at http://api.neo4j.org/1.8.M01/.

SOURCE CODE

package com.technoraclesystems.neo4jutils;

// From the //neo4j_install_dir/lib directory
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;

public class HelloNeo4J {
    private static final String DB_PATH = "/Users/duanenickull/Software/neo4j-community-1.8.M01/";

    String myString;
    GraphDatabaseService graphDb;
    Node myFirstNode;
    Node mySecondNode;
    Relationship myRelationship;

    private static enum RelTypes implements RelationshipType
    {
        KNOWS
    }
    
    public static void main( final String[] args )
    {
    
        HelloNeo4J myNeoInstance = new HelloNeo4J();
        myNeoInstance.createDb();
        myNeoInstance.removeData();
        myNeoInstance.shutDown();
        
    }
    
    void createDb()
    {
        graphDb = new GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH );

        Transaction tx = graphDb.beginTx();
        try
        {
            myFirstNode = graphDb.createNode();
            myFirstNode.setProperty( "name", "Duane Nickull, I Braineater" );
            mySecondNode = graphDb.createNode();
            mySecondNode.setProperty( "name", "Randy Rampage, Annihilator" );

            myRelationship = myFirstNode.createRelationshipTo( mySecondNode, RelTypes.KNOWS );
            myRelationship.setProperty( "relationship-type", "knows" );
            
            myString = ( myFirstNode.getProperty( "name" ).toString() )
                       + " " + ( myRelationship.getProperty( "relationship-type" ).toString() )
                       + " " + ( mySecondNode.getProperty( "name" ).toString() );
            System.out.println(myString);

            tx.success();
        }
        finally
        {
            tx.finish();
        }
    }
    
    void removeData()
    {
        Transaction tx = graphDb.beginTx();
        try
        {
            myFirstNode.getSingleRelationship( RelTypes.KNOWS, Direction.OUTGOING ).delete();
            System.out.println("Removing nodes...");
            myFirstNode.delete();
            mySecondNode.delete();
            tx.success();
        }
        finally
        {
            tx.finish();
        }
    }
    
    void shutDown()
    {
        graphDb.shutdown();
        System.out.println("graphDB shut down.");   
    }   
}


Enjoy and have fun!

Thursday, May 03, 2012

What is LiveCycle ES


I get asked all the time – “What is LiveCycle ES”? This is a question I had to answer while at Adobe but somehow the way this question is answered now has changed from an outsider perspective.   I find myself describing it in terms of business capabilities and value rather than the technology itself. Nevertheless, if you want to know what LiveCycle is, this blog post should provide a solid background.
LiveCycle is an enterprise software system that solves problems pertaining to mass scale processing of Portable Document Format (PDF) documents. While individual users of PDF’s tend to use Adobe Acrobat or Reader for working with PDF, LiveCycle is meant to aid the processing of tens of thousands of LiveCycle PDF documents. Hence, it is an enterprise solution that anyone who currently uses paper forms should look at if they are wanting to streamline the ingestion of data from forms. Likewise, it had many modules that can mitigate problems around PDF such as document security (think of Wiki-leaks).

LiveCycle itself is comprised of several components. I’ll walk through each of these components one at a time. the main component is akin to what many call an Enterprise Service Bus or ESB for short. This includes a set of common services, a common environment of service execution, a registry-repository system, workflow and storage components to name a few components. LiveCycle ES installs as a server and the server can bind to many different types of common enterprise infrastructure components including directories (LDAP for example). Below is a depiction of the server side component of LiveCycle ES.
What is Livecycle - the server component explained.

The server’s core services are all registered in a registry.  There can be orchestrated and used to perform different types of operations on PDF documents and with extensions, to also talk to mobile (wireless) devices.  At the bottom of the Service tier is a Service Provider Interface (SPI) which is where back end systems often integrate.  Systems such as SAP that might consume and produce massive amounts of data for government or finance could link in to this layer to offer PDF forms as a point of interaction with humans, then automatically accept, validate and consume the form data provided by the user.  The users themselves can access data (by requesting a PDF form or perhaps by being pushed notifications of events) via the Service Invocation Layer at the top.  This is a J2EE server and can be set up in many different ways.  One option is often to install it on site however for evaluation, I have found that using the Amazon cloud is one of the best ways for evaluation.  I have experience with this and we have found that while it takes an average first time installation of LiveCycle’s server on Red Hat Enterprise Linux with full SSL/TLS configuration and testing afterwards to take many over 2.5 days.  I highly recommend the turnkey Windows server installation however I do offer a flat fee to install this on the cloud for evaluation.


So what are the core component and services LiveCycle offers?   Here is a brief rundown.  The following is not an exhaustive list, rather an example to help explain what LiveCycle is.


Forms ES – this module can be licensed to automate just about every aspect of forms processing.  The ability to save money over paper forms is astounding. 


Barcoded Forms ES – the barcoded forms module allows forms to be printed with a corresponding 2D bar code that can later be electronically scanned to recapture the form data electronically.  This is useful if you wanted to create something like an electronic voting system that had a fully audit able paper trail or if you needed someone to electronically fill out a form and sign it then mail it in to you for ingestion into your systems.


Digital Signatures ES – since many companies use digital signatures now, often deemed more reliable and audit able than wet ink signatures, PDF documents support this feature.  The LiveCycle Server can perform massive scale operations using the Digital Signatures module like validating 100,000 signatures to ensure certificates have not been revoked.


Output ES – Our put is used often for production print.

PDF Generator ES – this module provides almost every possible method for generating PDF, PostScript, FXA, XDP or other related files.

Process Management ES – LiveCycle ES contains a full blown business process management capability.

Reader Extensions ES – this module of LiveCycle unlocks features in Adobe Reader that enable it to perform more like Acrobat.  These extensions are often cheaper as a solution than forcing all users to buy copies of Adobe Acrobat.


Rights Management ES – Rights Management is one of our favorite modules.  You can use this to protect documents from beign distributed beyond what you want and even expire a document. The perfect solution to Wikileaks! There are many other modules and this is only designed to show you a small cross section of LiveCycle.

So what does LiveCycle look like when you use it?  This is actually very dependent upon your role.  There are Adminstrators and other various types of power users.  This group use the administrative console which is web based.
 
The Adobe LiveCycle ES Administrator view



Most people who work with received forms or kick off business processes will use the Workspace interface.  This is where privileged users can also receive work that has been queued up for them to work with.

  LiveCycle Workspace

For users who design actual PDF forms, this class will spend a lot of time in the Adobe LiveCycle Designer view. If you have ever wonder “what is LiveCycle Designer”, this is what you will see.

Adobe LiveCycle Designer

Another class of developer users for LiveCycle will bind these PDF forms into Business Processes.  These users will spend a lot of time in LiveCycle WorkBench.  This is an eclipse based environment where business processes can be designed by using assets (such as the form above) in combination with business logic and LiveCycle Services.  This view looks similar to the graphic below.
 
LiveCycle Business Process view



Finally, the Business process users will also rely on a set of services.  The view to these services are provided via the service registry.  The service registry interface is easy to use and will be the subject of future Educational Series videos that show LiveCycle Help.

What are LiveCycle ES Services? This blog post only covers the basic elements of LiveCycle ES.  To put all the pieces together, this is what a fully implemented architecture could look like. LiveCycle ES Architecture with Uberity Mobile Deployment

As you can see, the development tools also include Java IDE’s such as Intellij and Eclipse.  I have produced a few LiveCycle tutorials on how to invoke LiveCycle from a Java environment using Eclipse and the LiveCycle SDK.  These are available at: The setup video is here:

http://www.uberity.com/2012/03/uberity-video-education-series-livecycle-es/

and a video of how to migrate from EJB invocation to SOAP is here:

http://www.uberity.com/2012/04/tutorial-invoke-livecycle-es3-using-soap/

Also shown above is the fact that third parties can develop their own functionality around LiveCycle ES.  I've decided to spend some time building mobile interactions that integrate with the Adobe LiveCycle ES3 platform.  


The next time you hear someone ask “What is LiveCycle”, this is a blog postI hope will help others answer that question. As with all our posts, if you do not feel your questions are answered here or want to follow up, please contact us at duane at nickull dot net for more information.  My experience can save your company money. I can show you how a forms initiative will be more successful on LiveCycle ES than any other platform.  Whether it be a PDF form, HTML5 or custom native iOS application, my friends and I are here to help.