Architecture

General

The UML class diagram below shows the relations between the important classes. It is obvious that you call the static method getContentProviderRegistry() of the ContentProviderRegistrySingleton to obtain a Content Provider Registry Instance. This instance is the central starting point for all Image Gallery operations. To get a list with all content folders you would for example call getAllContentFolders which returns a List with ContentFolderModelFace instances.

To get the data (or more specific "images") of a content folder it is necessary to obtain the content provider type id of the content folder (getContentProviderTypeId() ). With this information you can get a Content Retrieval instance from the ContentProviderRegistry (method name: getContentRetrievalInstance ).

Now you can call getProperties() on the ContentFolderModelFace which returns a Map of PropertyModelFace s. Each Property has a key (schluessel) and a value (wert). The gallery defines several standard properties which e.g. hold path information and the location of the images of this folder. (You can find the list of Standard Properties within the project spcp7-imagegallery-abstraction-api within the enum spcp7.imagegallery.abstractionlayer.enums.DefaultProperties . The DefaultProperties are enhanced by the properties of the selected Content Provider. For further information on properties consider reading Implementing And Registering A New Content Provider .) With the retrieved properties of the content folder you can open a connection with the ContentRetrievalFace 's open method. After that you are ready to retrieve content. Call ContentRetrievalFace 's getVolumes(Map properties) method and receive ContentFace s. Et voila! We are done.
The ContentSubmitterFace and ContentManipulationFace are only drafts for possible future functionality and thus are not explained and implemented at the moment. For details on this refer to the associated API documentation.
For more code specific instructions on how to work with the Image Gallery API refer to Working With The Image Gallery API within the HOWTO section.

Property Handling

Content Provider can be very different when it comes to configuration options. To allow a generalized and flexible usage of properties within the gui each Content Provider can have its own default properties. These properties are merged with the default properties of the image gallery when a Content Provider of a Content Folder is changed or added. Default properties of Content Providers overwrite equally named keys of the image gallery's default properties. In this manner it is possible to provide special default values for image gallery default properties. The code which handles adding and deletion of default properties can be found in ContentProviderRegistryImpl . For an example you refer to the Alfresco Content Provider Implementation within the project spcp7-imagegallery-cp-impl-alfresco . For a more implementation focused explanation refer to Implementing And Registering A New Content Provider .

Spcp7 image gallery uml diagram