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 Mandantprotected final IEntityContextprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final org.slf4j.Loggerprotected final MandantDeprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddErrorMessage(String i18nKey, FCMessage.ParamsLocalizer params) protected voidaddErrorMessage(String i18nKey, Serializable... param) protected voidaddInfoMessage(String i18nKey, FCMessage.ParamsLocalizer params) protected voidaddInfoMessage(String i18nKey, Serializable... param) protected voidaddWarnMessage(String i18nKey, FCMessage.ParamsLocalizer params) protected voidaddWarnMessage(String i18nKey, Serializable... param) protected voidcheckClientResourceExists(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 booleancheckProjectAliasExist(IEntityContext ec, String projectAlias, Mandant client) Checks whether or not the given project name already exist within the given clientstatic final booleancheckProjectNameExist(IEntityContext ec, String projectName, Mandant client) Checks whether or not the given project name already exist within the given clientprotected WorkflowVersioncloneWorkflowVersion(WorkflowVersion oldVersion) Creates a copy of the given workflow version.protected FormVersioncreateActiveFormVersion(FormVersion neueFormversion, Projekt neuesProjekt, String formDir) Erzeugt eine aktive FormVersioncreateAktion(Map<Long, Status> mapStatus, boolean disableAllActions) Deprecated.protected voidcreateAktionen(List<Status> statusListe, List<ExportAktionData> exportAktionListe, List<ExportBedingungData> exportBedingungListe) Deprecated.protected voidDeprecated.protected List<ExportBedingungData>createBedingungenExportData(List<ExportBedingungData> exportBedingungListe, Projekt project) protected voidcreateFile(String filePath, byte[] data) protected voidcreateFormElements(List<FormElement> formElements, FormVersion formVersion) Erzeugt ein FormElementprotected voidcreateFormVersionFile(FormVersion fv, String targetPath) createIDsMap(List<T> options) Generiert aus einer Liste vonIEntity-Objekten eine Map mit ID als Keyprotected javax.xml.bind.JAXBContextcreateJAXBContext(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 FormVersioncreateNewFormVersion(IEntityContext ec, Projekt project, Benutzer user) Deprecated.static final FormVersioncreateNewFormVersion(IEntityContext ec, Projekt project, IUser user) static final FormVersioncreateNewFormVersion(IEntityContext ec, Long projectId, Benutzer user) Deprecated.UsecreateNewFormVersion(IEntityContext, Long, IUser)instead.static final FormVersioncreateNewFormVersion(IEntityContext ec, Long projectId, IUser user) Deprecated.protected ProjektRessourcecreateProjektRessource(Projekt neuesProjekt, File file) protected voidcreateProjektRessourcenFiles(Projekt projekt, String targetPath) protected voidcreateProjektRessources(Projekt neuesProjekt, File resFile) createStatus(List<? extends Status> altStatusListe, Projekt projekt) Deprecated.protected <T> TdeproxyEntity(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.GsonBuilderThe 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 Mandantprotected List<MandantFrontendServer>Methode zum Auslesen der MandantFrontendServerprotected ProjektgetNewProjekt(Projekt newProject, Projekt sourceProjekt, String curBenutzer) Erzeugt ein neues Projektprotected Collection<ProjektRessource>getProjektRessources(FormVersion formVersion) getStatusListe(Projekt projekt) Deprecated.protected AktionhandleAction(long oldActionId, Aktion newAction, Map<Long, Aktion> aktionMap, Map<Long, Status> statusMap, ExportBedingungData exportBedingungData) Deprecated.protected BedingunghandleBedingungForImport(Bedingung neueBedingung, Map<Long, Aktion> aktionMap, Map<Long, Status> statusMap, ExportBedingungData exportBedingungData) Deprecated.protected voidimportProjektRessources(Projekt neuesProjekt, String resDirname, String resFilename) protected voidupdatePreviewImage(Projekt newProject, Projekt sourceProject) protected voidwriteJSONtoFile(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-IEntityContextin which this action should be performedprojectName-Stringproject name to check forclient-Mandantto check for- Returns:
trueif 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-IEntityContextin which this action should be performedprojectAlias-Stringproject alias to check forclient-Mandantto check for- Returns:
trueif 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:
IOExceptioncom.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
GsonBuilderwith 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.