Package de.xima.fc.export
Class AProjektUtil
java.lang.Object
de.xima.fc.export.AProjektUtil
- Direct Known Subclasses:
ProjektCopyUtil
,ProjektExportUtil
,ProjektImportUtil
,ProjektUpdateUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Mandant
protected final IEntityContext
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final org.slf4j.Logger
protected final Mandant
Deprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addErrorMessage
(String i18nKey, FCMessage.ParamsLocalizer params) protected void
addErrorMessage
(String i18nKey, Serializable... param) protected void
addInfoMessage
(String i18nKey, FCMessage.ParamsLocalizer params) protected void
addInfoMessage
(String i18nKey, Serializable... param) protected void
addWarnMessage
(String i18nKey, FCMessage.ParamsLocalizer params) protected void
addWarnMessage
(String i18nKey, Serializable... param) protected void
checkClientResourceExists
(ERessourcenTyp resourceType, String resourceName) Checks whether the given resource exists for the action and issues and error message in case it does not.static final boolean
checkProjectAliasExist
(IEntityContext ec, String projectAlias, Mandant client) Checks whether or not the given project name already exist within the given clientstatic final boolean
checkProjectNameExist
(IEntityContext ec, String projectName, Mandant client) Checks whether or not the given project name already exist within the given clientprotected WorkflowVersion
cloneWorkflowVersion
(WorkflowVersion oldVersion) Creates a copy of the given workflow version.protected FormVersion
createActiveFormVersion
(FormVersion neueFormversion, Projekt neuesProjekt, String formDir) Erzeugt eine aktive FormVersioncreateAktion
(Map<Long, Status> mapStatus, boolean disableAllActions) Deprecated.protected void
createAktionen
(List<Status> statusListe, List<ExportAktionData> exportAktionListe, List<ExportBedingungData> exportBedingungListe) Deprecated.protected void
Deprecated.protected List<ExportBedingungData>
createBedingungenExportData
(List<ExportBedingungData> exportBedingungListe, Projekt project) protected void
createFile
(String filePath, byte[] data) protected void
createFormElements
(List<FormElement> formElements, FormVersion formVersion) Erzeugt ein FormElementprotected void
createFormVersionFile
(FormVersion fv, String targetPath) createIDsMap
(List<T> options) Generiert aus einer Liste vonIEntity
-Objekten eine Map mit ID als Keyprotected javax.xml.bind.JAXBContext
createJAXBContext
(Class<?>[] classesToBeBound, List<String> bindings) protected <T extends INameProviding>
Map<String,T> createNamedMap
(List<T> options) Generiert aus einer Liste vonINameProviding
-Objekten eine Map mit Name als Keystatic final FormVersion
createNewFormVersion
(IEntityContext ec, Projekt project, Benutzer user) Deprecated.static final FormVersion
createNewFormVersion
(IEntityContext ec, Projekt project, IUser user) static final FormVersion
createNewFormVersion
(IEntityContext ec, Long projectId, Benutzer user) Deprecated.UsecreateNewFormVersion(IEntityContext, Long, IUser)
instead.static final FormVersion
createNewFormVersion
(IEntityContext ec, Long projectId, IUser user) Deprecated.protected ProjektRessource
createProjektRessource
(Projekt neuesProjekt, File file) protected void
createProjektRessourcenFiles
(Projekt projekt, String targetPath) protected void
createProjektRessources
(Projekt neuesProjekt, File resFile) createStatus
(List<? extends Status> altStatusListe, Projekt projekt) Deprecated.protected <T> T
deproxyEntity
(T obj) findUniqueAlias
(String alias) Attempt to find a unique alias (for the current client).getAktionsListe
(Status status) Deprecated.protected List<BenutzerGruppe>
Methode zum Auslesen der Benutzergruppenprotected List<BenutzerGruppe>
getBenutzerGruppenListe
(List<BenutzerGruppe> benutzerGruppen) liest Benutzergruppen aus der DBprotected List<FormElement>
getFormElements
(FormVersion formVersion) Methode zum Ermitteln der FormElementsprotected com.google.gson.GsonBuilder
The defaults that are currently set are as follows: A custom type adapter for Date objects as the built-in one is not cross Java version compatible.protected Mandant
protected List<MandantFrontendServer>
Methode zum Auslesen der MandantFrontendServerprotected Projekt
getNewProjekt
(Projekt newProject, Projekt sourceProjekt, String curBenutzer) Erzeugt ein neues Projektprotected Collection<ProjektRessource>
getProjektRessources
(FormVersion formVersion) getStatusListe
(Projekt projekt) Deprecated.protected Aktion
handleAction
(long oldActionId, Aktion newAction, Map<Long, Aktion> aktionMap, Map<Long, Status> statusMap, ExportBedingungData exportBedingungData) Deprecated.protected Bedingung
handleBedingungForImport
(Bedingung neueBedingung, Map<Long, Aktion> aktionMap, Map<Long, Status> statusMap, ExportBedingungData exportBedingungData) Deprecated.protected void
importProjektRessources
(Projekt neuesProjekt, String resDirname, String resFilename) protected void
updatePreviewImage
(Projekt newProject, Projekt sourceProject) protected void
writeJSONtoFile
(File tempDir, String filename, String content)
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
ec
-
client
-
errorMsgList
-
infoMsgList
-
FC_EXPORT_PROJEKT
- See Also:
-
FC_EXPORT_PROJEKTHELP
- See Also:
-
FC_EXPORT_AKTIVE_VERSION
- See Also:
-
FC_EXPORT_DOI
- See Also:
-
FC_EXPORT_DOI_DATA
- See Also:
-
FC_EXPORT_FORM_ELEMENTS
- See Also:
-
FC_EXPORT_STATUS
- See Also:
-
FC_EXPORT_STATUSHELP
- See Also:
-
FC_EXPORT_AKTIONEN
- See Also:
-
FC_EXPORT_BEDINGUNG
- See Also:
-
FC_EXPORT_FORMVERSION
- See Also:
-
FC_EXPORT_FORMVERSION_DATA
- See Also:
-
FC_EXPORT_FORM_RESSOURCES
- See Also:
-
FC_EXPORT_RESOURCE
- See Also:
-
FC_EXPORT_VORGAENGE
- See Also:
-
FC_EXPORT_VORGAENGE_DATA
- See Also:
-
m
Deprecated. -
FC_EXPORT_METADATA
- See Also:
-
-
Constructor Details
-
AProjektUtil
-
-
Method Details
-
addErrorMessage
-
addErrorMessage
-
addWarnMessage
-
addWarnMessage
-
getInfoMsgList
-
createNewFormVersion
-
createNewFormVersion
public static final FormVersion createNewFormVersion(IEntityContext ec, Projekt project, IUser user) -
createFile
- Throws:
IOException
-
addInfoMessage
-
addInfoMessage
-
getMandant
-
writeJSONtoFile
- Throws:
IOException
-
getFormElements
Methode zum Ermitteln der FormElements -
findUniqueAlias
Attempt to find a unique alias (for the current client). If no project with the given alias exists, return that alias. Otherwise, attempt to suffix the given alias with an index.- Parameters:
alias
- Desired base alias to be used.- Returns:
- A (non-empty) alias that is not used yet by any project of the current client. An empty string iff no unique alias could be found.
- Throws:
LimitExceededException
- if the alias generation exceeded the length limit
-
checkProjectNameExist
public static final boolean checkProjectNameExist(IEntityContext ec, String projectName, Mandant client) Checks whether or not the given project name already exist within the given client- Parameters:
ec
-IEntityContext
in which this action should be performedprojectName
-String
project name to check forclient
-Mandant
to check for- Returns:
true
if name already exists
-
checkProjectAliasExist
public static final boolean checkProjectAliasExist(IEntityContext ec, String projectAlias, Mandant client) Checks whether or not the given project name already exist within the given client- Parameters:
ec
-IEntityContext
in which this action should be performedprojectAlias
-String
project alias to check forclient
-Mandant
to check for- Returns:
true
if alias already exists
-
checkClientResourceExists
Checks whether the given resource exists for the action and issues and error message in case it does not.- Parameters:
resourceType
- Type of resource. No check is performed unless this isERessourcenTyp.MANDANT
.resourceName
- Name of the resource to check.
-
getStatusListe
Deprecated.Methode zum Erzeugen der Status-Daten -
getAktionsListe
Deprecated.Methode zum Erzeugen der Aktion-Daten -
getErrorMsgList
-
handleAction
@Deprecated protected Aktion handleAction(long oldActionId, Aktion newAction, Map<Long, Aktion> aktionMap, Map<Long, throws ExceptionStatus> statusMap, ExportBedingungData exportBedingungData) Deprecated.- Throws:
Exception
-
handleBedingungForImport
@Deprecated protected Bedingung handleBedingungForImport(Bedingung neueBedingung, Map<Long, Aktion> aktionMap, Map<Long, throws ExceptionStatus> statusMap, ExportBedingungData exportBedingungData) Deprecated.Should only be used for importing older project exports- Throws:
Exception
-
createBedingung
@Deprecated protected void createBedingung(Map<Long, Aktion> aktionMap, Map<Long, throws ExceptionStatus> statusMap) Deprecated.Erstellt Bedingungen anahnd der AktionsListe- Throws:
Exception
-
createAktion
@Deprecated protected Map<Long,Aktion> createAktion(Map<Long, Status> mapStatus, boolean disableAllActions) Deprecated.Erstellt Aktionen anhand der StatusListe- Parameters:
mapStatus
- Mapping between the ID of a state and the corresponding entity.disableAllActions
- Flag das angibt, ob neue Aktionen deaktiviert werden sollen- Returns:
- Map<Integer, Aktion> New mapping with the created actions.
-
updatePreviewImage
-
getNewProjekt
Erzeugt ein neues Projekt -
cloneWorkflowVersion
Creates a copy of the given workflow version.- Parameters:
oldVersion
- An entity to clone.- Returns:
- The cloned entity.
-
createActiveFormVersion
protected FormVersion createActiveFormVersion(FormVersion neueFormversion, Projekt neuesProjekt, String formDir) throws IOException, com.alibaba.fastjson.JSONException Erzeugt eine aktive FormVersion- Throws:
IOException
com.alibaba.fastjson.JSONException
-
createFormElements
Erzeugt ein FormElement- Parameters:
formElements
- Elements to create.formVersion
- Form version where to create the elements.
-
getBenutzergruppen
Methode zum Auslesen der Benutzergruppen -
getMandantFrontendServer
Methode zum Auslesen der MandantFrontendServer -
createStatus
@Deprecated protected HashMap<Long,Status> createStatus(List<? extends Status> altStatusListe, Projekt projekt) Deprecated.Methode zum Erzeugen eines Status -
getBenutzerGruppenListe
liest Benutzergruppen aus der DB -
createPreStatus
@Deprecated protected List<Status> createPreStatus(HashMap<Long, Status> existierendeStatusListe, List<Status> altStatusListe) Deprecated. -
createBedingungenExportData
protected List<ExportBedingungData> createBedingungenExportData(List<ExportBedingungData> exportBedingungListe, Projekt project) -
createProjektRessourcenFiles
- Throws:
IOException
-
getProjektRessources
-
createFormVersionFile
- Throws:
IOException
-
createAktionen
@Deprecated protected void createAktionen(List<Status> statusListe, List<ExportAktionData> exportAktionListe, List<ExportBedingungData> exportBedingungListe) Deprecated. -
importProjektRessources
protected void importProjektRessources(Projekt neuesProjekt, String resDirname, String resFilename) throws IOException - Throws:
IOException
-
createProjektRessources
- Throws:
IOException
-
createProjektRessource
protected ProjektRessource createProjektRessource(Projekt neuesProjekt, File file) throws IOException - Throws:
IOException
-
deproxyEntity
protected <T> T deproxyEntity(T obj) -
getGsonBuilderWithDefaults
protected com.google.gson.GsonBuilder getGsonBuilderWithDefaults()The defaults that are currently set are as follows:- A custom type adapter for Date objects as the built-in one is not cross Java version compatible.
- Returns:
- A newly created
GsonBuilder
with some defaults already set.
-
createJAXBContext
protected javax.xml.bind.JAXBContext createJAXBContext(Class<?>[] classesToBeBound, List<String> bindings) throws javax.xml.bind.JAXBException - Throws:
javax.xml.bind.JAXBException
-
getVorgangsBindings
-
getFormVersionBindings
-
createNamedMap
Generiert aus einer Liste vonINameProviding
-Objekten eine Map mit Name als Key -
createIDsMap
protected <T extends de.xima.cmn.dao.interfaces.IEntity<Long>> Map<Long,T> createIDsMap(List<T> options) Generiert aus einer Liste vonIEntity
-Objekten eine Map mit ID als Key -
createNewFormVersion
@Deprecated public static final FormVersion createNewFormVersion(IEntityContext ec, Long projectId, Benutzer user) Deprecated.UsecreateNewFormVersion(IEntityContext, Long, IUser)
instead. -
createNewFormVersion
@Deprecated public static final FormVersion createNewFormVersion(IEntityContext ec, Projekt project, Benutzer user) Deprecated.UsecreateNewFormVersion(IEntityContext, Projekt, IUser)
instead.
-
createNewFormVersion(IEntityContext, Projekt, IUser)
instead.