Package de.xima.fc.api.entity
Class FormVersionAPI
API class for manipulation of
FormVersion
entities.- Author:
- XIMA MEDIA GmbH
-
Field Summary
Fields inherited from class de.xima.fc.api.entity.AEntityAPI
entityClass
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate
(UserContext uc, FormVersion formVersion, boolean isFirstFormVersion) Method for creating aFormVersion
entity.getBy
(UserContext uc, Projekt projekt, int formVersionNumber) Method for determining aFormVersion
based of aProjekt
and a version number.getByProjekt
(UserContext uc, Projekt projekt) Method for loading ofFormVersion
s of aProjekt
.com.alibaba.fastjson.JSONObject
getFormAsJSON
(UserContext uc, FormVersion fv) This method deliver the JSON for creating a XForm without any styles.getFormAsString
(UserContext uc, FormVersion fv) getFormElemente
(UserContext uc, FormVersion formVersion) Method to submit allFormElement
s of aFormVersion
.int
getFormVersionCount
(UserContext uc, Projekt projekt) Method for determining the number ofFormVersion
s of aProjekt
.com.alibaba.fastjson.JSONObject
mergeFormElemente
(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, getSingleAttributes, getSingleAttributes, resultTotalCount, resultTotalCount, update, update
Methods inherited from class de.xima.fc.api.ASubAPI
getHandlerProvider
-
Constructor Details
-
FormVersionAPI
public FormVersionAPI()
-
-
Method Details
-
create
Method for creating aFormVersion
entity.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.formVersion
-FormVersion
which should be created.isFirstFormVersion
-Boolean
if this is the firstFormVersion
or just a derivation of an existing one.- Returns:
FormVersion
which was created.- Since:
- 2.4.3
-
getBy
Method for determining aFormVersion
based of aProjekt
and a version number.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.projekt
-Projekt
in which theFormVersion
is searched.formVersionNumber
-Integer
the version number.- Returns:
FormVersion
which was searched.- Since:
- 2.4.3
-
getByProjekt
Method for loading ofFormVersion
s of aProjekt
. Methode zum Laden vonFormVersion
en einesProjekt
s. This must be used in the frontend server to pick up the lazy-initialized list ofFormVersion
s.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.projekt
-Projekt
for which theFormVersion
s to be picked up.- Returns:
List
withFormVersion
s.- Since:
- 2.4.3
-
getFormVersionCount
Method for determining the number ofFormVersion
s of aProjekt
.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.projekt
-Projekt
whose number ofFormVersion
s should be determined.- Returns:
Integer
the number ofFormVersion
s.- Since:
- 2.4.3
-
getFormElemente
Method to submit allFormElement
s of aFormVersion
. This must be used in the frontend server to pick up the lazy-initialized list ofFormElement
s.- Parameters:
uc
-UserContext
the user context in which the action is to be performed.formVersion
- for which the list ofFormElement
should be loaded.- Returns:
List
of 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
-UserContext
the user context in which the action is to be performed.fv
- theFormVersion
which 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:
IOException
com.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.JSONException
IOException
-