Class WorkflowBackupBean
- java.lang.Object
-
- de.xima.fc.workflow.designer.bean.WorkflowBackupBean
-
- All Implemented Interfaces:
Serializable
@Named @ViewScoped public class WorkflowBackupBean extends Object implements Serializable
Bean for handling workflow version backups. Handles both the backup dialog when an unsaved backup was detected by the flowchart, as well as the backup chooser in the bottom toolbar.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WorkflowBackupBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBackupLabel(WorkflowVersionBackup item)
Creates the label for the available backup items in the backup chooser.String
getCustomBackupDataJson()
String
getCustomDataVersion()
void
loadBackup(FlowchartSnapshot snapshot)
Loads the given snapshot into the workflow designer.void
onBackupCancel()
AJAX callback invoked when the user does not wish to load the detected backup.void
onBackupDetect(BackupDetectEvent event)
AJAX callback when an unsaved backup was detected by the flowchart component.void
onBackupLoad()
AJAX listener invoked when the user decided to load the detected unsaved workflow backup.void
onBackupSelectionChange()
AJAX listener invoked when the selected workflow version backup has changed.
-
-
-
Method Detail
-
getBackupLabel
public String getBackupLabel(WorkflowVersionBackup item)
Creates the label for the available backup items in the backup chooser. The label is different depending on whether is is from today or from longer in the past.- Parameters:
item
- Backup item to process- Returns:
- The label for the given backup.
-
getCustomBackupDataJson
public String getCustomBackupDataJson() throws FastJsonException
- Returns:
- The custom data that should be added to
FlowchartSnapshot.getCustomData()
. This is a serialized instance ofCustomBackupData
. - Throws:
FastJsonException
- When the custom backup JSON string could not be created.
-
getCustomDataVersion
public String getCustomDataVersion()
- Returns:
- Custom data version for
FlowchartBase.getBackupCustomDataVersion()
.
-
loadBackup
public void loadBackup(FlowchartSnapshot snapshot)
Loads the given snapshot into the workflow designer.- Parameters:
snapshot
- Snapshot to load into the workflow designer.
-
onBackupCancel
public void onBackupCancel()
AJAX callback invoked when the user does not wish to load the detected backup.
-
onBackupDetect
public void onBackupDetect(BackupDetectEvent event)
AJAX callback when an unsaved backup was detected by the flowchart component.- Parameters:
event
- Backup that was detected.
-
onBackupLoad
public void onBackupLoad()
AJAX listener invoked when the user decided to load the detected unsaved workflow backup. Loads the backup and updates the workflow designer.
-
onBackupSelectionChange
public void onBackupSelectionChange()
AJAX listener invoked when the selected workflow version backup has changed. Loads the selected backup into the workflow designer.
-
-