Package de.xima.fc.gui.model.designer
Class DesignerConversationModel
java.lang.Object
de.xima.fc.gui.model.designer.DesignerConversationModel
- All Implemented Interfaces:
Serializable
,AutoCloseable
POJO model for the current global state of a designer instance. Scoped to the designer conversation, this allows all
frames and views to access the current state.
- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addTempFile
(String id, Path file) Adds a temp file or directory to the conversation scope.void
close()
static DesignerConversationModel
empty()
getTempFile
(String id) Gets a file form the temp file map.boolean
removeTempFile
(String id) Gets and removes the file with the ID from the temp file map.void
setCurrentFormDesignerLanguage
(String currentFormDesignerLanguage) void
setCurrentFormPersist
(FormPersist currentFormPersist) void
setCurrentStateList
(StateList currentStateList) void
setDesignerSessionActive
(boolean designerSessionActive) void
setEnvironmentData
(DesignerConversationEnvironmentData environmentData) void
setInitialFlowchartSnapshot
(FlowchartSnapshot initialFlowchartSnapshot) void
setInitialWebFormPersistJson
(String fileName, String initialWebFormPersistJson) void
setInitialWebFormPersistLivecycle
(String fileName, String initialWebFormLivecycleXml) void
setInitialWebFormPersistPdf
(String fileName, String importId)
-
Method Details
-
addTempFile
Adds a temp file or directory to the conversation scope. These will be deleted when the conversation is done.- Parameters:
id
- ID of the temporary file.file
- File or directory to add.- Throws:
IllegalStateException
- When a file with the ID exists already.- Since:
- 7.2.0
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
getAndClearInitialFlowchartSnapshot
- Returns:
- The snapshot that should be loaded initially when the workflow designer is opened. When
null
, the persisted workflow is loaded.
-
getAndClearInitialWebFormPersist
- Returns:
- The persist file that should be loaded initially when the form designer is opened. When
null
, the persisted form version is loaded.
-
getCurrentFormDesignerLanguage
- Returns:
- The current language selected in the form designer, empty string the form designer is not open currently.
-
getCurrentFormPersist
- Returns:
- The current form persist representing the current (transient or persistent) state of the form edited in the form designer. Empty model when the form designer is not open currently.
-
getCurrentStateList
- Returns:
- The current list of states that are being edited in the workflow designer, but may not yet be saved.
-
getEnvironmentData
- Returns:
- Details about the currently opened form.
-
getTempFile
Gets a file form the temp file map. PreferremoveTempFile(String)
if you do not need to access the file from the model any longer.- Parameters:
id
- ID of the temporary file.- Returns:
- The file with the given key, or
null
when no such file exists. - Since:
- 7.2.0
-
isDesignerSessionActive
public boolean isDesignerSessionActive()- Returns:
true
when this session conversation model belongs to an active designer session.false
when this is e.g. an empty model with default values.- Since:
- 8.0.0
-
removeTempFile
Gets and removes the file with the ID from the temp file map.- Parameters:
id
- ID of the temporary file.- Returns:
- The file with the given key, or
null
when no such file exists. - Since:
- 8.0.0
-
setCurrentFormDesignerLanguage
- Parameters:
currentFormDesignerLanguage
- The current language selected in the form designer, empty string the form designer is not open currently.
-
setCurrentFormPersist
- Parameters:
currentFormPersist
- The current form persist representing the current (transient or persistent) state of the form edited in the form designer. Empty model when the form designer is not open currently.
-
setCurrentStateList
- Parameters:
currentStateList
- The current list of states that are being edited in the workflow designer, but may not yet be saved.
-
setDesignerSessionActive
public void setDesignerSessionActive(boolean designerSessionActive) - Parameters:
designerSessionActive
-true
when this session conversation model belongs to an active designer session.false
when this is e.g. an empty model with default values.- Since:
- 8.0.0
-
setEnvironmentData
- Parameters:
environmentData
- Details about the currently opened form.
-
setInitialFlowchartSnapshot
- Parameters:
initialFlowchartSnapshot
- The snapshot that should be loaded initially when the workflow designer is opened. Whennull
, the persisted workflow version is loaded.
-
setInitialWebFormPersistJson
- Parameters:
fileName
- File name of the persist JSON file.initialWebFormPersistJson
- The persist JSON that should be loaded initially when the form designer is opened. Whennull
, the persisted form version is loaded.
-
setInitialWebFormPersistLivecycle
- Parameters:
fileName
- File name of the livecycle persist file.initialWebFormLivecycleXml
- The persist livecycle XML that should be loaded initially when the form designer is opened. Whennull
, the persisted form version is loaded.
-
setInitialWebFormPersistPdf
- Parameters:
fileName
- File name of the livecycle persist file.importId
- The ID of the upload PDF file that should be loaded initially when the form designer is opened. Whennull
, the persisted form version is loaded.
-
empty
- Returns:
- A new empty conversation model with the defaults.
-