Interface YFormService
-
- All Known Implementing Classes:
DefaultYFormService
public interface YFormServiceImplements methods for managing yForms.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description YFormDataModelcreateOrUpdateYFormData(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content)Create or Update YFormDataModel.YFormDataModelcreateYFormData(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content)Creates YFormData if it doesn't exist and assigns it to the corresponding YFormDefinition.YFormDataModelcreateYFormData(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content, java.lang.String ownerApplicationId, java.lang.String ownerFormId)Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.YFormDataModelcreateYFormData(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content, java.lang.String ownerApplicationId, java.lang.String ownerFormId, boolean system)Creates YFormData if it doesn't exist already and assigns it to the corresponding YFormDefinition.YFormDefinitionModelcreateYFormDefinition(java.lang.String applicationId, java.lang.String formId, java.lang.String title, java.lang.String description, java.lang.String content, java.lang.String documentId)Create a new YFormDefinition with specific parameters.YFormDataModelgetYFormData(java.lang.String formDataId, YFormDataTypeEnum type)Return form data model with specific id and type.YFormDataModelgetYFormData(java.lang.String applicationId, java.lang.String formId, java.lang.String refId, YFormDataTypeEnum type)Return the form data model with the specified parameters.java.util.List<YFormDataModel>getYFormDataByRefId(java.lang.String refId)Return a list of the form data models with specified reference id.YFormDefinitionModelgetYFormDefinition(java.lang.String applicationId, java.lang.String formId)For a given applicationId and formId a form definition is returned.YFormDefinitionModelgetYFormDefinition(java.lang.String applicationId, java.lang.String formId, int version)Only for testing purposes, shouldn't be used to get the latest YFormDefinitionvoidsetFormDefinitionStatus(java.lang.String applicationId, java.lang.String formId, YFormDefinitionStatusEnum status)Set the status for all the form definitions with specific application id and form id.YFormDataModelupdateYFormData(java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String content)Update YFormData content of form data with specific id and type.YFormDefinitionModelupdateYFormDefinition(java.lang.String applicationId, java.lang.String formId, java.lang.String content, java.lang.String documentId)Update YFormDefinition if it exists in the database.
-
-
-
Method Detail
-
getYFormDefinition
YFormDefinitionModel getYFormDefinition(java.lang.String applicationId, java.lang.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(java.lang.String applicationId, java.lang.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(java.lang.String applicationId, java.lang.String formId, java.lang.String content, java.lang.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(java.lang.String applicationId, java.lang.String formId, java.lang.String title, java.lang.String description, java.lang.String content, java.lang.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
YFormDataModel getYFormData(java.lang.String formDataId, YFormDataTypeEnum type) throws YFormServiceException
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(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.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(java.lang.String formDataId, YFormDataTypeEnum type, java.lang.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(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.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(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content, java.lang.String ownerApplicationId, java.lang.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(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, YFormDataTypeEnum type, java.lang.String refId, java.lang.String content, java.lang.String ownerApplicationId, java.lang.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(java.lang.String applicationId, java.lang.String formId, java.lang.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
java.util.List<YFormDataModel> getYFormDataByRefId(java.lang.String refId)
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
void setFormDefinitionStatus(java.lang.String applicationId, java.lang.String formId, YFormDefinitionStatusEnum status)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
-
-