SmugFig API
The StreetsOfBoston’s SmugFig API is a Java API that provides integration with the SmugMug JSON API and is built on top of kallasoft’s SmugMug Java API. It is developed/released under the Apache License v2.0
Kallasoft’s Java API lays the foundation for the SmugFig API. Kallasoft’s Java API is more geared towards Smugmug functions. It maps each Smugmug’s JSON API’s function (e.g. Create, GetInfo) to an appropriate Java Class.
The SmugFig API is more geared toward Smugmug objects. It maps each Smugmug’s object (e.g. Category, Album, Image) to an appropriate Java Class. The SmugFig API offers the following pieces of functionality:
- It removes the burden of remembering the names or order of the JSON parameters.
- It adds a simple level of change-management.
It provides easy ways of determining whether SmugFig objects (Categories, Albums, etc) have changed or remain unchanged with respect to their values on Smugmug’s servers. - It adds a simple mechanism of caching to reduce network traffic.
Caching is done in the background and not visible to the user of SmugFig objects. - It adds search-functionality by leveraging Smugmug-feeds and a tiny embedded database.
API Version Support and Implementation
The current implementation of the SmugFig API is being for Smugmug API version 1.2.0. Version 1.2.1 support will be added soon.
At this moment, the functionality-set of 1.2.0 is implemented, using the 1.2.1 implementation on Smugmug.
Download and Support
Downloads Version 0.1.2
- Download Java 2 SE Version 1.5 or higher, if you have not done so yet.
- The SmugFig API 0.1.2 JAR (runtime and documentation only. Dependent libraries not included)
smugfig-api-0.1.2.jar - The SmugFig API 0.1.2 Distribution (contains above jar and all dependent libraries)
smugfig-api-0.1.2-dist.zip - The SmugFig API 0.1.2 Source (contains above jar and all libraries, sources, etc, to be used for development)
smugfig-api-0.1.2-src.zip
You can leave your comments in here.
Release Notes
Version 0.1.2
- GUID: Don’t create a new one when ID==IHadID.NO_ID.
- IMAGE_SIZE.Custom has been removed.
- Added static method AlbumPrototype.createNoSubCategory.
- Replaced the ArrayList<String> for keywords with a brand new class called Keywords. This class extends ArrayList<String>.
- setLargestImageSize is fixed to be able to handle ‘null’ as a value.
- Added an Image Cache caching raw-data (bytes) of images (ImageCache class).
- Added AsynchHandler.loginWithHash.
- Added getCategory and getSubCategory to Image.
- Image.write(OutputStream,IMAGE_SIZE) now uses the OriginalURL if possible to obtain the data for the image, if the image-size is not specified.
- Made the Album/AlbumTemplate.Data setters for ShowGeography and AllowRankPhotos public.
- Fixed the Album.copy() method.
- Fixed issues with setting the largest image size, color-correction for printing and HasCustomAppearance attribute.
- Added a static method to Session that allows the caller to specify whether data/login-data/upload-data needs to be communicated of a non-secure or secure URL.
- SmugAttribute.setReturnNullIfNotChanged(boolean) now works for both getBackedValue() and get().
- Changed the creation of new objects using GUID.NO_GUID so that they can be distinguished from each-other.
- Smugmug API version 0.5.0 being used. Full support for ShareGroups and applying watermarks will be done in next version.
- Added ShowSquareThumbs attribute to AlbumTemplatePrototyp.Data (AlbumTemplates and Albums).
- Changed the type of Altitude from Integer to Double.
Version 0.1.1
-
Fixed a bug in SubCategoryPrototype>>getAll(int ID). mData.getCategoryID() was used instead of the provided ID.
-
Fixed a bug in the cache handling of the postGetAll method.
-
All objects in the named cache are returned, not the particular (modified) subset that is equal to the input of this postGetAll method. (still to do).
-
Added user.getTree method. This Smugmug method will be handled by the Account.getSmugObjectsHierarchy.
-
Added functionality to be able to refresh subsets of caches.
-
Added getAllFromCache() method to ISmugObjectProtoype interface and the implementing classes.
-
Added getAllFromCache(String subSetId) method to ISmugObjectProtoype interface and the implementing classes.
-
Added getParentId() to ISmugObject interface and implementing classes. This id is used for the subSetId.
-
Added support for smugmug-api-0.3.0.
-
Now uses the new security features for handling images and albums/galleries.
http://www.dgrin.com/showthread.php?t=83919 -
Album titles can now be updated.
-
Images now have a ‘IsHidden’ attribute.
-
Added ‘getFileName()’ to the Image class.
-
Added asynchronous smugmug-operations to ISmugObject and ISmugObjectPrototype.
-
Added GUIDs: Smugmug Objects can handle them now (initial implementation).
-
Improved the java-generics of the API
-
An Image’s TinyURL was not properly retrieved from the Smugmug Repository.
-
Added two methods to the Session class to allow downloading of the owner’s private images.
Version 0.1.0
Initial version of the SmugFig API.
- Support for version 1.2.0 of the Smugmug API. However, the code uses the version 1.2.1 accesspoint (URL).
- Uses Beta 3 version of Kallasoft’s Smugmug API.
http://www.kallasoft.com/smugmug-java-api/changelog/ - Simple caching mechanism is supported: No minimum and maximum bounds on the cache.
- Search functionaliy is not yet implemented.
- Exception handling is basic. Improvements are needed for recognizing certain expected error conditions (e.g. detecting that objects did exist but are deleted is functioning only partially implemented).
Documentation
The Java API Doc can be found inside the SmugFig API 0.1.2 JAR download.
Some examples can be found inside the SmugFig API 0.1.2 Source download.
Other documentation is still to be done.
Examples
Some examples can be found inside the SmugFig API 0.1.2 Source download. Here is a link to an example source file:
ImageExample.java (as text file)
License
The SmugFig API is licensed under the Apache License v2.0. You can download a copy of it here.
The long and short of the API being under the Apache License v2.0 is that you are free to use the API in an open source or commercial product, but you need to provide full credits to the kallasoft SmugMug Java API and SmugFig API in the documentation of your product somewhere.

Recent Comments