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 ofFormVersion
entities.- 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 FormVersion
create(UserContext uc, FormVersion formVersion, boolean isFirstFormVersion)
Method for creating aFormVersion
entity.FormVersion
getBy(UserContext uc, Projekt projekt, int formVersionNumber)
Method for determining aFormVersion
based of aProjekt
and a version number.List<FormVersion>
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.String
getFormAsString(UserContext uc, FormVersion fv)
List<FormElement>
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, 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 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
public FormVersion getBy(UserContext uc, Projekt projekt, int formVersionNumber)
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
public List<FormVersion> getByProjekt(UserContext uc, Projekt projekt)
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
public int getFormVersionCount(UserContext uc, Projekt projekt)
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
public List<FormElement> getFormElemente(UserContext uc, FormVersion formVersion)
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
-
-