spcp7.imagegallery.abstractionlayer.face
Interface ContentProviderRegistryFace

All Known Implementing Classes:
ContentProviderRegistryImpl

public interface ContentProviderRegistryFace

This interface describes the functions of the content provider registry. This class administers all functions concerning the content providers and serves as central contact point for everything which is content provider or content folder related.

Author:
Phillip Merensky

Method Summary
 java.lang.Long addContentFolder(ContentFolderModelFace contentFolder)
          With this method a new not yet existing content folder can be added.
 java.util.List<ContentFolderModelFace> getAllContentFolders()
          This method retrieves all content folders.
 ContentFolderModelFace getContentFolderById(java.lang.Long id)
          This method retrieves a content folder with the specified id.
 ContentFolderModelFace getContentFolderInstance()
          This method is a factory for a content folder instance to be independent of the underlying implementation.
 java.util.List<ContentFolderModelFace> getContentFolders(int from, int to)
          This method retrieves content folders.
 ContentFace getContentInstance()
          This method is a factory for a content instance to be independent of the underlying implementation.
 ContentManipulationFace getContentManipulatorInstance(java.lang.String typeID)
          Call this method if you need a content manipulator instance of the specified content provider.
 ContentProviderFace getContentProviderInstance(java.lang.String typeID)
          Call this method if you need an instance of a specified content provider
.
 java.util.List<java.lang.String> getContentProviders()
          This method retrieves a List of content providers.
 ContentRetrievalFace getContentRetrievalInstance(java.lang.String typeID)
          Call this method if you need a content retrieval instance of the specified content provider.
 ContentSubmitterFace getContentSubmitterInstance(java.lang.String typeID)
          Call this method if you need a content submitter instance of the specified content provider.
 java.util.Map<java.lang.String,PropertyModelFace> getDefaultProperties()
          This methods returns a list of spcp7 default properties.
 void registerContentFolderActionListener(ContentFolderActionListenerFace listener)
          This methods registers a listener for content folder actions.
 void removeContentFolder(java.lang.Long id)
          With this method a content folder can be removed by its id.
 void removeContentFolderActionListener(ContentFolderActionListenerFace listener)
          This method removes the specified listener from the content folder action listener list.
 java.lang.Long updateContentFolder(ContentFolderModelFace contentFolder)
          With this method a yet existing content folder can be updated.
 

Method Detail

getContentProviders

java.util.List<java.lang.String> getContentProviders()
This method retrieves a List of content providers. If a single content provider instance should be retrieved look at the instance retrieval methods like getContentManipulatorInstance(String), getContentProviderInstance(String), getContentRetrievalInstance(String) or getContentSubmitterInstance(String)

Returns:
List A list with strings of contentContentProviderTypeIds

getAllContentFolders

java.util.List<ContentFolderModelFace> getAllContentFolders()
                                                            throws ContentFoldersCouldNotBeRetrievedException
This method retrieves all content folders.

Returns:
List A list of all content folders.
Throws:
ContentFoldersCouldNotBeRetrievedException

getContentFolders

java.util.List<ContentFolderModelFace> getContentFolders(int from,
                                                         int to)
                                                         throws ContentFoldersCouldNotBeRetrievedException,
                                                                RangeNotValidException
This method retrieves content folders. Only the specified range of the result set will be returned.

Parameters:
from - The lower border
to - The upper border
Returns:
List A list of content folders within the specified range.
Throws:
RangeNotValidException - If the provided range is not valid (eg. from bigger than to)
ContentFoldersCouldNotBeRetrievedException

addContentFolder

java.lang.Long addContentFolder(ContentFolderModelFace contentFolder)
                                throws ContentFolderValidationException,
                                       ContentProviderNotAvailableException,
                                       PropertyNumberValidationException,
                                       PropertyBooleanValidationException
With this method a new not yet existing content folder can be added. For updates of content folders use updateContentFolder(ContentFolderModelFace). Properties of the content folder and the default properties of the gallery will be merged so that properties of the content folder overwrite the default properties of the image gallery if the keys are the same.

Parameters:
contentFolder - The content folder which should be added. The id should not be set. If it is set, it will be overwritten.
Returns:
The id of the yet inserted content folder
Throws:
ContentFolderValidationException
ContentProviderNotAvailableException
PropertyNumberValidationException
PropertyBooleanValidationException

updateContentFolder

java.lang.Long updateContentFolder(ContentFolderModelFace contentFolder)
                                   throws ContentFolderValidationException,
                                          ContentProviderNotAvailableException,
                                          PropertyNumberValidationException,
                                          PropertyBooleanValidationException
With this method a yet existing content folder can be updated. Obviously the ContentFolderModelFace.getId() field has to be set. All values (set or unset) of the provided content folder will be overwritten in the older persisted instance.

Parameters:
contentFolder - The new content folder which with new values which should replace the old one with the same id
Returns:
The id of the updated content folder
Throws:
ContentFolderValidationException
ContentProviderNotAvailableException
PropertyNumberValidationException
PropertyBooleanValidationException

removeContentFolder

void removeContentFolder(java.lang.Long id)
With this method a content folder can be removed by its id.

Parameters:
id - The id of the content folder which should be removed

getContentProviderInstance

ContentProviderFace getContentProviderInstance(java.lang.String typeID)
                                               throws ContentProviderNotAvailableException
Call this method if you need an instance of a specified content provider
. To know the typeIDs of the current available content providers use getContentProviders().

Parameters:
typeID - The typeID of the content provider which should be retrieved.
Returns:
the singleton instance of the specified content provider
Throws:
ContentProviderNotAvailableException

getContentSubmitterInstance

ContentSubmitterFace getContentSubmitterInstance(java.lang.String typeID)
                                                 throws ContentProviderNotAvailableException,
                                                        FeatureNotProvidedException
Call this method if you need a content submitter instance of the specified content provider. This method CAN be implemented. If not an exception will be thrown.

Parameters:
typeID - The typeID of the content provider from which the content submitter instance should be retrieved.
Returns:
The singleton content submitter instance of the underlying content provider.
Throws:
ContentProviderNotAvailableException
FeatureNotProvidedException - If submission is not available for the specified content provider

getContentManipulatorInstance

ContentManipulationFace getContentManipulatorInstance(java.lang.String typeID)
                                                      throws ContentProviderNotAvailableException,
                                                             FeatureNotProvidedException
Call this method if you need a content manipulator instance of the specified content provider. This method CAN be implemented. If it is not an exception will be thrown.

Parameters:
typeID - The typeID of the content provider from which the content manipulator instance should be retrieved.
Returns:
The singleton content manipulator instance of the underlying content provider.
Throws:
ContentProviderNotAvailableException
FeatureNotProvidedException - If manipulation is not available for the specified content provider

getContentRetrievalInstance

ContentRetrievalFace getContentRetrievalInstance(java.lang.String typeID)
                                                 throws ContentProviderNotAvailableException
Call this method if you need a content retrieval instance of the specified content provider. This method must be implemented by every content provider

Parameters:
typeID - The typeID of the content provider from which the content retrieval instance should be retrieved.
Returns:
The singleton content retrieval instance of the underlying content provider.
Throws:
ContentProviderNotAvailableException

getContentFolderInstance

ContentFolderModelFace getContentFolderInstance()
This method is a factory for a content folder instance to be independent of the underlying implementation.

Returns:
A new fresh content folder instance

getContentFolderById

ContentFolderModelFace getContentFolderById(java.lang.Long id)
This method retrieves a content folder with the specified id.

Parameters:
id - The id of the content folder which should be retrieved
Returns:
A value copied instance of the content folder with the specified id.

getContentInstance

ContentFace getContentInstance()
This method is a factory for a content instance to be independent of the underlying implementation.

Returns:
A new fresh content instance

registerContentFolderActionListener

void registerContentFolderActionListener(ContentFolderActionListenerFace listener)
This methods registers a listener for content folder actions. The registered listeners will not be persisted and thus have to be reregistered when a new instance of the content provider registry will be created.

Parameters:
listener - A class implementing ContentFolderActionListenerFace

removeContentFolderActionListener

void removeContentFolderActionListener(ContentFolderActionListenerFace listener)
This method removes the specified listener from the content folder action listener list.

Parameters:
listener - A class implementing ContentFolderActionListenerFace

getDefaultProperties

java.util.Map<java.lang.String,PropertyModelFace> getDefaultProperties()
This methods returns a list of spcp7 default properties. That is properties that are essential for the operation of the whole concept.
These properties can be overwritten within a class implementing ContentProviderFace. Properties of ContentProviderFace implementations and these default properties will be merged when adding a new content folder. In this case properties of the content provider with the same PropertyModelFace.setSchluessel(String) will overwrite properties of this method.

Returns:
A Map containing key (PropertyModelFace.setSchluessel(String)) value associations of default properties.


Copyright © 2008. All Rights Reserved.