Class AdminConfigEditorBean
- All Implemented Interfaces:
Serializable
AdminConfigEditorBean class.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeNightMode.static voidclearLocksForSessionId(String sessionId) Removes file locks for the given session id.closeCurrentFileAction.voidcreateBackup(FileRecord rec) static voidcreateBackup(String backupFolderPath, String fileName, String content) Creates a timestamped backup of the given file name and content.voiddownloadFile(BackupRecord rec) downloadFile.editFile(boolean writable) editFile.Getter for the fieldbackupRecords.jakarta.faces.model.DataModel<BackupRecord> Getter for the fieldbackupRecordsModel.getCurrentConfigFileType.getCurrentFileName.getCurrentFilePath.Getter for the fieldcurrentFileRecord.Getter for the fieldfileContent.intGetter for the fieldfileInEditionNumber.jakarta.faces.model.DataModel<FileRecord> getFileRecordsModel.voidinit()init.booleanisBackupsAvailable.booleanisConfigViewer.booleanisEditable.booleanisFileLocked(FileRecord fileRecord) Determines whether the given fileRecord is locked by a different user session.booleanisNightMode.booleanisRenderBackend.voidopenFile()openFile.voidrefresh()refresh.voidrefreshBackups(File backupFolder) refreshBackups.Saves the currently open file.voidselectBackup(int backupNumber) voidselectFileAndShowBackups(boolean writable) selectFileAndShowBackups.voidsetCurrentFileName(String fileName) Getter for the URL pattern.voidsetEditable(boolean editable) Setter for the fieldeditable.voidsetFileContent(String fileContent) Setter for the fieldfileContent.voidsetFileInEditionNumber(int fileInEditionNumber) Setter for the fieldfileInEditionNumber.voidshowBackups.static voidunlockFile(Path file, String sessionId) Unlock the given file for the given session id in the static (global) fileLocks objectvoid
-
Constructor Details
-
AdminConfigEditorBean
public AdminConfigEditorBean()Constructor for AdminConfigEditorBean.
-
-
Method Details
-
init
@PostConstruct public void init()init.
-
isRenderBackend
public boolean isRenderBackend()isRenderBackend.
- Returns:
- a boolean
-
refresh
public void refresh()refresh.
-
selectBackup
- Throws:
IOException
-
upload
-
download
- Throws:
IOException
-
getFileRecordsModel
getFileRecordsModel.
- Returns:
- a
DataModelobject
-
getFileInEditionNumber
public int getFileInEditionNumber()Getter for the field
fileInEditionNumber.- Returns:
- a int
-
setFileInEditionNumber
public void setFileInEditionNumber(int fileInEditionNumber) Setter for the field
fileInEditionNumber.- Parameters:
fileInEditionNumber- a int
-
getCurrentFileRecord
Getter for the field
currentFileRecord.- Returns:
- the currentFileRecord
-
getFileContent
Getter for the field
fileContent.- Returns:
- a
Stringobject
-
setFileContent
Setter for the field
fileContent.- Parameters:
fileContent- aStringobject
-
getBackupRecords
Getter for the field
backupRecords.- Returns:
- a
Listobject
-
getBackupRecordsModel
Getter for the field
backupRecordsModel.- Returns:
- a
DataModelobject
-
isEditable
public boolean isEditable()isEditable.
- Returns:
- a boolean
-
setEditable
public void setEditable(boolean editable) Setter for the field
editable.- Parameters:
editable- a boolean
-
isBackupsAvailable
public boolean isBackupsAvailable()isBackupsAvailable.
- Returns:
- a boolean
-
getCurrentConfigFileType
getCurrentConfigFileType.
- Returns:
- a
Stringobject
-
isFileLocked
Determines whether the given fileRecord is locked by a different user session.- Parameters:
fileRecord- aFileRecordobject- Returns:
- true if file path locked by other session id; false otherwise
-
isNightMode
public boolean isNightMode()isNightMode.
- Returns:
- a boolean
-
changeNightMode
public void changeNightMode()changeNightMode.
-
openFile
openFile.
- Throws:
IOException
-
closeCurrentFileAction
closeCurrentFileAction.
- Returns:
- Navigation outcome
-
unlockFile
Unlock the given file for the given session id in the static (global) fileLocks object -
editFile
editFile.
- Parameters:
writable- a boolean- Returns:
- a
Stringobject
-
saveCurrentFileAction
Saves the currently open file.- Returns:
- Navigation outcome
-
createBackup
- Throws:
IOException
-
createBackup
public static void createBackup(String backupFolderPath, String fileName, String content) throws IOException Creates a timestamped backup of the given file name and content.- Parameters:
backupFolderPath- Backup folder pathfileName- File namecontent- File content- Throws:
IOException
-
refreshBackups
refreshBackups.
- Parameters:
backupFolder- aFileobject
-
isConfigViewer
public boolean isConfigViewer()isConfigViewer.
- Returns:
- true if currently editing config_viewer.xml; false otherwise
-
selectFileAndShowBackups
public void selectFileAndShowBackups(boolean writable) selectFileAndShowBackups.
- Parameters:
writable- a boolean
-
showBackups
public void showBackups()showBackups.
-
downloadFile
downloadFile.
- Parameters:
rec-BackupRecordfor which to download the file- Returns:
- Navigation outcome
- Throws:
IOException
-
clearLocksForSessionId
Removes file locks for the given session id.- Parameters:
sessionId- aStringobject
-
getCurrentFileName
getCurrentFileName.
- Returns:
- File name of the currently selected file record row
-
setCurrentFileName
Getter for the URL pattern.- Parameters:
fileName- aStringobject- Throws:
FileNotFoundException
-
getRecord
-
getCurrentFilePath
getCurrentFilePath.
- Returns:
- a
Pathobject
-
getFileUploader
-