com.sap.netweaver.kmc.people.photo.service

Interface IUserPhotoService


public interface IUserPhotoService

KM Service providing photos functionality for users.
The standard UI works with 2 types of photos - "NORMAL" and "PREVIEW" - case sensitive
The relevant configurations for both types can be seen and changed in Enterprise Portal, System Administration -> System Configuration -> Knowledge Management -> Content Management -> Global Services -> (Advanced Options) -> UserPhoto -> Photo Types.
KM does not deliver any default implementations of Photo Filters (which are applied with uploadPhoto(String, InputStream, String, boolean, boolean), copyPhoto(String, String, String, boolean, boolean) movePhoto(String, String, String, boolean, boolean) when withFilters parameter is true).
However, you can set filters by setPhotoFilters(IPhotoFilter[]) method.


Field Summary
static String KEY
           
 
Method Summary
 void copyPhoto(String uniqueID, String sourceType, String targetType, boolean withCheckers, boolean withFilters)
          Copy a photo from one type to another
 void deletePhoto(String uniqueID, String type)
          Delete the photo associated to the given user
 int getCachePeriod()
          Return the Client Cache period (in hours) used in HTTP headers 0 hours means no client cache (http header no-cahce=true)
 InputStream getDefaultPhoto(String type)
          Return a standard photo that can be use as a replacement if the user has no photo.
 InputStream getDisplayedPhoto(String uniqueID, String type)
           
 InputStream getPhoto(String uniqueID, String type)
           
 String getPhotoCacheKey(com.sap.security.api.IUser user)
           
 String getPhotoCacheKey(String uniqueID)
           
 PhotoChecker[] getPhotoCheckers(String type)
          Return the checkers that will be applied before uploading a picture
 IPhotoFilter[] getPhotoFilters()
           
 IPhotoFilter[] getPhotoFilters(String type)
          Return the filters applied to in the upload process
 InputStream getPrefetchedPhoto(String uniqueID, String type)
          Get the previously prefetched photo
 boolean hasPhoto(String uniqueID, String type)
          Return true is the user has already a photo associated
 void movePhoto(String uniqueID, String sourceType, String targetType, boolean withCheckers, boolean withFilters)
          Move a photo from one type to another
 void prefetchUserPhotos(String[] uniqueIDs, String type)
          Prefetch the User Photos with a mass call to the UME Use the server cache (RID) to store the photo If server cache is disabled, the photos are removed from there when getPrefetchedPhoto is called
 void setPhotoFilters(IPhotoFilter[] photoFilters)
          Sets photo filters that will be applied from the service
 void uploadPhoto(String uniqueID, File file, String type)
          Upload a photo with the configured checkers and filters
 void uploadPhoto(String uniqueID, File file, String type, boolean withCheckers, boolean withFilters)
          Upload a photo
 void uploadPhoto(String uniqueID, InputStream file, String type)
          Upload a photo with the configured checkers and filters
 void uploadPhoto(String uniqueID, InputStream file, String type, boolean withCheckers, boolean withFilters)
          Upload a photo
 

Field Detail

KEY

static final String KEY
See Also:
Constant Field Values
Method Detail

deletePhoto

void deletePhoto(String uniqueID,
                 String type)
                 throws UserPhotoException
Delete the photo associated to the given user

Parameters:
uniqueID - uniquely identifying an user
type - the type of photo to be deleted
Throws:
UserPhotoException

hasPhoto

boolean hasPhoto(String uniqueID,
                 String type)
                 throws UserPhotoException
Return true is the user has already a photo associated

Parameters:
uniqueID - uniquely identifying an user
type - the type of photo
Returns:
Throws:
UserPhotoException

uploadPhoto

void uploadPhoto(String uniqueID,
                 InputStream file,
                 String type)
                 throws IOException,
                        UserPhotoException
Upload a photo with the configured checkers and filters

Parameters:
uniqueID -
file -
type -
Throws:
IOException
UserPhotoException

uploadPhoto

void uploadPhoto(String uniqueID,
                 InputStream file,
                 String type,
                 boolean withCheckers,
                 boolean withFilters)
                 throws IOException,
                        UserPhotoException
Upload a photo

Parameters:
uniqueID -
file -
type -
withCheckers -
withFilters -
Throws:
IOException
UserPhotoException

copyPhoto

void copyPhoto(String uniqueID,
               String sourceType,
               String targetType,
               boolean withCheckers,
               boolean withFilters)
               throws IOException,
                      UserPhotoException
Copy a photo from one type to another

Parameters:
uniqueID -
sourceType -
targetType -
withCheckers -
withFilters -
Throws:
IOException
UserPhotoException

movePhoto

void movePhoto(String uniqueID,
               String sourceType,
               String targetType,
               boolean withCheckers,
               boolean withFilters)
               throws IOException,
                      UserPhotoException
Move a photo from one type to another

Parameters:
uniqueID -
sourceType -
targetType -
withCheckers -
withFilters -
Throws:
IOException
UserPhotoException

uploadPhoto

void uploadPhoto(String uniqueID,
                 File file,
                 String type)
                 throws IOException,
                        UserPhotoException
Upload a photo with the configured checkers and filters

Parameters:
uniqueID -
file -
type -
Throws:
IOException
UserPhotoException

uploadPhoto

void uploadPhoto(String uniqueID,
                 File file,
                 String type,
                 boolean withCheckers,
                 boolean withFilters)
                 throws IOException,
                        UserPhotoException
Upload a photo

Parameters:
uniqueID -
file -
type -
withCheckers -
withFilters -
Throws:
IOException
UserPhotoException

getPhoto

InputStream getPhoto(String uniqueID,
                     String type)
                     throws IOException,
                            NoPhotoFoundException
Throws:
IOException
NoPhotoFoundException

getDisplayedPhoto

InputStream getDisplayedPhoto(String uniqueID,
                              String type)
                              throws IOException,
                                     NoPhotoFoundException
Throws:
IOException
NoPhotoFoundException

getDefaultPhoto

InputStream getDefaultPhoto(String type)
                            throws IOException,
                                   NoPhotoFoundException
Return a standard photo that can be use as a replacement if the user has no photo.

Parameters:
type -
Returns:
Throws:
IOException
UserPhotoException
NoPhotoFoundException

getPhotoCheckers

PhotoChecker[] getPhotoCheckers(String type)
                                throws UserPhotoException
Return the checkers that will be applied before uploading a picture

Returns:
an array of checkers or an empty array if no checker is available
Throws:
UserPhotoException

getPhotoFilters

IPhotoFilter[] getPhotoFilters(String type)
                               throws UserPhotoException
Return the filters applied to in the upload process

Returns:
an array of filters or an empty array if no checker is available
Throws:
UserPhotoException

getCachePeriod

int getCachePeriod()
Return the Client Cache period (in hours) used in HTTP headers 0 hours means no client cache (http header no-cahce=true)


prefetchUserPhotos

void prefetchUserPhotos(String[] uniqueIDs,
                        String type)
                        throws IOException,
                               NoPhotoFoundException
Prefetch the User Photos with a mass call to the UME Use the server cache (RID) to store the photo If server cache is disabled, the photos are removed from there when getPrefetchedPhoto is called

Parameters:
uniqueIDs - The users' ids whose photos will be prefetched
Throws:
IOException
NoPhotoFoundException

getPrefetchedPhoto

InputStream getPrefetchedPhoto(String uniqueID,
                               String type)
                               throws IOException,
                                      NoPhotoFoundException
Get the previously prefetched photo

Parameters:
uniqueID -
Returns:
Throws:
IOException
NoPhotoFoundException

getPhotoCacheKey

String getPhotoCacheKey(String uniqueID)
                        throws com.sap.security.api.UMException
Throws:
com.sap.security.api.UMException

getPhotoCacheKey

String getPhotoCacheKey(com.sap.security.api.IUser user)
                        throws com.sap.security.api.UMException
Throws:
com.sap.security.api.UMException

getPhotoFilters

IPhotoFilter[] getPhotoFilters()

setPhotoFilters

void setPhotoFilters(IPhotoFilter[] photoFilters)
Sets photo filters that will be applied from the service

Parameters:
photoFilters -
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM


Copyright 2011 SAP AG Complete Copyright Notice