Announcing: SmugMug Java API

2»

Comments

  • rkallarkalla Registered Users Posts: 108 Major grins
    edited March 24, 2008
    SmugMug Java API - Beta 4 Released
    Download | Documentation

    Beta 4 of the kallasoft SmugMug Java API has been released today and provides full support for the SmugMug JSON API v1.2.0 and partial support for SmugMug JSON API v1.2.1 as the 1.2.1 library is still under heavy development and change.

    This release represents the fourth release of the API and was released so quickly after Beta 3 to fix the "missing commons-logging" issue that I caused in Beta 3, but also includes support for the new SquareThumbs Album/Template feature in SmugMug.

    Full Changelog
    • REGRESSION: Re-added missing commons-logging library required by HttpClient to run. Sorry guys!
    • Support for new SquareThumbnails Album and AlbumTemplate property
    The kallasoft SmugMug Java API is a Java API that provides integration with the SmugMug JSON API and is developed/released under the Apache License v2.0.

    The simple examples page may give you a better idea of how to use the API out of the gate. Also for the folks that want to know exactly what is going on behind the scenes, the Manual includes complete coverage of Request/Reply pairs for each API version that is supported.

    The purpose of the API is to make developing Java applications against the SmugMug service a walk in the park. The goal is to allow you to focus on your application and not worry about things like JSON object parsing, HTTP requests, headers, response streams and all those details.
  • dounddound Registered Users Posts: 72 Big grins
    edited March 24, 2008
    rkalla wrote:
    Beta 4 of the kallasoft SmugMug Java API has been released today.

    Great stuff! Looking forward to playing around with it thumb.gif .
  • FuronoFurono Registered Users Posts: 119 Major grins
    edited April 4, 2008
    Thanks a ton for making this.

    I'm well in the process of making Servoy Plugins right now and just got done doing the image uploader, the rest will be easy. It will make for some great SQL database capabilities.

    Steve
    Steve Nelson
    Tour Leader - DPRK
    Uri Tours
    SmugMug - photos.japanphotos.jp
  • rkallarkalla Registered Users Posts: 108 Major grins
    edited April 4, 2008
    Furono wrote:
    Thanks a ton for making this.

    I'm well in the process of making Servoy Plugins right now and just got done doing the image uploader, the rest will be easy. It will make for some great SQL database capabilities.

    Steve

    Steve that's awesome, keep us posted on how the work goes.

    ALso if you have any suggestions/requests for Anton (SmugFig) or myself (kallasoft SmugMug Java API) let us know.
  • flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited April 6, 2008
    Hi Riyad,

    I encountered this stack-trace when getting an image's EXIF (Beta 3):

    java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
    at com.kallasoft.smugmug.api.json.util.JSONUtils.getStringSafely(JSONUtils.java:53)
    at com.kallasoft.smugmug.api.json.v1_2_0.images.GetEXIF$GetEXIFResponse.<init>(GetEXIF.java:281)
    at com.kallasoft.smugmug.api.json.v1_2_1.images.GetEXIF$GetEXIFResponse.<init>(GetEXIF.java:60)
    at com.kallasoft.smugmug.api.json.v1_2_1.images.GetEXIF.execute(GetEXIF.java:29)

    It tries to get the Subject Distance Range when this class-cast exception takes place:
    subjectDistanceRange = JSONUtils.getStringSafely(imageObject,
      "SubjectDistanceRange");
    
    I can't grasp the notion of time.

    When I hear the earth will melt into the sun,
    in two billion years,
    all I can think is:
        "Will that be on a Monday?"
    ==========================
    http://www.streetsofboston.com
    http://blog.antonspaans.com
  • rkallarkalla Registered Users Posts: 108 Major grins
    edited April 7, 2008
    Hi Riyad,

    I encountered this stack-trace when getting an image's EXIF (Beta 3):


    It tries to get the Subject Distance Range when this class-cast exception takes place:
    subjectDistanceRange = JSONUtils.getStringSafely(imageObject,
      "SubjectDistanceRange");
    

    Anton, thanks for the heads up. David and I auditted the EXIF method and corrected the Wiki doc in two places (focalLengthIn35mmFilm and subjectDistanceRange were changed to type Integer) and 1 mis-matched type in the code.

    I'm emailing you a new pre-Beta-5 build so you can continue to work, and the SmugMug JSON API changes to the 35mmFilm property should roll out later this week, so until then you'll likely get a ClassCastException from that until about Thurs or Friday when the change rolls out on Smug's side to change it to an int.
  • rkallarkalla Registered Users Posts: 108 Major grins
    edited July 19, 2008
    SmugMug Java API - Beta 5 Released
    Download | Documentation

    Beta 5 of the kallasoft SmugMug Java API has been released today and provides full support for the SmugMug JSON API v1.2.0 and partial support for SmugMug JSON API v1.2.1 as the 1.2.1 library is still under heavy development and change.

    This release represents the fifth release of the API and brings a slew of fixes that are inline with fixed performed against the SmugMug JSON API; keeping the two in sync.

    This release also adds some more support for 1.2.1 methods. Beta 5 also includes a myriad of design, code and runtime optimizations to make working with the API and extending it much easier (more utility methods and common-implementations to utilize).

    Full Changelog
    • Added 2 constructors to every class: 1 default no-arg constructor and a 2-arg (method/argument) constructor. This allows for extensions of the methods to provide replacement method names or argument values without breaking the API. This is most notable in some 1.2.1 and 1.2.2 methods that now accept more arguments than their 1.2.0 counterpart and need to specify those additional arguments.
    • Method images.getEXIF was modified to change the types of focalLengthIn35mmFilm and subjectDistanceRange properties from String to Interger to correctly match the EXIF 2.2 spec. Required an update to the SmugMug JSON API as well which got rolled out.
    • Added a collection of examples to the download
    • Fixed WithPassword userID return type to be Integer instead of int to match the rest of the API.
    • Added 1.2.1 albums.applyWatermark method
    • Rewrote test library to provide more comprehensive and optimized test coverage
    • entity.Image albumID property was changed to return an entity.Album instance. This is more correct as Albums also need their associated Key to perform any operations on them.
    • Latitude, Longitude and Altitude properties were added to entity.Image so getting heavy results for images now include the geo-tagging information (e.g. getInfo)
    • Support for Latitude, Longitude and Altitude was added to images.ChangeSettings for 1.2.1
    • All methods in 1.2.1 that simply wrap 1.2.0 methods were augmented to include more detailed debug logging messages (if logging is enabled) to make method execution tracing more accurate
    • 1.2.1 albums.get ShareGroup support added
    • 1.2.1 users.getTree ShareGroup support added
    • Fixed a bug in 1.2.1 images.Upload method where a warning was logged even if the proper 1.2.1 text-based upload endpoint was used. (NOTE: This only occurred if a debugging logging file was provided)
    • Optimized logging by removing wordy & unhelpful trace messages. This also removed a lot of class overhead that previous existed creating class-specific loggers just to log the trace methods. This will lower the memory requirements and optimize runtime a bit.
    • Cleaned up Javadoc referring to using APIConstants#UNKNOWN_VALUE when trying to specify an unknown Latitude, Longitude, Altitude and AlbumID/ImageID in the upload methods. This is no longer the case, simply passing null is the correct way.
    • APIUtils had 3 new utility methods added to it that implementors are free to use if they need them:
      • readStream: used for reading the contents of a stream into a byte[]
      • base64Encode: used to Base64-encode a byte[] and return the result as a String
      • calculateMD5Sum: used to calculate the MD5 Sum of the contents of a byte[]
    • Rewrote implementation of images.Upload to do the following
      • Redefine all the common operations that all subclasses will need to use, as utility methods (load, base64 encode, calculate md5 sum)
      • Move common pre-processing logic out of the class-specific execute method implementations and into a common implementation-agnostic “prepare” method that all sub-classes can use to prepare text-base uploads if necessary without worrying that they are performing API-version-specific operations.
        • This can also be easily extended and enhanced if future upload implementations require slightly different behavior.
    • Removed UNKNOWN_VALUE. It is no longer needed since the change the API made from using primitive values to using Object values; now null is a suitable value for unknowns.
    • images.Upload, images.UploadFromURL and images.UploadHTTPPut were all reorganized to optimize the calling order of the methods and extract the generic processing functionality into protected methods that any sub-class can make use of without worrying that they are getting version-specific behaviors.
    • The version parameter was removed from the UploadHTTPPut method as it made no sense to allow someone to set this to anything other than the version of the API that class was implemented to support.
      • NOTE: This could cause a potential compiler error for folks using those convenience methods earlier. The fix is to just remove your version argument; it is set automatically.
    The kallasoft SmugMug Java API is a Java API that provides integration with the SmugMug JSON API and is developed/released under the Apache License v2.0.

    The simple examples page may give you a better idea of how to use the API out of the gate. Also for the folks that want to know exactly what is going on behind the scenes, the Manual includes complete coverage of Request/Reply pairs for each API version that is supported.

    The purpose of the API is to make developing Java applications against the SmugMug service a walk in the park. The goal is to allow you to focus on your application and not worry about things like JSON object parsing, HTTP requests, headers, response streams and all those details.
  • dounddound Registered Users Posts: 72 Big grins
    edited July 19, 2008
    Sweet! Thanks Riyad :).

    I've been tied down recently ... but I'm definitely looking forward to using your new API when I get back to my project!

    ~ David
  • rkallarkalla Registered Users Posts: 108 Major grins
    edited July 19, 2008
    dound wrote:
    Sweet! Thanks Riyad :).

    I've been tied down recently ... but I'm definitely looking forward to using your new API when I get back to my project!

    ~ David

    David, very cool!

    If you ever need an extra set of eyes on something let me know. Also if you need a SVN repo for your work let me know too, I'm hosting a few folks that are using the API to build stuff that didn't have their own hosting. (all free of course, just as a community service).
  • dounddound Registered Users Posts: 72 Big grins
    edited July 19, 2008
    rkalla wrote:
    David, very cool!

    If you ever need an extra set of eyes on something let me know. Also if you need a SVN repo for your work let me know too, I'm hosting a few folks that are using the API to build stuff that didn't have their own hosting. (all free of course, just as a community service).
    Great, extra eyes are always good ... and I'm sure once I've dug into the API some more I'll have a few questions :).

    I like SVN, but recently I've migrated all my active svn repos to git! You should give it a try sometime. Even when you don't really need/have a distributed development environment, it is quite fast. And it is a one-liner to import an svn repo with history into git, so it isn't too much of a hassle.
  • rkallarkalla Registered Users Posts: 108 Major grins
    edited July 19, 2008
    dound wrote:
    Great, extra eyes are always good ... and I'm sure once I've dug into the API some more I'll have a few questions :).

    I like SVN, but recently I've migrated all my active svn repos to git! You should give it a try sometime. Even when you don't really need/have a distributed development environment, it is quite fast. And it is a one-liner to import an svn repo with history into git, so it isn't too much of a hassle.

    I watched Linus's demo of Git to the Google crew and it looked really freaking cool... at the time though there wasn't an Eclipse plugin for it... is there one now or is it all command line?
  • dounddound Registered Users Posts: 72 Big grins
    edited July 19, 2008
    rkalla wrote:
    I watched Linus's demo of Git to the Google crew and it looked really freaking cool... at the time though there wasn't an Eclipse plugin for it... is there one now or is it all command line?

    Not sure -- Eclipse seems to be the first IDE to get all the plugins though. I've only used it on the command-line myself though. I can't imagine writing a plugin to do the basics would be very different than svn ... for that stuff there is about a 1:1 correspondence in the commands which are used.
  • flyingdutchieflyingdutchie Registered Users Posts: 1,286 Major grins
    edited September 7, 2008
    Hi everyone,

    I just released a new version of the SmugFig API. It's version 0.1.1 and can be found here.
    http://blog.antonspaans.com/smugfig-api/

    Riyad and David, thank you very much for the help and support you have given me throughout the implementation of this API.

    Here is 0.1.1's change-log
    [/left]

    I just released version 0.1.2 of the SmugFig API. It can be found at the same link:
    http://blog.antonspaans.com/smugfig-api/
    I can't grasp the notion of time.

    When I hear the earth will melt into the sun,
    in two billion years,
    all I can think is:
        "Will that be on a Monday?"
    ==========================
    http://www.streetsofboston.com
    http://blog.antonspaans.com
Sign In or Register to comment.