Class FormsOnlineDAOJdbc
java.lang.Object
org.silverpeas.components.formsonline.model.FormsOnlineDAOJdbc
- All Implemented Interfaces:
FormsOnlineDAO
-
Constructor Summary
Constructors -
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) protected ConnectionGet a new connection.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 validationCriteria, 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> instanceIds, 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.
-
Constructor Details
-
FormsOnlineDAOJdbc
public FormsOnlineDAOJdbc()
-
-
Method Details
-
createForm
Description copied from interface:FormsOnlineDAOSave new form in database- Specified by:
createFormin interfaceFormsOnlineDAO- Parameters:
formDetail- the form detail- Returns:
- the created FormDetail
- Throws:
FormsOnlineException
-
deleteForm
Description copied from interface:FormsOnlineDAODelete Form from database- Specified by:
deleteFormin interfaceFormsOnlineDAO- Parameters:
pk- the pk of form to be deleted- Returns:
- the deleted FormDetail
- Throws:
FormsOnlineException
-
getForm
Description copied from interface:FormsOnlineDAOLoad forms from database with given instance Id and form id- Specified by:
getFormin interfaceFormsOnlineDAO- Parameters:
pk- the form primary key- Returns:
- a FormDetail object
- Throws:
FormsOnlineException
-
findAllForms
Description copied from interface:FormsOnlineDAOGet all forms that has been created in given instance- Specified by:
findAllFormsin interfaceFormsOnlineDAO- Parameters:
instanceId- the instance idorderBy- sort order method- Returns:
- a List of FormDetail object
- Throws:
FormsOnlineException
-
updateForm
Description copied from interface:FormsOnlineDAOUpdate form in database- Specified by:
updateFormin interfaceFormsOnlineDAO- Parameters:
formDetail- the form detail- Throws:
FormsOnlineException
-
getReceiversAsGroups
Description copied from interface:FormsOnlineDAOGet the form's receivers list where groups has been declared directly.- Specified by:
getReceiversAsGroupsin interfaceFormsOnlineDAO- Parameters:
pk- the form primary key- Returns:
- group ids as a list of String
- Throws:
FormsOnlineException
-
getReceiversAsUsers
Description copied from interface:FormsOnlineDAOGet the form's receivers list where users has been declared directly.- Specified by:
getReceiversAsUsersin interfaceFormsOnlineDAO- Parameters:
pk- the form primary key- Returns:
- user ids as a list of String
- Throws:
FormsOnlineException
-
getSendersAsGroups
Description copied from interface:FormsOnlineDAOGet the form's senders list where groups has been declared directly.- Specified by:
getSendersAsGroupsin interfaceFormsOnlineDAO- Parameters:
pk- the form primary key- Returns:
- group ids as a list of String
- Throws:
FormsOnlineException
-
getSendersAsUsers
Description copied from interface:FormsOnlineDAOGet the form's senders list where users has been declared directly.- Specified by:
getSendersAsUsersin interfaceFormsOnlineDAO- Parameters:
pk- the form primary key- Returns:
- user ids as a list of String
- Throws:
FormsOnlineException
-
updateReceivers
public void updateReceivers(FormPK pk, Map<String, org.silverpeas.kernel.util.Pair<List<String>, throws FormsOnlineExceptionList<String>>> userAndGroupIdsByRightTypes) Description copied from interface:FormsOnlineDAOUpdates the form rights from given parameters.- Specified by:
updateReceiversin interfaceFormsOnlineDAO- 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.
-
updateSenders
public void updateSenders(FormPK pk, Map<String, org.silverpeas.kernel.util.Pair<List<String>, throws FormsOnlineExceptionList<String>>> userAndGroupIdsByRightTypes) Description copied from interface:FormsOnlineDAOUpdate form senders list.- Specified by:
updateSendersin interfaceFormsOnlineDAO- Parameters:
pk- the form primary keyuserAndGroupIdsByRightTypes- the new sender list as user ids- Throws:
FormsOnlineException
-
getUserAvailableForms
public List<FormDetail> getUserAvailableForms(Collection<String> instanceIds, String userId, String[] userGroupIds, String orderBy) throws FormsOnlineException Description copied from interface:FormsOnlineDAOGet the form available to be sent for given user or given groups- Specified by:
getUserAvailableFormsin interfaceFormsOnlineDAO- Parameters:
instanceIds- the component instance iduserId- the user iduserGroupIds- the user's groups id list- Returns:
- a list of FormDetail objects
- Throws:
FormsOnlineException
-
getForms
- Specified by:
getFormsin interfaceFormsOnlineDAO- Throws:
FormsOnlineException
-
getSentFormInstances
public org.silverpeas.core.util.SilverpeasList<FormInstance> getSentFormInstances(FormPK pk, String userId, List<Integer> states, org.silverpeas.core.admin.PaginationPage paginationPage) throws FormsOnlineException Description copied from interface:FormsOnlineDAOGet all form instances that have been sent by given user (excepted the ones that have been archived.- Specified by:
getSentFormInstancesin interfaceFormsOnlineDAO- 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
public org.silverpeas.core.util.SilverpeasList<FormInstance> getReceivedRequests(FormDetail form, List<Integer> states, RequestValidationCriteria validationCriteria, org.silverpeas.core.admin.PaginationPage paginationPage) throws FormsOnlineException Description copied from interface:FormsOnlineDAOGet all requests associated to given form ordered from the newest to the older.- Specified by:
getReceivedRequestsin interfaceFormsOnlineDAO- Parameters:
form- the form primary keystates- the states to filter on if anyvalidationCriteria- 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
public Map<String,Set<FormInstanceValidationType>> getValidatorFormIdsWithValidationTypes(String instanceId, String validatorId, String[] validatorGroupIds, Collection<String> formIds) throws FormsOnlineException Description copied from interface:FormsOnlineDAOGets theFormInstanceValidationTypeinstances mapped by form identifiers of the the validator represented by given validator id and validator group ids on the given component instance.- Specified by:
getValidatorFormIdsWithValidationTypesin interfaceFormsOnlineDAO- 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
public Map<String,Set<FormInstanceValidationType>> getPossibleValidationTypesByFormId(Collection<String> formIds) throws FormsOnlineException Description copied from interface:FormsOnlineDAOGets the possibleFormInstanceValidationTypeinstances mapped by form identifiers.- Specified by:
getPossibleValidationTypesByFormIdin interfaceFormsOnlineDAO- Parameters:
formIds- form identifiers to search for.- Returns:
FormInstanceValidationTypeinstances mapped by form identifiers.- Throws:
FormsOnlineException
-
saveRequest
Description copied from interface:FormsOnlineDAOInserts or updates the given request (also called a form instance).All validation data contained into
FormInstance.getValidations()are also inserted or updated.- Specified by:
saveRequestin interfaceFormsOnlineDAO- Parameters:
request- the request to insert or update.- Returns:
- the
FormInstanceitself. - Throws:
FormsOnlineException- on database integrity error.
-
saveRequestState
Description copied from interface:FormsOnlineDAOSaves the state of the given request without updating anything else.- Specified by:
saveRequestStatein interfaceFormsOnlineDAO- Parameters:
request- the request which the state MUST be updated.- Throws:
FormsOnlineException- if the form instance id does not exist.
-
getRequest
- Specified by:
getRequestin interfaceFormsOnlineDAO- Throws:
FormsOnlineException
-
deleteRequest
- Specified by:
deleteRequestin interfaceFormsOnlineDAO- Throws:
FormsOnlineException
-
getNumberOfRequestsByForm
public Map<Integer,Integer> getNumberOfRequestsByForm(String instanceId) throws FormsOnlineException - Specified by:
getNumberOfRequestsByFormin interfaceFormsOnlineDAO- Throws:
FormsOnlineException
-
getAllRequests
public org.silverpeas.core.util.SilverpeasList<FormInstance> getAllRequests(FormPK pk) throws FormsOnlineException - Specified by:
getAllRequestsin interfaceFormsOnlineDAO- Throws:
FormsOnlineException
-
getConnection
Get a new connection.- Returns:
- the initialized connection.
- Throws:
SQLException
-