RSS

SmugMug Java API - Beta 5 Released

Sat, Jul 19, 2008    (Rating: 5 stars, Click to rate this article!) Loading ... Loading ...

Software Development


Beta 5 of the kallasoft SmugMug Java API has been released.

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.

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.

Complete Changelog after the Jump:

Changelog for Beta 5

  • 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.
Share This on Your Favorite Social Network:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Propeller
  • Reddit
  • Technorati
  • Slashdot
  • StumbleUpon
  • description
  • IndianPad
  • MisterWong
  • TwitThis
, , , ,

This post was written by:

Riyad Kalla - who has written 11 posts on kallasoft.

Riyad has participated in the software industry in Open Source, research and commercial software design and development both professionally and as a hobby. Riyad leads the Product Services team for a industry leading tech company out of Dallas, writes software in his spare time and most importantly hopes the information here helps developers out there.

0 Comments For This Post

1 Trackbacks For This Post

  1. kallasoft SmugMug Java API - Beta 5 Released | WhiteSandsDigital.com Says:

    [...] for implementers wanting to extend the API. The API is licensed under the Apache 2.0 License.read more | digg [...]

Leave a Reply