com.silverpeas.formsonline.model
Interface FormsOnlineDAO

All Known Implementing Classes:
FormsOnlineDAOJdbc

public interface FormsOnlineDAO


Method Summary
 FormDetail createForm(FormDetail formDetail)
          Save new form in database
 FormInstance createInstance(FormInstance instance)
           
 FormDetail deleteForm(FormPK pk)
          Delete Form from database
 void deleteRequest(RequestPK pk)
           
 List<FormDetail> findAllForms(String instanceId)
          Get all forms that has been created in given instance
 List<String> getAvailableFormIdsAsReceiver(String instanceId, String userId, String[] userGroupIds)
           
 FormDetail getForm(FormPK pk)
          Load forms from database with given instance Id and form id
 List<FormDetail> getForms(List<String> formIds)
           
 List<FormInstance> getReceivedRequests(FormPK pk, boolean allRequests, String userId)
          Get all requests associated to given form.
 List<String> getReceiversAsGroups(FormPK pk)
          Get the form's receivers list where groups has been declared directly.
 List<String> getReceiversAsUsers(FormPK pk)
          Get the form's receivers list where users has been declared directly.
 FormInstance getRequest(RequestPK pk)
           
 List<String> getSendersAsGroups(FormPK pk)
          Get the form's senders list where groups has been declared directly.
 List<String> getSendersAsUsers(FormPK pk)
          Get the form's senders list where users has been declared directly.
 List<FormInstance> getSentFormInstances(FormPK pk, String userId)
          Get all form instances that have been sent by given user (excepted the ones that have been archived.
 List<FormDetail> getUserAvailableForms(String componentId, String userId, String[] userGroupIds)
          Get the form available to be sent for given user or given groups
 void updateForm(FormDetail formDetail)
          Update form in database
 void updateReceivers(FormPK pk, String[] newUserReceiverIds, String[] newGroupReceiverIds)
          Update form receivers list.
 void updateRequest(FormInstance instance)
           
 void updateSenders(FormPK pk, String[] newUserSenderIds, String[] newGroupSenderIds)
          Update form senders list.
 

Method Detail

findAllForms

List<FormDetail> findAllForms(String instanceId)
                              throws FormsOnlineDatabaseException
Get all forms that has been created in given instance

Parameters:
instanceId - the instance id
Returns:
a List of FormDetail object
Throws:
FormsOnlineDatabaseException

getForm

FormDetail getForm(FormPK pk)
                   throws FormsOnlineDatabaseException
Load forms from database with given instance Id and form id

Parameters:
pk - the form primary key
Returns:
a FormDetail object
Throws:
FormsOnlineDatabaseException

createForm

FormDetail createForm(FormDetail formDetail)
                      throws FormsOnlineDatabaseException
Save new form in database

Parameters:
formDetail - the form detail
Returns:
the created FormDetail
Throws:
FormsOnlineDatabaseException

updateForm

void updateForm(FormDetail formDetail)
                throws FormsOnlineDatabaseException
Update form in database

Parameters:
formDetail - the form detail
Throws:
FormsOnlineDatabaseException

deleteForm

FormDetail deleteForm(FormPK pk)
                      throws FormsOnlineDatabaseException
Delete Form from database

Parameters:
pk - the pk of form to be deleted
Returns:
the deleted FormDetail
Throws:
FormsOnlineDatabaseException

updateSenders

void updateSenders(FormPK pk,
                   String[] newUserSenderIds,
                   String[] newGroupSenderIds)
                   throws FormsOnlineDatabaseException
Update form senders list.

Parameters:
pk - the form primary key
newUserSenderIds - the new sender list as user ids
newGroupSenderIds - the new sender list as group ids
Throws:
FormsOnlineDatabaseException

updateReceivers

void updateReceivers(FormPK pk,
                     String[] newUserReceiverIds,
                     String[] newGroupReceiverIds)
                     throws FormsOnlineDatabaseException
Update form receivers list.

Parameters:
pk - the form primary key
newUserReceiverIds - the new receivers list as user ids
newGroupReceiverIds - the new receivers list as group ids
Throws:
FormsOnlineDatabaseException

getSendersAsUsers

List<String> getSendersAsUsers(FormPK pk)
                               throws FormsOnlineDatabaseException
Get the form's senders list where users has been declared directly.

Parameters:
pk - the form primary key
Returns:
user ids as a list of String
Throws:
FormsOnlineDatabaseException

getSendersAsGroups

List<String> getSendersAsGroups(FormPK pk)
                                throws FormsOnlineDatabaseException
Get the form's senders list where groups has been declared directly.

Parameters:
pk - the form primary key
Returns:
group ids as a list of String
Throws:
FormsOnlineDatabaseException

getReceiversAsUsers

List<String> getReceiversAsUsers(FormPK pk)
                                 throws FormsOnlineDatabaseException
Get the form's receivers list where users has been declared directly.

Parameters:
pk - the form primary key
Returns:
user ids as a list of String
Throws:
FormsOnlineDatabaseException

getReceiversAsGroups

List<String> getReceiversAsGroups(FormPK pk)
                                  throws FormsOnlineDatabaseException
Get the form's receivers list where groups has been declared directly.

Parameters:
pk - the form primary key
Returns:
group ids as a list of String
Throws:
FormsOnlineDatabaseException

getUserAvailableForms

List<FormDetail> getUserAvailableForms(String componentId,
                                       String userId,
                                       String[] userGroupIds)
                                       throws FormsOnlineDatabaseException
Get the form available to be sent for given user or given groups

Parameters:
componentId - the component instance id
userId - the user id
userGroupIds - the user's groups id list
Returns:
a list of FormDetail objects
Throws:
FormsOnlineDatabaseException

getSentFormInstances

List<FormInstance> getSentFormInstances(FormPK pk,
                                        String userId)
                                        throws FormsOnlineDatabaseException
Get all form instances that have been sent by given user (excepted the ones that have been archived.

Parameters:
pk - the form primary key
userId - the user id
Returns:
a list of FormInstance objects
Throws:
FormsOnlineDatabaseException

getReceivedRequests

List<FormInstance> getReceivedRequests(FormPK pk,
                                       boolean allRequests,
                                       String userId)
                                       throws FormsOnlineDatabaseException
Get all requests associated to given form.

Parameters:
pk - the form primary key
allRequests -
userId - the user id
Returns:
if allRequests is false only requests to validate and requests validated by given user are returned. If true, all requests (validated or not) are returned.
Throws:
FormsOnlineDatabaseException

getAvailableFormIdsAsReceiver

List<String> getAvailableFormIdsAsReceiver(String instanceId,
                                           String userId,
                                           String[] userGroupIds)
                                           throws FormsOnlineDatabaseException
Throws:
FormsOnlineDatabaseException

createInstance

FormInstance createInstance(FormInstance instance)
                            throws FormsOnlineDatabaseException
Throws:
FormsOnlineDatabaseException

getRequest

FormInstance getRequest(RequestPK pk)
                        throws FormsOnlineDatabaseException
Throws:
FormsOnlineDatabaseException

getForms

List<FormDetail> getForms(List<String> formIds)
                          throws FormsOnlineDatabaseException
Throws:
FormsOnlineDatabaseException

updateRequest

void updateRequest(FormInstance instance)
                   throws FormsOnlineDatabaseException
Throws:
FormsOnlineDatabaseException

deleteRequest

void deleteRequest(RequestPK pk)
                   throws FormsOnlineDatabaseException
Throws:
FormsOnlineDatabaseException


Copyright © 2016 Silverpeas. All Rights Reserved.