Package io.goobi.viewer.managedbeans
Class AdminConfigEditorBean
java.lang.Object
io.goobi.viewer.managedbeans.AdminConfigEditorBean
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
static void
clearLocksForSessionId
(String sessionId) Removes file locks for the given session id.static void
createBackup
(String backupFolderPath, String fileName, String content) Creates a timestamped backup of the given file name and content.downloadFile
(BackupRecord rec) editFile
(boolean writable) javax.faces.model.DataModel<BackupRecord>
int
javax.faces.model.DataModel<FileRecord>
void
init()
boolean
boolean
boolean
boolean
isFileLocked
(FileRecord fileRecord) Determines whether the given fileRecord is locked by a different user session.boolean
boolean
void
openFile()
void
refresh()
void
refreshBackups
(File backupFolder) Saves the currently open file.void
selectFileAndShowBackups
(boolean writable) void
setCurrentFileName
(String fileName) Getter for the URL pattern.void
setEditable
(boolean editable) void
setFileContent
(String fileContent) void
setFileInEditionNumber
(int fileInEditionNumber) void
static void
unlockFile
(Path file, String sessionId) Unlock the given file for the given session id in the static (global) fileLocks object
-
Constructor Details
-
AdminConfigEditorBean
public AdminConfigEditorBean()
-
-
Method Details
-
init
@PostConstruct public void init() -
isRenderBackend
public boolean isRenderBackend() -
refresh
public void refresh() -
getFileRecordsModel
-
getFileInEditionNumber
public int getFileInEditionNumber() -
setFileInEditionNumber
public void setFileInEditionNumber(int fileInEditionNumber) -
getCurrentFileRecord
- Returns:
- the currentFileRecord
-
getFileContent
-
setFileContent
-
getBackupRecords
-
getBackupRecordsModel
-
isEditable
public boolean isEditable() -
setEditable
public void setEditable(boolean editable) -
isBackupsAvailable
public boolean isBackupsAvailable() -
getCurrentConfigFileType
-
isFileLocked
Determines whether the given fileRecord is locked by a different user session.- Parameters:
fileRecord
-- Returns:
- true if file path locked by other session id; false otherwise
-
isNightMode
public boolean isNightMode() -
changeNightMode
public void changeNightMode() -
openFile
- Throws:
IOException
-
closeCurrentFileAction
- Returns:
- Navigation outcome
-
unlockFile
Unlock the given file for the given session id in the static (global) fileLocks object- Parameters:
file
-sessionId
-
-
editFile
-
saveCurrentFileAction
Saves the currently open file.- Returns:
- Navigation outcome
-
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
- Parameters:
backupFolder
-
-
isConfigViewer
public boolean isConfigViewer()- Returns:
- true if currently editing config_viewer.xml; false otherwise
-
selectFileAndShowBackups
public void selectFileAndShowBackups(boolean writable) - Parameters:
writable
-
-
showBackups
public void showBackups() -
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
-
-
getCurrentFileName
- Returns:
- File name of the currently selected file record row
-
setCurrentFileName
Getter for the URL pattern.- Parameters:
fileName
-- Throws:
FileNotFoundException
-
getCurrentFilePath
-