/** * Set the amount of lines (or entries depending on whether a standard log file is shown) * to display per page.<p> * * @param windowSize the amount of lines to display per page * * @throws CmsRuntimeException if the configuration of this instance has been frozen * ({@link #setFrozen(boolean)}) */ public void setWindowSize(int windowSize) throws CmsRuntimeException { checkFrozen(); m_windowSize = windowSize; } }
String rootPath = viewSettings.getRootPath(); if (rootPath != null) { fileViewElement.addElement(N_ROOTPATH).setText(rootPath); String filePath = viewSettings.getFilePath(); if (filePath != null) { fileViewElement.addElement(N_FILEPATH).setText(filePath); fileViewElement.addElement(N_ENABLED).setText(String.valueOf(viewSettings.isEnabled())); fileViewElement.addElement(N_FILEENCODING).setText(viewSettings.getFileEncoding()); fileViewElement.addElement(N_ISLOGFILE).setText(String.valueOf(viewSettings.getIsLogfile())); fileViewElement.addElement(N_WINDOWSIZE).setText(String.valueOf(viewSettings.getWindowSize()));
CmsRfsFileViewer clone = new CmsRfsFileViewer(); clone.m_rootPath = m_rootPath; try { clone.setFilePath(m_filePath); } catch (CmsRfsException e) { clone.m_enabled = m_enabled; clone.setWindowSize(m_windowSize);
if (m_logView.getFilePath() == null) { fileContentHeader = key(Messages.GUI_WORKPLACE_LOGVIEW_NO_FILE_SELECTED_0); } else { fileContentHeader = m_logView.getFilePath().replace('\\', '/');
m_editorHandler = new CmsEditorHandler(); m_fileMaxUploadSize = -1; m_fileViewSettings = new CmsRfsFileViewer(); m_explorerTypeSettingsFromXml = new ArrayList(); m_explorerTypeSettingsFromModules = new ArrayList();
int startLine; if (m_isLogfile) { lines = scrollToFileEnd();
String rootPath = viewSettings.getRootPath(); if (rootPath != null) { fileViewElement.addElement(N_ROOTPATH).setText(rootPath); String filePath = viewSettings.getFilePath(); if (filePath != null) { fileViewElement.addElement(N_FILEPATH).setText(filePath); fileViewElement.addElement(N_ENABLED).setText(String.valueOf(viewSettings.isEnabled())); fileViewElement.addElement(N_FILEENCODING).setText(viewSettings.getFileEncoding()); fileViewElement.addElement(N_ISLOGFILE).setText(String.valueOf(viewSettings.getIsLogfile())); fileViewElement.addElement(N_WINDOWSIZE).setText(String.valueOf(viewSettings.getWindowSize()));
CmsRfsFileViewer clone = new CmsRfsFileViewer(); clone.m_rootPath = m_rootPath; try { clone.setFilePath(m_filePath); } catch (CmsRfsException e) { clone.m_enabled = m_enabled; clone.setWindowSize(m_windowSize); clone.m_fileName2lineIndex = m_fileName2lineIndex;
/** * Returns the file that will be downloaded upon clicking the download button * generated in this form by <code>{@link #dialogButtonsOkCancel()}</code>.<p> * * @return the file that will be downloaded upon clicking the download button * generated in this form by <code>{@link #dialogButtonsOkCancel()}</code> * * @throws CmsRuntimeException if access to the chosen file to download fails */ protected File getDownloadFile() throws CmsRuntimeException { if (m_downloadFile == null) { // no clone needed: we just read here. CmsRfsFileViewer fileView = OpenCms.getWorkplaceManager().getFileViewSettings(); m_downloadFile = new File(fileView.getFilePath()); try { // 2nd check: it is impossible to set an invalid path to that class. m_downloadFile = m_downloadFile.getCanonicalFile(); } catch (IOException ioex) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_FILE_ACCESS_0), ioex); } } return m_downloadFile; }
m_editorHandler = new CmsEditorHandler(); m_fileMaxUploadSize = -1; m_fileViewSettings = new CmsRfsFileViewer(); m_explorerTypeSettingsFromXml = new ArrayList<CmsExplorerTypeSettings>(); m_explorerTypeSettingsFromModules = new ArrayList<CmsExplorerTypeSettings>();
int startLine; if (m_isLogfile) { lines = scrollToFileEnd();
/** * Set the amount of lines (or entries depending on whether a standard log file is shown) * to display per page.<p> * * @param windowSize the amount of lines to display per page * * @throws CmsRuntimeException if the configuration of this instance has been frozen * ({@link #setFrozen(boolean)}) */ public void setWindowSize(int windowSize) throws CmsRuntimeException { checkFrozen(); m_windowSize = windowSize; } }
/** * Returns the file that will be downloaded upon clicking the download button * generated in this form by <code>{@link #dialogButtonsOkCancel()}</code>.<p> * * @return the file that will be downloaded upon clicking the download button * generated in this form by <code>{@link #dialogButtonsOkCancel()}</code> * * @throws CmsRuntimeException if access to the chosen file to download fails */ protected File getDownloadFile() throws CmsRuntimeException { if (m_downloadFile == null) { // no clone needed: we just read here. CmsRfsFileViewer fileView = OpenCms.getWorkplaceManager().getFileViewSettings(); m_downloadFile = new File(fileView.getFilePath()); try { // 2nd check: it is impossible to set an invalid path to that class. m_downloadFile = m_downloadFile.getCanonicalFile(); } catch (IOException ioex) { throw new CmsRuntimeException(Messages.get().container(Messages.ERR_FILE_ACCESS_0), ioex); } } return m_downloadFile; }
/** * Sets the start position of the current display.<p> * * This is a count of "windows" that * consist of viewable text with "windowSize" lines of text (for a non-standard log file) or * log-entries (for a standard log file).<p> * * @param windowPos the start position of the current display to set * * @throws CmsRuntimeException if the configuration of this instance has been frozen * ({@link #setFrozen(boolean)}) */ public void setWindowPos(int windowPos) throws CmsRuntimeException { checkFrozen(); m_windowPos = windowPos; }
/** * Sets the start position of the current display.<p> * * This is a count of "windows" that * consist of viewable text with "windowSize" lines of text (for a non-standard log file) or * log-entries (for a standard log file).<p> * * @param windowPos the start position of the current display to set * * @throws CmsRuntimeException if the configuration of this instance has been frozen * ({@link #setFrozen(boolean)}) */ public void setWindowPos(int windowPos) throws CmsRuntimeException { checkFrozen(); m_windowPos = windowPos; }
/** * Set if the internal file is in standard log file format (true) or not (false).<p> * * If set to true the file might be * treated / displayed in a more convenient format than standard files in future. * Currently it is only inverted (last lines appear first) and only the last * 'Window Size' lines of the file are displayed.<p> * * Do not activate this (it is possible from the log file viewer settings in the workplace * administration) if your selected file is no log file: The display will confuse you and * be more expensive (imaging scrolling a 20 MB file to view the last 200 lines). <p> * * @param isLogfile determines if the internal file is in standard log file format (true) or not (false) * * @throws CmsRuntimeException if the configuration of this instance has been frozen * ({@link #setFrozen(boolean)}) */ public void setIsLogfile(boolean isLogfile) throws CmsRuntimeException { checkFrozen(); m_isLogfile = isLogfile; }
/** * Set if the internal file is in standard log file format (true) or not (false).<p> * * If set to true the file might be * treated / displayed in a more convenient format than standard files in future. * Currently it is only inverted (last lines appear first) and only the last * 'Window Size' lines of the file are displayed.<p> * * Do not activate this (it is possible from the log file viewer settings in the workplace * administration) if your selected file is no log file: The display will confuse you and * be more expensive (imaging scrolling a 20 MB file to view the last 200 lines). <p> * * @param isLogfile determines if the internal file is in standard log file format (true) or not (false) * * @throws CmsRuntimeException if the configuration of this instance has been frozen * ({@link #setFrozen(boolean)}) */ public void setIsLogfile(boolean isLogfile) throws CmsRuntimeException { checkFrozen(); m_isLogfile = isLogfile; }
/** * Set the character encoding of the underlying file.<p> * * The given String has to match a valid char set name (canonical or alias) * of one of the system's supported <code>{@link Charset}</code> instances * (see <code>{@link Charset#forName(java.lang.String)}</code>).<p> * * This setting will be used for reading the file. This enables to correctly * display files with text in various encodings in UIs.<p> * * @param fileEncoding the character encoding of the underlying file to set */ public void setFileEncoding(String fileEncoding) { checkFrozen(); try { m_fileEncoding = Charset.forName(fileEncoding); } catch (IllegalCharsetNameException icne) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_CHARSET_ILLEGAL_NAME_1, fileEncoding)); } catch (UnsupportedCharsetException ucse) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_CHARSET_UNSUPPORTED_1, fileEncoding)); } }