Class AdminConfigEditorBean

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

@Named @SessionScoped public class AdminConfigEditorBean extends Object implements Serializable

AdminConfigEditorBean class.

See Also:
  • 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

      public void selectBackup(int backupNumber) throws IOException
      Throws:
      IOException
    • upload

      public void upload(Path file)
    • download

      public void download(Path file) throws IOException
      Throws:
      IOException
    • getFileRecordsModel

      public javax.faces.model.DataModel<FileRecord> 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

      public FileRecord getCurrentFileRecord()

      Getter for the field currentFileRecord.

      Returns:
      the currentFileRecord
    • getFileContent

      public String getFileContent()

      Getter for the field fileContent.

      Returns:
      a String object
    • setFileContent

      public void setFileContent(String fileContent)

      Setter for the field fileContent.

      Parameters:
      fileContent - a String object
    • getBackupRecords

      public List<BackupRecord> getBackupRecords()

      Getter for the field backupRecords.

      Returns:
      a List object
    • getBackupRecordsModel

      public javax.faces.model.DataModel<BackupRecord> 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

      public String getCurrentConfigFileType()

      getCurrentConfigFileType.

      Returns:
      a String object
    • isFileLocked

      public boolean isFileLocked(FileRecord fileRecord)
      Determines whether the given fileRecord is locked by a different user session.
      Parameters:
      fileRecord - a FileRecord 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

      public void openFile() throws IOException

      openFile.

      Throws:
      IOException
    • closeCurrentFileAction

      public String closeCurrentFileAction()

      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 - a Path object
      sessionId - a String object
    • editFile

      public String editFile(boolean writable)

      editFile.

      Parameters:
      writable - a boolean
      Returns:
      a String object
    • saveCurrentFileAction

      public String saveCurrentFileAction()
      Saves the currently open file.
      Returns:
      Navigation outcome
    • createBackup

      public void createBackup(FileRecord rec) throws IOException
      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 path
      fileName - File name
      content - File content
      Throws:
      IOException
    • refreshBackups

      public void refreshBackups(File backupFolder)

      refreshBackups.

      Parameters:
      backupFolder - a File 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

      public String downloadFile(BackupRecord rec) throws IOException

      downloadFile.

      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 - a String object
    • getCurrentFileName

      public String getCurrentFileName()

      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 - a String object
      Throws:
      FileNotFoundException
    • getRecord

      public FileRecord getRecord(String filename)
    • getCurrentFilePath

      public Path getCurrentFilePath()

      getCurrentFilePath.

      Returns:
      a Path object
    • getFileUploader

      public FileUploader getFileUploader()