Package de.xima.fc.api.entity
Class FormVersionAPI
- java.lang.Object
-
- de.xima.fc.api.ASubAPI
-
- de.xima.fc.api.entity.AEntityAPI<FormVersion>
-
- de.xima.fc.api.entity.FormVersionAPI
-
public class FormVersionAPI extends AEntityAPI<FormVersion>
API class for manipulation ofFormVersionentities.- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from class de.xima.fc.api.entity.AEntityAPI
entityClass
-
-
Constructor Summary
Constructors Constructor Description FormVersionAPI()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FormVersioncreate(UserContext uc, FormVersion formVersion, boolean isFirstFormVersion)Method for creating aFormVersionentity.FormVersiongetBy(UserContext uc, Projekt projekt, int formVersionNumber)Method for determining aFormVersionbased of aProjektand a version number.List<FormVersion>getByProjekt(UserContext uc, Projekt projekt)Method for loading ofFormVersions of aProjekt.FormVersiongetByVersionNumber(UserContext uc, Integer formVersionNumber, Long projectId)Gets a form version by its version number.com.alibaba.fastjson.JSONObjectgetFormAsJSON(UserContext uc, FormVersion fv)This method deliver the JSON for creating a XForm without any styles.StringgetFormAsString(UserContext uc, FormVersion fv)List<FormElement>getFormElemente(UserContext uc, FormVersion formVersion)Method to submit allFormElements of aFormVersion.intgetFormVersionCount(UserContext uc, Projekt projekt)Method for determining the number ofFormVersions of aProjekt.com.alibaba.fastjson.JSONObjectmergeFormElemente(UserContext uc, FormVersion fv)Deprecated.-
Methods inherited from class de.xima.fc.api.entity.AEntityAPI
create, create, delete, delete, deleteAllBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getEntityRefs, getPagedResult, getSingleAttributes, getSingleAttributes, resultTotalCount, resultTotalCount, update, update
-
Methods inherited from class de.xima.fc.api.ASubAPI
getHandlerProvider
-
-
-
-
Method Detail
-
create
public FormVersion create(UserContext uc, FormVersion formVersion, boolean isFirstFormVersion)
Method for creating aFormVersionentity.- Parameters:
uc-UserContextthe user context in which the action is to be performed.formVersion-FormVersionwhich should be created.isFirstFormVersion-Booleanif this is the firstFormVersionor just a derivation of an existing one.- Returns:
FormVersionwhich was created.- Since:
- 2.4.3
-
getBy
public FormVersion getBy(UserContext uc, Projekt projekt, int formVersionNumber)
Method for determining aFormVersionbased of aProjektand a version number.- Parameters:
uc-UserContextthe user context in which the action is to be performed.projekt-Projektin which theFormVersionis searched.formVersionNumber-Integerthe version number.- Returns:
FormVersionwhich was searched.- Since:
- 2.4.3
-
getByProjekt
public List<FormVersion> getByProjekt(UserContext uc, Projekt projekt)
Method for loading ofFormVersions of aProjekt. Methode zum Laden vonFormVersionen einesProjekts. This must be used in the frontend server to pick up the lazy-initialized list ofFormVersions.- Parameters:
uc-UserContextthe user context in which the action is to be performed.projekt-Projektfor which theFormVersions to be picked up.- Returns:
ListwithFormVersions.- Since:
- 2.4.3
-
getByVersionNumber
public FormVersion getByVersionNumber(UserContext uc, Integer formVersionNumber, Long projectId)
Gets a form version by its version number. Defaults to the project's current version if the version number is null or no form version with the given version number exists.- Parameters:
uc- The user context of the user who requests the form version.formVersionNumber- The version number of the form version to get.projectId- ID of the project to get the form version for.- Returns:
- The form version with the given version number or the project's current version if the version number is null or no form version with the given version number exists.
- Since:
- 8.3.0
-
getFormVersionCount
public int getFormVersionCount(UserContext uc, Projekt projekt)
Method for determining the number ofFormVersions of aProjekt.- Parameters:
uc-UserContextthe user context in which the action is to be performed.projekt-Projektwhose number ofFormVersions should be determined.- Returns:
Integerthe number ofFormVersions.- Since:
- 2.4.3
-
getFormElemente
public List<FormElement> getFormElemente(UserContext uc, FormVersion formVersion)
Method to submit allFormElements of aFormVersion. This must be used in the frontend server to pick up the lazy-initialized list ofFormElements.- Parameters:
uc-UserContextthe user context in which the action is to be performed.formVersion- for which the list ofFormElementshould be loaded.- Returns:
Listof typeFormElement.- Since:
- 2.4.3
-
getFormAsJSON
public com.alibaba.fastjson.JSONObject getFormAsJSON(UserContext uc, FormVersion fv) throws IOException, com.alibaba.fastjson.JSONException
This method deliver the JSON for creating a XForm without any styles. This functionality is used for internal processing and ensures that the FD2 project remains independent.- Parameters:
uc-UserContextthe user context in which the action is to be performed.fv- theFormVersionwhich indicates which JSON should be loaded.- Returns:
- The form as JSON.
- Throws:
IOException- Error reading the form file.com.alibaba.fastjson.JSONException- Error converting form file content to a JSON.
-
getFormAsString
public String getFormAsString(UserContext uc, FormVersion fv) throws IOException, com.alibaba.fastjson.JSONException
- Throws:
IOExceptioncom.alibaba.fastjson.JSONException
-
mergeFormElemente
@Deprecated public com.alibaba.fastjson.JSONObject mergeFormElemente(UserContext uc, FormVersion fv) throws com.alibaba.fastjson.JSONException, IOException
Deprecated.- Throws:
com.alibaba.fastjson.JSONExceptionIOException
-
-