com.objectplanet.survey.plugin.api
Class ResourceManager

java.lang.Object
  extended by com.objectplanet.survey.plugin.api.ResourceManager

public class ResourceManager
extends java.lang.Object

Encapsulates functionality to manage reusable resources.

Author:
Irina Brun

Constructor Summary
ResourceManager()
           
 
Method Summary
static long createInviteeList(User user, InviteeList inviteeList)
          Creates a new reusable invitee list in the storage.
static void deleteInviteeList(User user, long inviteeListId)
          Delete an invitee list.
static InviteeList getInviteeList(User user, long inviteeListId)
          Gets the invitee list.
static ListItem[] getInviteeLists(User user)
          Gets the invitee lists for this user (array of ListItems)
static void updateInviteeList(User user, InviteeList inviteeList)
          Updates the invitee list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceManager

public ResourceManager()
Method Detail

getInviteeList

public static InviteeList getInviteeList(User user,
                                         long inviteeListId)
                                  throws SurveySecurityException,
                                         SurveySystemException
Gets the invitee list. Requires read access to the invitee list

Parameters:
user - Current user
inviteeListId - Invitee list id
Returns:
The Invitee list
Throws:
SurveySystemException - If an error occurs in the business logic.
SurveySecurityException - If not authorized

getInviteeLists

public static ListItem[] getInviteeLists(User user)
                                  throws SurveySystemException
Gets the invitee lists for this user (array of ListItems)

Parameters:
user - Current user
Returns:
The invitee lists(array of ListItems)
Throws:
SurveySystemException

createInviteeList

public static long createInviteeList(User user,
                                     InviteeList inviteeList)
                              throws SurveySystemException
Creates a new reusable invitee list in the storage. The user will get admin access to the invitee list. Note that the newly created invitee list will be visible to the user from the next login.

Parameters:
user - User who create the invitee list and will get unlimited access to it
inviteeList - Invitee list to create
Returns:
inviteeListId Returns id for the newly created invitee list
Throws:
SurveySystemException - If an error occurs in the business logic.

deleteInviteeList

public static void deleteInviteeList(User user,
                                     long inviteeListId)
                              throws SurveySystemException,
                                     SurveySecurityException
Delete an invitee list. Requires admin access to the invitee list.

Parameters:
user - Current user
inviteeListId - The invitee list id
Throws:
SurveySecurityException - If unauthorized
SurveySystemException - If an error occurs in the business logic.

updateInviteeList

public static void updateInviteeList(User user,
                                     InviteeList inviteeList)
                              throws SurveySystemException,
                                     SurveySecurityException
Updates the invitee list. Requires modify permission to the invitee list.

Parameters:
user - Current user
inviteeList - Invitee list to update
Throws:
SurveySystemException - If an error occurs in the business logic.
SurveySecurityException - If unauthorized

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016