Class DefaultFormsOnlineService
java.lang.Object
org.silverpeas.components.formsonline.model.DefaultFormsOnlineService
- All Implemented Interfaces:
FormsOnlineService,org.silverpeas.core.ApplicationService,org.silverpeas.core.initialization.Initialization
@Service
@Singleton
@Named("formsOnlineService")
public class DefaultFormsOnlineService
extends Object
implements FormsOnlineService, org.silverpeas.core.initialization.Initialization
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPermits to manage a cache in order to increase performances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidArchives the request represented by the given identifier.protected org.silverpeas.core.mail.MailSendingbuildMail(org.silverpeas.core.admin.user.model.User sender, String receiver, String subject, FormInstance request, jakarta.mail.Multipart multipart, boolean replyRequired) voidCancels the request represented by the given identifier.booleandeleteForm(FormPK pk) voidDeletes the request represented by the given identifier.getAllForms(String appId, String userId, boolean withSendInfo) getAllUserRequests(String appId, String userId, org.silverpeas.core.admin.PaginationPage paginationPage) getAvailableFormsToSend(Collection<String> appIds, String userId, String orderBy) org.silverpeas.kernel.bundle.LocalizationBundlegetComponentMessages(String language) org.silverpeas.kernel.bundle.SettingBundlegetContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId) protected org.silverpeas.core.contribution.template.publication.PublicationTemplategetPublicationTemplate(FormInstance request) getValidatorFormIdsWithValidationTypes(String appId, String validatorId, Collection<String> formIds) Gets theFormInstanceValidationTypeinstances mapped by form identifiers of the validator represented by given validator id and validator group ids on the given component instance.getValidatorRequests(RequestsFilter filter, String validatorId, org.silverpeas.core.admin.PaginationPage paginationPage) voidvoidinit()booleanisRelatedTo(String instanceId) Is this service related to the specified component instance.loadRequest(RequestPK pk, String userId) loadRequest(RequestPK pk, String userId, boolean editionMode) protected org.silverpeas.kernel.util.Pair<String, List<org.silverpeas.core.contribution.attachment.model.SimpleDocument>> prepareMailContents(FormInstance request, FormDetail form) voidpublishForm(FormPK pk) saveForm(FormDetail form, Map<String, org.silverpeas.kernel.util.Pair<List<String>, List<String>>> userAndGroupIdsByRightTypes) voidsaveNextRequestValidationStep(RequestPK pk, String validatorId, String decision, String comment, boolean follower) Register a step of validation of the request represented by the given identifier.voidsaveRequest(FormPK pk, String userId, List<org.silverpeas.core.util.file.FileItem> items, boolean draft) voidunpublishForm(FormPK pk) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.silverpeas.core.initialization.Initialization
getPriority, release
-
Constructor Details
-
DefaultFormsOnlineService
public DefaultFormsOnlineService()
-
-
Method Details
-
init
public void init()- Specified by:
initin interfaceorg.silverpeas.core.initialization.Initialization
-
getAllForms
public List<FormDetail> getAllForms(String appId, String userId, boolean withSendInfo) throws FormsOnlineException - Specified by:
getAllFormsin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
loadForm
- Specified by:
loadFormin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
saveForm
public FormDetail saveForm(FormDetail form, Map<String, org.silverpeas.kernel.util.Pair<List<String>, throws FormsOnlineExceptionList<String>>> userAndGroupIdsByRightTypes) - Specified by:
saveFormin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
deleteForm
- Specified by:
deleteFormin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
publishForm
- Specified by:
publishFormin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
unpublishForm
- Specified by:
unpublishFormin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
getAvailableFormsToSend
public List<FormDetail> getAvailableFormsToSend(Collection<String> appIds, String userId, String orderBy) throws FormsOnlineException - Specified by:
getAvailableFormsToSendin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
getAllUserRequests
public RequestsByStatus getAllUserRequests(String appId, String userId, org.silverpeas.core.admin.PaginationPage paginationPage) throws FormsOnlineException - Specified by:
getAllUserRequestsin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
getValidatorRequests
public RequestsByStatus getValidatorRequests(RequestsFilter filter, String validatorId, org.silverpeas.core.admin.PaginationPage paginationPage) throws FormsOnlineException - Specified by:
getValidatorRequestsin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
getValidatorFormIdsWithValidationTypes
public Map<String,Set<FormInstanceValidationType>> getValidatorFormIdsWithValidationTypes(String appId, String validatorId, Collection<String> formIds) throws FormsOnlineException Description copied from interface:FormsOnlineServiceGets theFormInstanceValidationTypeinstances mapped by form identifiers of the validator represented by given validator id and validator group ids on the given component instance.- Specified by:
getValidatorFormIdsWithValidationTypesin interfaceFormsOnlineService- 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:
FormInstanceValidationTypeinstances mapped by form identifiers.- Throws:
FormsOnlineException- if an error occurs
-
loadRequest
- Specified by:
loadRequestin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
loadRequest
public FormInstance loadRequest(RequestPK pk, String userId, boolean editionMode) throws FormsOnlineException - Specified by:
loadRequestin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
saveRequest
public void saveRequest(FormPK pk, String userId, List<org.silverpeas.core.util.file.FileItem> items, boolean draft) throws FormsOnlineException - Specified by:
saveRequestin interfaceFormsOnlineService- Throws:
FormsOnlineException
-
saveNextRequestValidationStep
public void saveNextRequestValidationStep(RequestPK pk, String validatorId, String decision, String comment, boolean follower) throws FormsOnlineException Description copied from interface:FormsOnlineServiceRegister 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.
- Specified by:
saveNextRequestValidationStepin interfaceFormsOnlineService- 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
Description copied from interface:FormsOnlineServiceCancels 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.
- Specified by:
cancelRequestin interfaceFormsOnlineService- Parameters:
pk- the unique identifier of the aimed request.- Throws:
FormsOnlineException- if the current user can not cancel the request or on technical error.
-
deleteRequest
Description copied from interface:FormsOnlineServiceDeletes 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.
- Specified by:
deleteRequestin interfaceFormsOnlineService- Parameters:
pk- the unique identifier of the aimed request.- Throws:
FormsOnlineException- if the current user can not delete the request or on technical error.
-
archiveRequest
Description copied from interface:FormsOnlineServiceArchives 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.
- Specified by:
archiveRequestin interfaceFormsOnlineService- Parameters:
pk- the unique identifier of the aimed request.- Throws:
FormsOnlineException- if the current user can not archive the request or on technical error.
-
getPublicationTemplate
protected org.silverpeas.core.contribution.template.publication.PublicationTemplate getPublicationTemplate(FormInstance request) throws FormsOnlineException, org.silverpeas.core.contribution.template.publication.PublicationTemplateException - Throws:
FormsOnlineExceptionorg.silverpeas.core.contribution.template.publication.PublicationTemplateException
-
buildMail
protected org.silverpeas.core.mail.MailSending buildMail(@Nullable org.silverpeas.core.admin.user.model.User sender, String receiver, String subject, FormInstance request, jakarta.mail.Multipart multipart, boolean replyRequired) -
prepareMailContents
protected org.silverpeas.kernel.util.Pair<String,List<org.silverpeas.core.contribution.attachment.model.SimpleDocument>> prepareMailContents(FormInstance request, FormDetail form) throws FormsOnlineException - Throws:
FormsOnlineException
-
getContributionById
public Optional<FormInstance> getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId) - Specified by:
getContributionByIdin interfaceorg.silverpeas.core.ApplicationService- Specified by:
getContributionByIdin interfaceFormsOnlineService
-
getComponentSettings
public org.silverpeas.kernel.bundle.SettingBundle getComponentSettings()- Specified by:
getComponentSettingsin interfaceorg.silverpeas.core.ApplicationService
-
getComponentMessages
- Specified by:
getComponentMessagesin interfaceorg.silverpeas.core.ApplicationService
-
isRelatedTo
Is this service related to the specified component instance. The service is related to the specified instance if it is a service defined by the application from which the instance was spawned.- Specified by:
isRelatedToin interfaceorg.silverpeas.core.ApplicationService- Parameters:
instanceId- the unique instance identifier of the component.- Returns:
- true if the instance is spawn from the application to which the service is related. False otherwise.
-
index
- Specified by:
indexin interfaceFormsOnlineService
-