Class AdminConfigEditorBean
- All Implemented Interfaces:
Serializable
AdminConfigEditorBean class.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
changeNightMode.static void
clearLocksForSessionId
(String sessionId) Removes file locks for the given session id.closeCurrentFileAction.void
createBackup
(FileRecord rec) static void
createBackup
(String backupFolderPath, String fileName, String content) Creates a timestamped backup of the given file name and content.void
downloadFile
(BackupRecord rec) downloadFile.editFile
(boolean writable) editFile.Getter for the fieldbackupRecords
.javax.faces.model.DataModel<BackupRecord>
Getter for the fieldbackupRecordsModel
.getCurrentConfigFileType.getCurrentFileName.getCurrentFilePath.Getter for the fieldcurrentFileRecord
.Getter for the fieldfileContent
.int
Getter for the fieldfileInEditionNumber
.javax.faces.model.DataModel<FileRecord>
getFileRecordsModel.void
init()
init.boolean
isBackupsAvailable.boolean
isConfigViewer.boolean
isEditable.boolean
isFileLocked
(FileRecord fileRecord) Determines whether the given fileRecord is locked by a different user session.boolean
isNightMode.boolean
isRenderBackend.void
openFile()
openFile.void
refresh()
refresh.void
refreshBackups
(File backupFolder) refreshBackups.Saves the currently open file.void
selectBackup
(int backupNumber) void
selectFileAndShowBackups
(boolean writable) selectFileAndShowBackups.void
setCurrentFileName
(String fileName) Getter for the URL pattern.void
setEditable
(boolean editable) Setter for the fieldeditable
.void
setFileContent
(String fileContent) Setter for the fieldfileContent
.void
setFileInEditionNumber
(int fileInEditionNumber) Setter for the fieldfileInEditionNumber
.void
showBackups.static void
unlockFile
(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
DataModel
object
-
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
String
object
-
setFileContent
Setter for the field
fileContent
.- Parameters:
fileContent
- aString
object
-
getBackupRecords
Getter for the field
backupRecords
.- Returns:
- a
List
object
-
getBackupRecordsModel
Getter for the field
backupRecordsModel
.- Returns:
- a
DataModel
object
-
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
String
object
-
isFileLocked
Determines whether the given fileRecord is locked by a different user session.- Parameters:
fileRecord
- aFileRecord
object- 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
String
object
-
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
- aFile
object
-
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
-BackupRecord
for which to download the file- Returns:
- Navigation outcome
- Throws:
IOException
-
clearLocksForSessionId
Removes file locks for the given session id.- Parameters:
sessionId
- aString
object
-
getCurrentFileName
getCurrentFileName.
- Returns:
- File name of the currently selected file record row
-
setCurrentFileName
Getter for the URL pattern.- Parameters:
fileName
- aString
object- Throws:
FileNotFoundException
-
getRecord
-
getCurrentFilePath
getCurrentFilePath.
- Returns:
- a
Path
object
-
getFileUploader
-