Interface FormsOnlineDAO
- All Known Implementing Classes:
FormsOnlineDAOJdbc
public interface FormsOnlineDAO
-
Method Summary
Modifier and TypeMethodDescriptioncreateForm(FormDetail formDetail) Save new form in databasedeleteForm(FormPK pk) Delete Form from databasevoidfindAllForms(String instanceId, String orderBy) Get all forms that has been created in given instanceorg.silverpeas.core.util.SilverpeasList<FormInstance> getAllRequests(FormPK pk) Load forms from database with given instance Id and form idgetForms(Collection<String> formIds) getNumberOfRequestsByForm(String instanceId) Gets the possibleFormInstanceValidationTypeinstances mapped by form identifiers.org.silverpeas.core.util.SilverpeasList<FormInstance> getReceivedRequests(FormDetail form, List<Integer> states, RequestValidationCriteria validatorCriteria, org.silverpeas.core.admin.PaginationPage paginationPage) Get all requests associated to given form ordered from the newest to the older.getReceiversAsGroups(FormPK pk, String rightType) Get the form's receivers list where groups has been declared directly.getReceiversAsUsers(FormPK pk, String rightType) Get the form's receivers list where users has been declared directly.getRequest(RequestPK pk) Get the form's senders list where groups has been declared directly.Get the form's senders list where users has been declared directly.org.silverpeas.core.util.SilverpeasList<FormInstance> getSentFormInstances(FormPK pk, String userId, List<Integer> states, org.silverpeas.core.admin.PaginationPage paginationPage) Get all form instances that have been sent by given user (excepted the ones that have been archived.getUserAvailableForms(Collection<String> componentIds, String userId, String[] userGroupIds, String orderBy) Get the form available to be sent for given user or given groupsgetValidatorFormIdsWithValidationTypes(String instanceId, String validatorId, String[] validatorGroupIds, Collection<String> formIds) Gets theFormInstanceValidationTypeinstances mapped by form identifiers of the the validator represented by given validator id and validator group ids on the given component instance.saveRequest(FormInstance request) Inserts or updates the given request (also called a form instance).voidsaveRequestState(FormInstance request) Saves the state of the given request without updating anything else.voidupdateForm(FormDetail formDetail) Update form in databasevoidupdateReceivers(FormPK pk, Map<String, org.silverpeas.kernel.util.Pair<List<String>, List<String>>> userAndGroupIdsByRightTypes) Updates the form rights from given parameters.voidupdateSenders(FormPK pk, Map<String, org.silverpeas.kernel.util.Pair<List<String>, List<String>>> userAndGroupIdsByRightTypes) Update form senders list.
-
Method Details
-
findAllForms
Get all forms that has been created in given instance- Parameters:
instanceId- the instance idorderBy- sort order method- Returns:
- a List of FormDetail object
- Throws:
FormsOnlineException
-
getForm
Load forms from database with given instance Id and form id- Parameters:
pk- the form primary key- Returns:
- a FormDetail object
- Throws:
FormsOnlineException
-
createForm
Save new form in database- Parameters:
formDetail- the form detail- Returns:
- the created FormDetail
- Throws:
FormsOnlineException
-
updateForm
Update form in database- Parameters:
formDetail- the form detail- Throws:
FormsOnlineException
-
deleteForm
Delete Form from database- Parameters:
pk- the pk of form to be deleted- Returns:
- the deleted FormDetail
- Throws:
FormsOnlineException
-
updateSenders
void updateSenders(FormPK pk, Map<String, org.silverpeas.kernel.util.Pair<List<String>, throws FormsOnlineExceptionList<String>>> userAndGroupIdsByRightTypes) Update form senders list.- Parameters:
pk- the form primary keyuserAndGroupIdsByRightTypes- the new sender list as user ids- Throws:
FormsOnlineException
-
updateReceivers
void updateReceivers(FormPK pk, Map<String, org.silverpeas.kernel.util.Pair<List<String>, throws FormsOnlineExceptionList<String>>> userAndGroupIdsByRightTypes) Updates the form rights from given parameters.- Parameters:
pk- the unique identifier of a form.userAndGroupIdsByRightTypes- the user and group rights to update indexed by right types. Users and groups are represented by aPaircontaining on left the user identifiers and on right the group identifiers.- Throws:
FormsOnlineException- on technical error.
-
getSendersAsUsers
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:
FormsOnlineException
-
getSendersAsGroups
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:
FormsOnlineException
-
getReceiversAsUsers
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:
FormsOnlineException
-
getReceiversAsGroups
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:
FormsOnlineException
-
getUserAvailableForms
List<FormDetail> getUserAvailableForms(Collection<String> componentIds, String userId, String[] userGroupIds, String orderBy) throws FormsOnlineException Get the form available to be sent for given user or given groups- Parameters:
componentIds- the component instance iduserId- the user iduserGroupIds- the user's groups id list- Returns:
- a list of FormDetail objects
- Throws:
FormsOnlineException
-
getSentFormInstances
org.silverpeas.core.util.SilverpeasList<FormInstance> getSentFormInstances(FormPK pk, String userId, List<Integer> states, org.silverpeas.core.admin.PaginationPage paginationPage) throws FormsOnlineException Get all form instances that have been sent by given user (excepted the ones that have been archived.- Parameters:
pk- the form primary keyuserId- the user idstates- the states to filter on if anypaginationPage- pagination which can be null if no pagination is requested.- Returns:
- a list of FormInstance objects
- Throws:
FormsOnlineException
-
getReceivedRequests
org.silverpeas.core.util.SilverpeasList<FormInstance> getReceivedRequests(FormDetail form, List<Integer> states, RequestValidationCriteria validatorCriteria, org.silverpeas.core.admin.PaginationPage paginationPage) throws FormsOnlineException Get all requests associated to given form ordered from the newest to the older.- Parameters:
form- the form primary keystates- the states to filter on if anyvalidatorCriteria- the validation criteriapaginationPage- pagination which can be null if no pagination is requested.- 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:
FormsOnlineException
-
getValidatorFormIdsWithValidationTypes
Map<String,Set<FormInstanceValidationType>> getValidatorFormIdsWithValidationTypes(String instanceId, String validatorId, String[] validatorGroupIds, Collection<String> formIds) throws FormsOnlineException Gets theFormInstanceValidationTypeinstances mapped by form identifiers of the the validator represented by given validator id and validator group ids on the given component instance.- Parameters:
instanceId- the identifier of the component instance.validatorId- the identifier of the validator.validatorGroupIds- identifiers of the group of the validator.formIds- optional filter about form identifiers in order to reduce the search load.- Returns:
FormInstanceValidationTypeinstances mapped by form identifiers.- Throws:
FormsOnlineException
-
getPossibleValidationTypesByFormId
Map<String,Set<FormInstanceValidationType>> getPossibleValidationTypesByFormId(Collection<String> formIds) throws FormsOnlineException Gets the possibleFormInstanceValidationTypeinstances mapped by form identifiers.- Parameters:
formIds- form identifiers to search for.- Returns:
FormInstanceValidationTypeinstances mapped by form identifiers.- Throws:
FormsOnlineException
-
getRequest
- Throws:
FormsOnlineException
-
getForms
- Throws:
FormsOnlineException
-
saveRequest
Inserts or updates the given request (also called a form instance).All validation data contained into
FormInstance.getValidations()are also inserted or updated.- Parameters:
request- the request to insert or update.- Returns:
- the
FormInstanceitself. - Throws:
FormsOnlineException- on database integrity error.
-
saveRequestState
Saves the state of the given request without updating anything else.- Parameters:
request- the request which the state MUST be updated.- Throws:
FormsOnlineException- if the form instance id does not exist.
-
deleteRequest
- Throws:
FormsOnlineException
-
getNumberOfRequestsByForm
- Throws:
FormsOnlineException
-
getAllRequests
org.silverpeas.core.util.SilverpeasList<FormInstance> getAllRequests(FormPK pk) throws FormsOnlineException - Throws:
FormsOnlineException
-