This is the history of API changes from Alpha-1 to the 2.0 release. The 2.0 release has the following API versions:
Please note that during this cycle, we renamed GalleryLayoutApi to GalleryThemeApi as part of the extensive theme refactor that happened just before the Beta-4 release.
I just made a change so that now Factory registrations happen once, at module install time. This will aid performance since now we won't have to load up the various modules to find out what factory implementations they have.
This resulted in two changes to the GalleryCoreAPI. The registerFactoryImplementation method now takes a relative path to the implementation class, and id of the module that owns the implementation. The hints are now also mandatory. Its definition looks like this:
function registerFactoryImplementation( $classType, $className, $implId, $implPath, $implModuleId, $hints);
I also added the new unregisterFactoryImplementationsByModuleId method: function unregisterFactoryImplementationsByModuleId($moduleId);
This is used when we uninstall a module to remove all of its implementations. To work with the new API, you should make the following changes to your modules:
Module constructor:
If you have factory registrations:
In the upgrade method, the pattern I chose was to delete all existing registrations and then re-register them all. This makes it easier during the upgrade process if you have a lot of factory methods. Here's an example from the EXIF module for one such registration:
$ret = GalleryCoreApi::unregisterFactoryImplementationsByModuleId($this->getId()); if ($ret->isError()) { return $ret->wrap(__FILE__, __LINE__); } $ret = GalleryCoreApi::registerFactoryImplementation( 'ExifInterface_1_0', 'ExifExtractor', 'Exif', 'modules/exif/classes/ExifExtractor.class', 'exif', null); if ($ret->isError()) { return $ret->wrap(__FILE__, __LINE__); }
--Bharat Mon, 2005-01-17 01:27
Description missing!
GalleryCoreApi::activatePlugin() and GalleryCoreApi::deactivatePlugin() now return an array where the second argument is a set of View redirect parameters. This matches the API in GalleryPlugin; we should have updated this when we updated the GalleryPlugin API but we forgot. This is not a commonly used method outside of the framework code, but it's not backwards compatible so it requires a bump in the Core API major number.
--Bharat Sun, 2005-01-23 23:19
function fetchChildAlbumItemIds($item, $offset=null, $count=null)
fetchChildAlbumItemIds is used to get the list of sub-albums from a given item
--User:Signe Fri, 2005-02-11 23:43
function removePluginParameterByValue( $pluginType, $pluginId, $parameterName, $parameterValue)
removePluginParameterByValue is used to remove a plugin parameter by its value instead of by its itemid. This is particularly useful in situations where the value might contain an itemid that has been deleted, but it could be contained under multiple itemids, or an unknown itemid.
--User:Signe Fri, 2005-02-11 23:43
Added function removeOnLoadHandlers($handlerIds)
Removes given factory impl ids from onLoadHandlers field of all entities (used when a module is uninstalled).
--User:Mindless Fri, 2005-02-18 12:00
Added function fetchLayoutId($item)
This just returns the right layout id for the item. If it's an album, it returns the album's layout. If it's an item, it returns the layout of its parent.
Deprecated fetchLayout($item) -- will be removed at next major api revision
--User:Bharat Fri, 2005-02-18 21:42
Removed some obsolete apis:
fetchLayout, setItemProperty, removeItemProperty, removeItemProperties, fetchItemPropertyKeys, fetchItemProperty, fetchAllItemProperties
--User:Mindless Tue, 2005-03-08 10:44
Added getThemeList (moved here from GalleryTheme class). Other api changes of note: Added GalleryTemplate::style() Themes no longer have a theme.inc Theme css now expected in themes/{themename}/theme.css
--User:Mindless Tue, 2005-03-08 10:44
Mime handling functions (GalleryCoreApi::convertExtensionToMime, GalleryCoreApi::convertMimeToExtensions, GalleryCoreApi::getMimeType and GalleryCoreApi::isViewableMimeType) return list ($ret, $value)
GalleryCoreApi::getMimeTypeMap and GalleryCoreApi::convertMimeToExtension are now obsolete and have been removed
--User:Virshu Sun, 2005-03-27 00:14
ByteNik and bharat's ACL/permissions refactor.. added fetchAccessListIds, maybeCompactAccessLists and compactAccessLists apis.
--User:Mindless Sat, 2005-04-09 14:30
Add GalleryCoreApi::sendTemplatedEmail() to add the capability to send an email based on a smarty template.
--User:Signe Sat, 2005-04-16 00:35
Added GalleryCoreApi::convertToUtf8() to allow you to change the character set of a string.
--User:Bharat Sat, 2005-04-16 19:01
Added GalleryCoreApi::fetchDescendentItemIds() to retrieve all descendents of a particular item (comes handy for recursive functions)
--User:Virshu Sun, 2005-04-17 10:16
Made $sourceEncoding parameter of convertToUtf8 optional.. it defaults to the character set of the currently selected locale.
--User:Mindless Wed, 2005-04-20 14:02
Added GalleryCoreApi::updateModificationTimestamp($entityId)... aka "touch"
--User:Mindless Wed, 2005-05-04 14:50
Added GalleryCoreApi::addMimeType($extension, $mimeType, $viewable)
--User:Bharat Thu, 2005-05-05 18:01
Added GalleryCoreApi::isPluginCompatibleWithApis
--User:Bharat Thu, 2005-05-12 10:14
Added GalleryCoreApi::getToolkitPriorityById()
--User:Signe Sun, 2005-05-22 14:16
Removed GalleryUrlGenerator::getCookiePath()
--User:Valiant Sun, 2005-05-29 13:49
Added optional $permission parameter for GalleryCoreApi::fetchParents() to return only ancestors with the given permission.
--User:Mindless Wed, 2005-06-08 12:13
hasItemPermission() now takes $userId getPermissions() now takes $userId studyPermissions now takes $userId fetchChildCounts now takes $userId fetchDescendentCounts now takes $userId fetchChildItemIds now takes $userId
--User:Bharat Sat, 2005-06-11 13:21
Added optional $headers parameter to sendTemplatedEmail.
--User:Mindless Sat, 2005-06-18 00:27
Added optional $fixBroken parameter to rebuildDerivativeCacheIfNotCurrent. (Change made by valiant)
--User:Mindless Sun, 2005-07-10 19:09
Added convertFromUtf8() (valiant) Added optional $userId parameter to fetchChildAlbumItemIds and fetchChildDataItemIds (mindless)
--User:Mindless Sun, 2005-08-07 16:06
Added optional $userId parameter to fetchAlbumTree (mindless)
--User:Mindless Sun, 2005-08-07 16:06
Added optional $selfId parameter to checkPathCollision and getLegalPathComponent
--User:Mindless Fri, 2005-08-12 11:10
Added fetchPluginList.. just exposing a function that already exists in GalleryPluginHelper_simple so the upgrader can call it.
--User:Mindless Sat, 2005-08-27 10:09
GalleryModule::performFactoryRegistrations is back, but a little different this time. It turns out that there was a problem with my last attempt to put factory registrations into the database, where registrations were not being removed for deactivated modules. The correct fix for this is to remove factory registrations when modules are deactivated, and add them back when they are re-activated.
Now, the way that it works is that GalleryModule::activate() will call performFactoryRegistrations() where your module will register all of its factory implementations. Take a look at the comment module in CVS to see an example of this.
--Bharat Sun, 2005-01-23 23:19
Added function getOnLoadHandlerIds()
Lists handlerIds module may register; used at module uninstall time to call above core api.
--User:Mindless Fri, 2005-02-18 12:00
Added GalleryPlugin::reactivate() (which affects both layouts and modules). This is used during the upgrade process to make sure that any deactivate/activate module and layout tasks happen properly at upgrade time.
--User:Bharat Sat, 2005-05-07 13:33
Naming convention change for views/controllers, now using "." as the separator, like "core.ShowItem". Bumped module/layout api versions and the version of every module/layout when updating all view/controller references to the new format. Old format is still accepted for now, so existing links for imageblock:External will still work, but it's a good idea to update them.
--User:Mindless Sun, 2005-05-29 07:27
getItemLinks() now takes $wantsDetailedLinks and $permissions getItemSummaries() now takes $permissions loadItemDetails() now takes $permissions
--User:Bharat Sat, 2005-06-11 13:21
Added $isDuringInstallOrUpgrade parameter to onLoad handlers. (Change made by valiant)
--User:Mindless Sun, 2005-07-10 19:09
Removed removeItemParameter and added removeParameter.
The actual api change is small but requires a major version bump as an api was removed.. but since we just put in major theme changes, this seems like a good time for major version bumps anyway.
--User:Mindless Sun, 2005-07-10 19:09
Added the new 'peerThumbnails' datatype to GalleryLayout::loadLayoutTemplate() so that we can get thumbnails for the peers, too.
--User:Bharat Fri, 2005-02-18 21:42
Refactored layout code to move the bulk of the loadTemplate logic into GalleryLayout. Now layouts can just implement loadAlbumTemplate() and loadItemTemplate() to render an album and an item. Renamed GalleryLayout::loadLayoutTemplate to GalleryLayout::loadCommonTemplateData and added more data types so that layouts have to do less work.
--User:Bharat Sat, 2005-05-07 13:33
Added GalleryPlugin::reactivate() (which affects both layouts and modules). This is used during the upgrade process to make sure that any deactivate/activate module and layout tasks happen properly at upgrade time.
--User:Bharat Sat, 2005-05-07 13:33
Naming convention change for views/controllers, now using "." as the separator, like "core.ShowItem". Bumped module/layout api versions and the version of every module/layout when updating all view/controller references to the new format. Old format is still accepted for now, so existing links for imageblock:External will still work, but it's a good idea to update them.
--User:Mindless Sun, 2005-05-29 07:27
Note that this is not a backwards compatible change. I've removed the 'url' value from the item links, so if in your template when you're building item links you were doing this:
<a href="{$link.url}">{$link.text}</a>
You should now do this instead:
<a href="{g->url params=$link.params}">{$link.text}</a>
--User:Bharat Sun, 2005-06-05 22:30
loadCommonTemplateData() takes new 'childItemLinksDetailed' data type
--User:Bharat Sat, 2005-06-11 13:21
Removed removeItemParameter and added removeParameter.
The actual api change is small but requires a major version bump as an api was removed.. but since we just put in major theme changes, this seems like a good time for major version bumps anyway.
--User:Mindless Sun, 2005-07-10 19:09
Added the permissions datatype to GalleryTheme::loadCommonTemplateData so which makes the item permissions avialable to the theme in a Smarty digestable format. (That means, we changed the dot in a permission to an underscore: core.addDataItem becomes core_addDataItem so when you use it in your template it'd be $theme.permissions.core_addDataItem)
--User:Bharat Mon, 2005-07-18 16:58