Class AdminConfigEditorBean

java.lang.Object
io.goobi.viewer.managedbeans.AdminConfigEditorBean
All Implemented Interfaces:
Serializable

@Named @SessionScoped public class AdminConfigEditorBean extends Object implements Serializable
See Also:
  • Constructor Details

    • AdminConfigEditorBean

      public AdminConfigEditorBean()
  • Method Details

    • init

      @PostConstruct public void init()
    • isRenderBackend

      public boolean isRenderBackend()
    • refresh

      public void refresh()
    • getFileRecordsModel

      public javax.faces.model.DataModel<FileRecord> getFileRecordsModel()
    • getFileInEditionNumber

      public int getFileInEditionNumber()
    • setFileInEditionNumber

      public void setFileInEditionNumber(int fileInEditionNumber)
    • getCurrentFileRecord

      public FileRecord getCurrentFileRecord()
      Returns:
      the currentFileRecord
    • getFileContent

      public String getFileContent()
    • setFileContent

      public void setFileContent(String fileContent)
    • getBackupRecords

      public List<BackupRecord> getBackupRecords()
    • getBackupRecordsModel

      public javax.faces.model.DataModel<BackupRecord> getBackupRecordsModel()
    • isEditable

      public boolean isEditable()
    • setEditable

      public void setEditable(boolean editable)
    • isBackupsAvailable

      public boolean isBackupsAvailable()
    • getCurrentConfigFileType

      public String getCurrentConfigFileType()
    • isFileLocked

      public boolean isFileLocked(FileRecord fileRecord)
      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

      public void openFile() throws IOException
      Throws:
      IOException
    • closeCurrentFileAction

      public String closeCurrentFileAction()
      Returns:
      Navigation outcome
    • unlockFile

      public static void unlockFile(Path file, String sessionId)
      Unlock the given file for the given session id in the static (global) fileLocks object
      Parameters:
      file -
      sessionId -
    • editFile

      public String editFile(boolean writable)
    • saveCurrentFileAction

      public String 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 path
      fileName - File name
      content - File content
      Throws:
      IOException
    • refreshBackups

      public void refreshBackups(File backupFolder)
      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

      public String downloadFile(BackupRecord rec) throws IOException
      Parameters:
      rec - BackupRecord for which to download the file
      Returns:
      Navigation outcome
      Throws:
      IOException
    • clearLocksForSessionId

      public static void clearLocksForSessionId(String sessionId)
      Removes file locks for the given session id.
      Parameters:
      sessionId -
    • getCurrentFileName

      public String getCurrentFileName()
      Returns:
      File name of the currently selected file record row
    • setCurrentFileName

      public void setCurrentFileName(String fileName) throws FileNotFoundException
      Getter for the URL pattern.
      Parameters:
      fileName -
      Throws:
      FileNotFoundException
    • getCurrentFilePath

      public Path getCurrentFilePath()