Interface YFormService
- All Known Implementing Classes:
DefaultYFormService
public interface YFormService
Implements methods for managing yForms.
-
Method Summary
Modifier and TypeMethodDescriptioncreateOrUpdateYFormData(String applicationId, String formId, String formDataId, YFormDataTypeEnum type, String refId, String content) Create or Update YFormDataModel.createYFormData(String applicationId, String formId, String formDataId, YFormDataTypeEnum type, String refId, String content) Creates YFormData if it doesn't exist and assigns it to the corresponding YFormDefinition.createYFormData(String applicationId, String formId, String formDataId, YFormDataTypeEnum type, String refId, String content, String ownerApplicationId, String ownerFormId) Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.createYFormData(String applicationId, String formId, String formDataId, YFormDataTypeEnum type, String refId, String content, String ownerApplicationId, String ownerFormId, boolean system) Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.createYFormDefinition(String applicationId, String formId, String title, String description, String content, String documentId) Create a new YFormDefinition with specific parameters.getYFormData(String formDataId, YFormDataTypeEnum type) Return form data model with specific id and type.getYFormData(String applicationId, String formId, String refId, YFormDataTypeEnum type) Return the form data model with the specified parameters.getYFormDataByRefId(String refId) Return a list of the form data models with specified reference id.getYFormDefinition(String applicationId, String formId) For a given applicationId and formId a form definition is returned.getYFormDefinition(String applicationId, String formId, int version) Only for testing purposes, shouldn't be used to get the latest YFormDefinitionvoidsetFormDefinitionStatus(String applicationId, String formId, YFormDefinitionStatusEnum status) Set the status for all the form definitions with specific application id and form id.updateYFormData(String formDataId, YFormDataTypeEnum type, String content) Update YFormData content of form data with specific id and type.updateYFormDefinition(String applicationId, String formId, String content, String documentId) Update YFormDefinition if it exists in the database.
-
Method Details
-
getYFormDefinition
YFormDefinitionModel getYFormDefinition(String applicationId, String formId) throws YFormServiceException For a given applicationId and formId a form definition is returned.- Parameters:
applicationId- the application id of the form definitionformId- the form id of the form definition- Returns:
- form definition with the specific parameters
- Throws:
YFormServiceException- if definition is not found
-
getYFormDefinition
YFormDefinitionModel getYFormDefinition(String applicationId, String formId, int version) throws YFormServiceException Only for testing purposes, shouldn't be used to get the latest YFormDefinition- Parameters:
applicationId- the application id of the form definitionformId- the form id of the form definitionversion- the version of the form definition- Returns:
- form definition with the specific parameters
- Throws:
YFormServiceException- if definition is not found
-
updateYFormDefinition
YFormDefinitionModel updateYFormDefinition(String applicationId, String formId, String content, String documentId) throws YFormServiceException Update YFormDefinition if it exists in the database.- Parameters:
applicationId- the application id of the form definitionformId- the form id of the form definitioncontent- the content of the form definitiondocumentId- the document id of the form definition- Returns:
- the updated form definition model
- Throws:
YFormServiceException- if form definition cannot be saved
-
createYFormDefinition
YFormDefinitionModel createYFormDefinition(String applicationId, String formId, String title, String description, String content, String documentId) throws YFormServiceException Create a new YFormDefinition with specific parameters.- Parameters:
applicationId- the application id of the form definition, should exist in a catalogformId- the form id of the form definitiontitle- the tile of the form definitiondescription- the description of the form definitioncontent- the content of the form definitiondocumentId- the document id of the form definition- Returns:
- created form definition model
- Throws:
YFormServiceException- if form definition cannot be created
-
getYFormData
Return form data model with specific id and type.- Parameters:
formDataId- the id of the form datatype- the type of the form data- Returns:
- form data model with specific parameters
- Throws:
YFormServiceException- if form data is not found
-
createOrUpdateYFormData
YFormDataModel createOrUpdateYFormData(String applicationId, String formId, String formDataId, YFormDataTypeEnum type, String refId, String content) throws YFormServiceException Create or Update YFormDataModel.- Parameters:
applicationId- the application id of the form dataformId- the form id of the form dataformDataId- the form data id of the form datatype- the type of the form datarefId- the reference id of the form datacontent- the content of the form data- Returns:
- created or updated form data model
- Throws:
YFormServiceException- if form data cannot be created or updated
-
updateYFormData
YFormDataModel updateYFormData(String formDataId, YFormDataTypeEnum type, String content) throws YFormServiceException Update YFormData content of form data with specific id and type.- Parameters:
formDataId- the id of the form datatype- the type of the form datacontent- new content of the form data- Returns:
- updated form data model
- Throws:
YFormServiceException- if form data cannot be updated
-
createYFormData
YFormDataModel createYFormData(String applicationId, String formId, String formDataId, YFormDataTypeEnum type, String refId, String content) throws YFormServiceException Creates YFormData if it doesn't exist and assigns it to the corresponding YFormDefinition.- Parameters:
applicationId- the application id of the form dataformId- the form id of the form dataformDataId- the form data id of the form datatype- the type of the form datarefId- the reference id of the form datacontent- the content of the form data- Returns:
- created form data model with given parameters
- Throws:
YFormServiceException- if form data cannot be created
-
createYFormData
YFormDataModel createYFormData(String applicationId, String formId, String formDataId, YFormDataTypeEnum type, String refId, String content, String ownerApplicationId, String ownerFormId) throws YFormServiceException Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.- Parameters:
applicationId- the application id of the form dataformId- the form id of the form dataformDataId- the form data id of the form datatype- the type of the form datarefId- the reference id of the form datacontent- the content of the form dataownerApplicationId- the id of the owner applicationownerFormId- the id of the owner form- Returns:
- created form data model with given parameters
- Throws:
YFormServiceException- if form data cannot be created
-
createYFormData
YFormDataModel createYFormData(String applicationId, String formId, String formDataId, YFormDataTypeEnum type, String refId, String content, String ownerApplicationId, String ownerFormId, boolean system) throws YFormServiceException Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.- Parameters:
applicationId- the application id of the form dataformId- the form id of the form dataformDataId- the form data id of the form datatype- the type of the form datarefId- the reference id of the form datacontent- the content of the form dataownerApplicationId- the id of the owner applicationownerFormId- the id of the owner formsystem- the system flag of the form data- Returns:
- created form data model with given parameters
- Throws:
YFormServiceException- if form data cannot be created
-
getYFormData
YFormDataModel getYFormData(String applicationId, String formId, String refId, YFormDataTypeEnum type) throws YFormServiceException Return the form data model with the specified parameters.- Parameters:
applicationId- the application id of the form dataformId- the form id of the form datarefId- the reference id of the form datatype- the type of the form data- Returns:
- the form data model with the specified parameters
- Throws:
YFormServiceException- if form data is not found
-
getYFormDataByRefId
Return a list of the form data models with specified reference id.- Parameters:
refId- the reference id of the form data models- Returns:
- the list of the form data models with specified reference id
-
setFormDefinitionStatus
Set the status for all the form definitions with specific application id and form id.- Parameters:
formId- the form id of the form definitionapplicationId- the application id of the form definitionstatus- the new status of the form definition
-