com.flexive.shared.interfaces
Interface ResultPreferencesEngine

All Known Subinterfaces:
ResultPreferencesEngineLocal

public interface ResultPreferencesEngine

Interface for retrieving and updating the displayed result properties.

Version:
$Rev: 2906 $
Author:
Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)

Method Summary
 boolean isCustomized(long typeId, ResultViewType viewType, ResultLocation location)
          Returns true when the user actually stored a configuration for the given parameters.
 ResultPreferences load(long typeId, ResultViewType viewType, ResultLocation location)
          Loads the result preferences for the given type for the current user.
 ResultPreferences loadSystemDefault(long typeId, ResultViewType viewType, ResultLocation location)
          Loads the system default result preferences for the given type.
 void remove(long typeId, ResultViewType viewType, ResultLocation location)
          Remove the current user's preferences for the given parameters.
 void save(ResultPreferences preferences, long typeId, ResultViewType viewType, ResultLocation location)
          Save the given result preferences for the current user.
 void saveInSource(ResultPreferences preferences, long typeId, ResultViewType viewType, ResultLocation location)
          Save the given result preferences for the current user, using the type ID where the existing result preferences are stored.
 void saveSystemDefault(ResultPreferences preferences, long typeId, ResultViewType viewType, ResultLocation... locations)
          Save the given result preferences as the default settings for the given type, viewtype, and location.
 

Method Detail

load

ResultPreferences load(long typeId,
                       ResultViewType viewType,
                       ResultLocation location)
                       throws FxApplicationException
Loads the result preferences for the given type for the current user. When no preferences are defined for the given parameters, the default preferences are returned.

Parameters:
typeId - the content type ID, or -1 for the "overall" properties
viewType - the view type (list, thumbs)
location - the "location" where the results will be displayed (e.g. the main admin result pages)
Returns:
the result preferences for the given type for the current user.
Throws:
FxApplicationException - if the result preferences could not be loaded

loadSystemDefault

ResultPreferences loadSystemDefault(long typeId,
                                    ResultViewType viewType,
                                    ResultLocation location)
                                    throws FxApplicationException
Loads the system default result preferences for the given type. When no preferences are defined for the given parameters, an empty ResultPreferences object is returned.

Parameters:
typeId - the content type ID, or -1 for the "overall" properties
viewType - the view type (list, thumbs)
location - the "location" where the results will be displayed (e.g. the main admin result pages)
Returns:
the system default result preferences for the given type.
Throws:
FxApplicationException - if the result preferences could not be loaded

isCustomized

boolean isCustomized(long typeId,
                     ResultViewType viewType,
                     ResultLocation location)
                     throws FxApplicationException
Returns true when the user actually stored a configuration for the given parameters. Used to check if fallbacks were used when loading preferences via load(long, com.flexive.shared.search.ResultViewType, com.flexive.shared.search.ResultLocation).

Parameters:
typeId - the content type ID, or -1 for the "overall" properties
viewType - the view type (list, thumbs)
location - the "location" where the results will be displayed (e.g. the main admin result pages)
Returns:
true when the user actually stored a configuration for the given parameters
Throws:
FxApplicationException - on errors

save

void save(ResultPreferences preferences,
          long typeId,
          ResultViewType viewType,
          ResultLocation location)
          throws FxApplicationException
Save the given result preferences for the current user.

Parameters:
preferences - the preferences to be saved
typeId - the content type ID
viewType - the view type (list, thumbs)
location - the "location" where the results will be displayed
Throws:
FxApplicationException - if the result preferences could not be updated

saveInSource

void saveInSource(ResultPreferences preferences,
                  long typeId,
                  ResultViewType viewType,
                  ResultLocation location)
                  throws FxApplicationException
Save the given result preferences for the current user, using the type ID where the existing result preferences are stored. If a type does not specify result preferences, the fallback preferences will be updated.

Only when a user has no own result preferences and uses the system default's, a new configuration entry will be created (instead of updating the shared result preferences).

Parameters:
preferences - the preferences to be saved
typeId - the content type ID
viewType - the view type (list, thumbs)
location - the "location" where the results will be displayed
Throws:
FxApplicationException - if the result preferences could not be updated
Since:
3.1

saveSystemDefault

void saveSystemDefault(ResultPreferences preferences,
                       long typeId,
                       ResultViewType viewType,
                       ResultLocation... locations)
                       throws FxApplicationException
Save the given result preferences as the default settings for the given type, viewtype, and location. Only the global supervisor can do this.

Parameters:
preferences - the preferences to be saved
typeId - the content type ID
viewType - the view type (list, thumbs)
locations - the result location(s) where the results will be displayed
Throws:
FxApplicationException - if the result preferences could not be updated

remove

void remove(long typeId,
            ResultViewType viewType,
            ResultLocation location)
            throws FxApplicationException
Remove the current user's preferences for the given parameters. If no preferences exist for the given parameters, no action is performed.

Parameters:
typeId - the content type ID, or -1 for the "overall" properties
viewType - the view type (list, thumbs)
location - the "location" where the results will be displayed (e.g. the main admin result pages)
Throws:
FxApplicationException - if the user's preferences could not be removed