spcp7.imagegallery.impl.alfresco
Class AlfrescoContentRetrievalImpl

java.lang.Object
  extended by spcp7.imagegallery.impl.alfresco.AlfrescoContentRetrievalImpl
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, ContentConnectionFace, ContentRetrievalFace

public class AlfrescoContentRetrievalImpl
extends java.lang.Object
implements ContentRetrievalFace, org.springframework.context.ApplicationContextAware

Implementation of an Alfresco content provider.

Author:
Phillip Merensky

Constructor Summary
AlfrescoContentRetrievalImpl()
          Empty standard constructor
 
Method Summary
 void close()
          This method must be called after all content actions are done.
 java.lang.String createFolder(java.lang.String name, java.util.Map<java.lang.String,PropertyModelFace> properties)
          This method and #removeFolder(String, Map) are currently only for testing purposes.
 ContentFace getParent(java.lang.String proprietaryId, java.util.Map<java.lang.String,PropertyModelFace> properties)
          Additionally to the properties mentioned in the interface AlfrescoDefaultProperties.ALFRESCO_MAX_RESULT_ROWS, AlfrescoDefaultProperties.ALFRESCO_SPACES_STORE and AlfrescoDefaultProperties.ALFRESCO_WORKSPACE_STORE properties are needed.
 java.util.List<ContentFace> getVolumes(java.util.Map<java.lang.String,PropertyModelFace> properties, boolean isFolder)
          Additionally to the properties mentioned in the interface AlfrescoDefaultProperties.ALFRESCO_MAX_RESULT_ROWS, AlfrescoDefaultProperties.ALFRESCO_SPACES_STORE and AlfrescoDefaultProperties.ALFRESCO_WORKSPACE_STORE properties are needed.
 java.util.List<ContentFace> getVolumesFromTo(int lowerLimit, int upperLimit, java.util.Map<java.lang.String,PropertyModelFace> properties, boolean isFolder)
          Additionally to the properties mentioned in the interface AlfrescoDefaultProperties.ALFRESCO_MAX_RESULT_ROWS, AlfrescoDefaultProperties.ALFRESCO_SPACES_STORE and AlfrescoDefaultProperties.ALFRESCO_WORKSPACE_STORE properties are needed.
 void open(java.util.Map<java.lang.String,PropertyModelFace> properties)
          Additionally to the properties mentioned in the interface AlfrescoDefaultProperties.ALFRESCO_USERNAME and AlfrescoDefaultProperties.ALFRESCO_PASSWORD properties are needed.
 void removeFolder(java.util.Map<java.lang.String,PropertyModelFace> properties)
          This method and createFolder(String, Map) are currently only for testing purposes.
 void setAlfrescoUtils(AlfrescoUtils alfrescoUtils)
          Injected by Spring.
 void setAlfrescoValidation(AlfrescoValidation alfrescoValidation)
          Injected by Spring.
 void setApplicationContext(org.springframework.context.ApplicationContext arg0)
          Injected by Spring.
 void setContentComparator(java.util.Comparator<ContentFace> contentComparator)
          Injected by Spring.
 void setGeneralValidation(GeneralValidation generalValidation)
          Injected by Spring.
 void setImageFilter(ImageFilterFace imageFilterFace)
          Injected by Spring.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlfrescoContentRetrievalImpl

public AlfrescoContentRetrievalImpl()
Empty standard constructor

Method Detail

close

public void close()
Description copied from interface: ContentConnectionFace
This method must be called after all content actions are done.

Specified by:
close in interface ContentConnectionFace

createFolder

public java.lang.String createFolder(java.lang.String name,
                                     java.util.Map<java.lang.String,PropertyModelFace> properties)
                              throws ContentCouldNotBeAccessedException
This method and #removeFolder(String, Map) are currently only for testing purposes. That is for inserting and deleting test content. Later they could be used within a class implementing the ContentSubmitterFace for example.

Parameters:
name - The name of the folder
properties - The following properties are required: AlfrescoDefaultProperties.ALFRESCO_SPACES_STORE, AlfrescoDefaultProperties.ALFRESCO_WORKSPACE_STORE, DefaultProperties.SPCP7_CURRENT_PATH
Returns:
The id of the new folder *
Throws:
ContentCouldNotBeAccessedException - if the folder could not be deleted or the repository could not be reached.

getParent

public ContentFace getParent(java.lang.String proprietaryId,
                             java.util.Map<java.lang.String,PropertyModelFace> properties)
                      throws ContentCouldNotBeAccessedException,
                             NoContentFoundException
Additionally to the properties mentioned in the interface AlfrescoDefaultProperties.ALFRESCO_MAX_RESULT_ROWS, AlfrescoDefaultProperties.ALFRESCO_SPACES_STORE and AlfrescoDefaultProperties.ALFRESCO_WORKSPACE_STORE properties are needed.

Specified by:
getParent in interface ContentRetrievalFace
Returns:
Throws:
ContentCouldNotBeAccessedException
NoContentFoundException
See Also:
spcp7.imagegallery.contentprovider.face.ContentRetrievalFace#getParent(spcp7.imagegallery.abstractionlayer.face.ContentFace, java.util.Map)

getVolumes

public java.util.List<ContentFace> getVolumes(java.util.Map<java.lang.String,PropertyModelFace> properties,
                                              boolean isFolder)
                                       throws PropertyValidationException,
                                              ContentCouldNotBeAccessedException,
                                              NoContentFoundException
Additionally to the properties mentioned in the interface AlfrescoDefaultProperties.ALFRESCO_MAX_RESULT_ROWS, AlfrescoDefaultProperties.ALFRESCO_SPACES_STORE and AlfrescoDefaultProperties.ALFRESCO_WORKSPACE_STORE properties are needed.

Specified by:
getVolumes in interface ContentRetrievalFace
Parameters:
properties - the properties of the specified path.
isFolder - True if the path specifies a folder, false otherwise.
Returns:
A List with ContentFaces or a List with only one element if param isFolder was false.
Throws:
PropertyValidationException - If a property is missing or has the wrong value.
ContentCouldNotBeAccessedException - If the content could not be accessed. This may hav several reasons. Look at the exception message to get the details.
NoContentFoundException - If the query was correct but no content was found.
See Also:
spcp.imagegallery.abstractionlayer.face.external.ContentRetrievalFace#getVolumes(java.lang.String)

getVolumesFromTo

public java.util.List<ContentFace> getVolumesFromTo(int lowerLimit,
                                                    int upperLimit,
                                                    java.util.Map<java.lang.String,PropertyModelFace> properties,
                                                    boolean isFolder)
                                             throws RangeNotValidException,
                                                    PropertyValidationException,
                                                    ContentCouldNotBeAccessedException,
                                                    NoContentFoundException
Additionally to the properties mentioned in the interface AlfrescoDefaultProperties.ALFRESCO_MAX_RESULT_ROWS, AlfrescoDefaultProperties.ALFRESCO_SPACES_STORE and AlfrescoDefaultProperties.ALFRESCO_WORKSPACE_STORE properties are needed.

Specified by:
getVolumesFromTo in interface ContentRetrievalFace
Parameters:
lowerLimit - The lower limit of the result set
upperLimit - The upper limit of the result set
properties - the properties of the specified path.
isFolder - True if the path specifies a folder, false otherwise.
Returns:
A List with ContentFaces
Throws:
RangeNotValidException - if the specified range is not valid.
PropertyValidationException - If a property is missing or has the wrong value.
ContentCouldNotBeAccessedException - If the content could not be accessed. This may hav several reasons. Look at the exception message to get the details.
NoContentFoundException - If the query was correct but no content was found.
See Also:
ContentRetrievalFace.getVolumesFromTo(int, int, java.util.Map, boolean)

open

public void open(java.util.Map<java.lang.String,PropertyModelFace> properties)
          throws PropertyValidationException,
                 ContentProviderAuthenticationException
Additionally to the properties mentioned in the interface AlfrescoDefaultProperties.ALFRESCO_USERNAME and AlfrescoDefaultProperties.ALFRESCO_PASSWORD properties are needed.

Specified by:
open in interface ContentConnectionFace
Parameters:
properties - The map of properties of the content provider which specifies all needed options.
Throws:
PropertyValidationException - if the properties do not contain needed fields or these fields are invalid.
ContentProviderAuthenticationException - If the user could not be authenticated/logged in with the provided credentials.
See Also:
ContentConnectionFace.open(java.util.Map)

removeFolder

public void removeFolder(java.util.Map<java.lang.String,PropertyModelFace> properties)
                  throws ContentCouldNotBeAccessedException
This method and createFolder(String, Map) are currently only for testing purposes. That is for inserting and deleting test content. Later they could be used within a class implementing the ContentSubmitterFace. The key DefaultProperties.SPCP7_CURRENT_PATH defines the foldr which should be deleted.

Parameters:
properties - The following properties are required: AlfrescoDefaultProperties.ALFRESCO_SPACES_STORE, AlfrescoDefaultProperties.ALFRESCO_WORKSPACE_STORE, DefaultProperties.SPCP7_CURRENT_PATH
Throws:
ContentCouldNotBeAccessedException - if the folder could not be deleted or the repository could not be reached.

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext arg0)
                           throws org.springframework.beans.BeansException
Injected by Spring.

Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException
See Also:
ApplicationContextAware.setApplicationContext(org.springframework.context.ApplicationContext)

setContentComparator

public void setContentComparator(java.util.Comparator<ContentFace> contentComparator)
Injected by Spring.

Parameters:
contentComparator - the contentComparator to set

setImageFilter

public void setImageFilter(ImageFilterFace imageFilterFace)
Injected by Spring.

Parameters:
imageFilterFace - the imageFilterFace to set

setAlfrescoValidation

public void setAlfrescoValidation(AlfrescoValidation alfrescoValidation)
Injected by Spring.

Parameters:
alfrescoValidation - the alfrescoValidation to set

setGeneralValidation

public void setGeneralValidation(GeneralValidation generalValidation)
Injected by Spring.

Parameters:
generalValidation - the generalValidation to set

setAlfrescoUtils

public void setAlfrescoUtils(AlfrescoUtils alfrescoUtils)
Injected by Spring.

Parameters:
alfrescoUtils - the alfrescoUtils to set


Copyright © 2008. All Rights Reserved.