Interface FormsOnlineService
-
- All Superinterfaces:
org.silverpeas.core.ApplicationService
- All Known Implementing Classes:
DefaultFormsOnlineService
public interface FormsOnlineService extends org.silverpeas.core.ApplicationService
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
archiveRequest(RequestPK pk)
Archives the request represented by the given identifier.void
cancelRequest(RequestPK pk)
Cancels the request represented by the given identifier.boolean
deleteForm(FormPK pk)
void
deleteRequest(RequestPK pk)
Deletes the request represented by the given identifier.static FormsOnlineService
get()
List<FormDetail>
getAllForms(String appId, String userId, boolean withSendInfo)
RequestsByStatus
getAllUserRequests(String appId, String userId, org.silverpeas.core.admin.PaginationPage paginationPage)
List<FormDetail>
getAvailableFormsToSend(Collection<String> appIds, String userId)
Optional<FormInstance>
getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId)
Map<String,Set<FormInstanceValidationType>>
getValidatorFormIdsWithValidationTypes(String appId, String validatorId, Collection<String> formIds)
Gets theFormInstanceValidationType
instances mapped by form identifiers of the validator represented by given validator id and validator group ids on the given component instance.RequestsByStatus
getValidatorRequests(RequestsFilter filter, String validatorId, org.silverpeas.core.admin.PaginationPage paginationPage)
void
index(String componentId)
FormDetail
loadForm(FormPK pk)
FormInstance
loadRequest(RequestPK pk, String userId)
FormInstance
loadRequest(RequestPK pk, String userId, boolean editionMode)
void
publishForm(FormPK pk)
FormDetail
saveForm(FormDetail form, Map<String,org.silverpeas.core.util.Pair<List<String>,List<String>>> userAndGroupIdsByRightTypes)
void
saveNextRequestValidationStep(RequestPK pk, String validatorId, String decision, String comment, boolean follower)
Register a step of validation of the request represented by the given identifier.void
saveRequest(FormPK pk, String userId, List<org.apache.commons.fileupload.FileItem> items, boolean draft)
void
unpublishForm(FormPK pk)
-
-
-
Method Detail
-
get
static FormsOnlineService get()
-
getContributionById
Optional<FormInstance> getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId)
- Specified by:
getContributionById
in interfaceorg.silverpeas.core.ApplicationService
-
getAllForms
List<FormDetail> getAllForms(String appId, String userId, boolean withSendInfo) throws FormsOnlineException
- Throws:
FormsOnlineException
-
loadForm
FormDetail loadForm(FormPK pk) throws FormsOnlineException
- Throws:
FormsOnlineException
-
saveForm
FormDetail saveForm(FormDetail form, Map<String,org.silverpeas.core.util.Pair<List<String>,List<String>>> userAndGroupIdsByRightTypes) throws FormsOnlineException
- Throws:
FormsOnlineException
-
deleteForm
boolean deleteForm(FormPK pk) throws FormsOnlineException
- Throws:
FormsOnlineException
-
publishForm
void publishForm(FormPK pk) throws FormsOnlineException
- Throws:
FormsOnlineException
-
unpublishForm
void unpublishForm(FormPK pk) throws FormsOnlineException
- Throws:
FormsOnlineException
-
getAvailableFormsToSend
List<FormDetail> getAvailableFormsToSend(Collection<String> appIds, String userId) throws FormsOnlineException
- Throws:
FormsOnlineException
-
getAllUserRequests
RequestsByStatus getAllUserRequests(String appId, String userId, org.silverpeas.core.admin.PaginationPage paginationPage) throws FormsOnlineException
- Throws:
FormsOnlineException
-
getValidatorRequests
RequestsByStatus getValidatorRequests(RequestsFilter filter, String validatorId, org.silverpeas.core.admin.PaginationPage paginationPage) throws FormsOnlineException
- Throws:
FormsOnlineException
-
getValidatorFormIdsWithValidationTypes
Map<String,Set<FormInstanceValidationType>> getValidatorFormIdsWithValidationTypes(String appId, String validatorId, Collection<String> formIds) throws FormsOnlineException
Gets theFormInstanceValidationType
instances mapped by form identifiers of the validator represented by given validator id and validator group ids on the given component instance.- Parameters:
appId
- the identifier of the component instance.validatorId
- the identifier of the validator.formIds
- optional filter about form identifiers in order to reduce the search load.- Returns:
FormInstanceValidationType
instances mapped by form identifiers.- Throws:
FormsOnlineException
- if an error occurs
-
loadRequest
FormInstance loadRequest(RequestPK pk, String userId) throws FormsOnlineException, org.silverpeas.core.contribution.template.publication.PublicationTemplateException, org.silverpeas.core.contribution.content.form.FormException
- Throws:
FormsOnlineException
org.silverpeas.core.contribution.template.publication.PublicationTemplateException
org.silverpeas.core.contribution.content.form.FormException
-
loadRequest
FormInstance loadRequest(RequestPK pk, String userId, boolean editionMode) throws FormsOnlineException
- Throws:
FormsOnlineException
-
saveRequest
void saveRequest(FormPK pk, String userId, List<org.apache.commons.fileupload.FileItem> items, boolean draft) throws FormsOnlineException
- Throws:
FormsOnlineException
-
saveNextRequestValidationStep
void saveNextRequestValidationStep(RequestPK pk, String validatorId, String decision, String comment, boolean follower) throws FormsOnlineException
Register a step of validation of the request represented by the given identifier.The service ensure that the validator is able to validate the given request. In case of the validator can not validate, an error is thrown.
- Parameters:
pk
- the unique identifier of the aimed request.validatorId
- the identifier of the validator.decision
- the validation decision ("validate" or "refused")comment
- the validation comment.follower
- a boolean flag. True means that the validator want to follow the next steps of validation.- Throws:
FormsOnlineException
- if the validator can not validate indeed or on technical error.
-
cancelRequest
void cancelRequest(RequestPK pk) throws FormsOnlineException
Cancels the request represented by the given identifier.The service ensures that the current user is the creator of the request. In case of the validator can not validate, an error is thrown.
- Parameters:
pk
- the unique identifier of the aimed request.- Throws:
FormsOnlineException
- if the current user can not cancel the request or on technical error.
-
archiveRequest
void archiveRequest(RequestPK pk) throws FormsOnlineException
Archives the request represented by the given identifier.The service ensures that the current user is able to archive the request. In case of the validator can not validate, an error is thrown.
- Parameters:
pk
- the unique identifier of the aimed request.- Throws:
FormsOnlineException
- if the current user can not archive the request or on technical error.
-
deleteRequest
void deleteRequest(RequestPK pk) throws FormsOnlineException
Deletes the request represented by the given identifier.The service ensures that the current user is able to delete the request. In case of the validator can not validate, an error is thrown.
- Parameters:
pk
- the unique identifier of the aimed request.- Throws:
FormsOnlineException
- if the current user can not delete the request or on technical error.
-
index
void index(String componentId)
-
-