Home > adobe air > Learning Employee Directory Series

Learning Employee Directory Series

November 2nd, 2008

Employee Directory is an AIR sample application from which I learned a lot. (try it) Here I post some of what I learned here.

1. introduction
2. structure
2.1 singleton
2.2 command
2.3 Cairngorm
3. ui
3.1 style
3.2 size
3.3 component
4. flow
5 events
5.1 event bubble
5.2 event clone
6 modify ED for your own purpose: custom field

related links

Author: Xu Cui Categories: adobe air Tags:
Try Stork, a research tool we developed

Stork is a publication alert app developed by us at Stanford. As a researcher we often forget to follow up important publications - and it's practically impossible to search many keywords or researchers' names everyday. Stork can help us to search everyday and notifies us when there are new publications/grants. How Stork helped me?

About the author:

Xu Cui is a human brain research scientist in Stanford University. He lives in the Bay Area in the United States. He is also the founder of Stork (smart publication alert app), PaperBox and BizGenius.

 

He was born in He'nan province, China. He received education in Beijing University(BS), University of Tennessee (Knoxville) (MS), Baylor College of Medicine (PhD) and Stanford University (PostDoc). Read more ...
  1. Chris B.
    December 10th, 2008 at 08:24 | #1

    Thanks a lot for breaking this robust app down!

    I downloaded the source code and did not know where to start, but thanks to you I now have a better understanding of it all.

    One question I do have is: How can I go about making the ED sync/refresh the database every time I make changes to the “employee.csv.zip” file?

    I keep changing the data in the csv.zip files, but it isn’t reflected when I run the app.

    Thx again!

    C.B.

  2. December 10th, 2008 at 17:45 | #2

    Hi, Chris,

    After you change csv.zip, try delete ED folder from your application storage directory. On my computer, it is
    C:\Documents and Settings\Xu Cui\Application Data\employeedirectory\

    You should see the change. I checked this on my computer.

  3. Chris B.
    December 11th, 2008 at 01:20 | #3

    Thanks for the quick response, Cuiixu!

    Would you happen to know what folder that would be on a Mac?

    Thx,

    C.B.

  4. December 12th, 2008 at 14:03 | #4

    Try trace(File.applicationStorageDirectory.nativePath) in your application in debug mode.

  5. C.B.
    December 18th, 2008 at 12:09 | #5

    Once installed, does the Air App updated itself when the data changes? Or do you have to uninstall and re-install it every time you make changes to the list of employees?

    Thx,

    C.B.

  6. Joel
    June 10th, 2009 at 04:54 | #6

    Really appreciate your breakdown of this. I was also having problems with the data not refreshing and just found the problem, if anyone’s interested. In the file

    /EmployeeDirectory/src/com/adobe/empdir/managers/DatabaseConnectionManager.as

    The database name is specified as “employeedirectoryM6.db” and once you run the program this file just hangs around in your AppData folder, which is why deleting the folder refreshes the data. However there’s a better way to force the refresh by adding a moveToTrash()to
    the DatabaseConnectionManager method, like so

    dbFile = File.applicationStorageDirectory.resolvePath( DBPATH );
    dbFile.moveToTrash();

    This way the file gets refreshed every time without having to re-install. Hope this helps someone else.

  7. June 10th, 2009 at 05:10 | #7

    @Joel
    Thank you. It’s useful.

  8. foxchx
    June 14th, 2009 at 12:11 | #8

    I ran in trouble after installing new field and now i can’t refresh any data…

    My question to XuCui is… Did you work around the embedded refresh button[i+logo method]?

    my problem is triggered when I try to refresh the DB using the i+logo method.
    [InsertEmployeeDataCommand : : An error occurred executing the SQL : 3115 :]

  9. foxchx
    June 14th, 2009 at 12:17 | #9

    @Joel

    BTW Joel’s way worked like a charm and actually fixed my error:3115 ?!?!
    As crazy as it sound once the ..M6.db was refreshed the Error (that i ve been researching for solution for over 4 days) miraculacy disappeared.

    that makes me think that my …M6.db was corrupted in some ways and was just making everything go basurk!!!

    Kudos Joel!

  10. Foxchx
    January 17th, 2010 at 17:27 | #10

    Shot in the dark, i know you it’s getting old, but i almost finished my app and it’s working fine…

    I am trying to make everything neater..and there’s something that bug me real bad about the pictures from ED…

    Why the hell do every pictures are jagged? i can’t have all member of my directory with lazy eyes and forehead cropped out like freaks.

    Have you notice that? did you look around, any insight on what cause that?

    Anyways any comment would be appreciated.

    thanks

CAPTCHA Image