/** * Creates a SAX event handler that generates XML / HTML Strings from the events caught * using a new <code>{@link StringWriter}</code> and the given encoding.<p> * * @param writer the Writer to write to output to */ public CmsXmlSaxWriter(Writer writer) { this(writer, OpenCms.getSystemInfo().getDefaultEncoding()); }
/** * Returns the absolute path to the "persistence.xml" file (in the "real" file system).<p> * * @return the absolute path to the "persistence.xml" configuration file */ public String getPersistenceFileRfsPath() { if (m_persistenceFileRfsPath == null) { m_persistenceFileRfsPath = getAbsoluteRfsPathRelativeToWebInf(FILE_PERSISTENCE); } return m_persistenceFileRfsPath; }
/** * Returns the list of all uploadable zip files and uploadable folders available on the server.<p> * * @param includeFolders if true, the uploadable folders are included in the list * @return the list of all uploadable zip files and uploadable folders available on the server */ protected static List getFileListFromServer(boolean includeFolders) { List result = new ArrayList(); // get the RFS package export path String exportpath = OpenCms.getSystemInfo().getPackagesRfsPath(); File folder = new File(exportpath); // get a list of all files of the packages folder String[] files = folder.list(); for (int i = 0; i < files.length; i++) { File diskFile = new File(exportpath, files[i]); // check this is a file and ends with zip -> this is a database upload file if (diskFile.isFile() && diskFile.getName().endsWith(".zip")) { result.add(diskFile.getName()); } else if (diskFile.isDirectory() && includeFolders && (!diskFile.getName().equalsIgnoreCase(FOLDER_MODULES)) && ((new File(diskFile + File.separator + FILE_MANIFEST)).exists())) { // this is an unpacked package, add it to uploadable files result.add(diskFile.getName()); } } return result; }
/** * Default constructor initializing values.<p> */ public CmsHistorySettings() { m_versions = OpenCms.getSystemInfo().getHistoryVersions(); int versionsDeleted = OpenCms.getSystemInfo().getHistoryVersionsAfterDeletion(); if (versionsDeleted == 0) { m_mode = MODE_DELETED_HISTORY_DISABLED; } else if (versionsDeleted == 1) { m_mode = MODE_DELETED_HISTORY_KEEP_NO_VERSIONS; } else if ((versionsDeleted > 1) || (versionsDeleted == -1)) { m_mode = MODE_DELETED_HISTORY_KEEP_WITH_VERSIONS; } else { m_mode = MODE_DELETED_HISTORY_DISABLED; } }
+ Messages.get().getBundle().key( Messages.GUI_SHELL_VERSION_1, OpenCms.getSystemInfo().getVersionNumber())); for (int i = 0; i < Messages.COPYRIGHT_BY_ALKACON.length; i++) { CmsLog.INIT.info(". " + Messages.COPYRIGHT_BY_ALKACON[i]); Messages.get().getBundle().key( Messages.INIT_OPENCMS_VERSION_1, OpenCms.getSystemInfo().getVersionNumber() + " [" + OpenCms.getSystemInfo().getVersionId() + "]")); if (serverInfo != null) { CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SERVLET_CONTAINER_1, serverInfo)); Messages.get().getBundle().key(Messages.INIT_WEBAPP_NAME_1, getSystemInfo().getWebApplicationName())); CmsLog.INIT.info( Messages.get().getBundle().key(Messages.INIT_SERVLET_PATH_1, getSystemInfo().getServletPath())); CmsLog.INIT.info( Messages.get().getBundle().key(Messages.INIT_OPENCMS_CONTEXT_1, getSystemInfo().getOpenCmsContext())); CmsLog.INIT.info( Messages.get().getBundle().key(Messages.INIT_WEBINF_PATH_1, getSystemInfo().getWebInfRfsPath())); CmsLog.INIT.info( Messages.get().getBundle().key( Messages.INIT_PROPERTY_FILE_1, getSystemInfo().getConfigurationFileRfsPath())); String logFileRfsPath = getSystemInfo().getLogFileRfsPath(); CmsLog.INIT.info( Messages.get().getBundle().key( getSystemInfo().setServerName(serverName);
String exportpath = OpenCms.getSystemInfo().getPackagesRfsPath(); exportpath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(exportpath + "modules"); File folder = new File(exportpath);
getSystemInfo().init(servletContainerSettings); configuration = CmsPropertyUtils.loadProperties(getSystemInfo().getConfigurationFileRfsPath()); } catch (Exception e) { throw new CmsInitException(Messages.get().container( Messages.ERR_CRITICAL_INIT_PROPFILE_1, getSystemInfo().getConfigurationFileRfsPath()), e); getSystemInfo().getServletContainerSettings().setServletThrowsException(throwExc); OpenCms.getSystemInfo().getVersionNumber(), getSystemInfo().getWebApplicationName())); for (int i = 0; i < Messages.COPYRIGHT_BY_ALKACON.length; i++) { System.err.println(Messages.COPYRIGHT_BY_ALKACON[i]); CmsLog.INIT.info(Messages.get().getBundle().key( Messages.INIT_OPENCMS_VERSION_1, OpenCms.getSystemInfo().getVersionNumber())); CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SERVLET_CONTAINER_1, context.getServerInfo())); CmsLog.INIT.info(Messages.get().getBundle().key( Messages.INIT_WEBAPP_NAME_1, getSystemInfo().getWebApplicationName())); CmsLog.INIT.info(Messages.get().getBundle().key( Messages.INIT_SERVLET_PATH_1, getSystemInfo().getServletPath())); CmsLog.INIT.info(Messages.get().getBundle().key( Messages.INIT_OPENCMS_CONTEXT_1, getSystemInfo().getOpenCmsContext())); CmsLog.INIT.info(Messages.get().getBundle().key(
m_mailSettings = OpenCms.getSystemInfo().getMailSettings(); m_configuredJobs = OpenCms.getScheduleManager().getJobs(); m_historyEnabled = OpenCms.getSystemInfo().isHistoryEnabled(); m_historyVersions = OpenCms.getSystemInfo().getHistoryVersions(); m_historyVersionsAfterDeletion = OpenCms.getSystemInfo().getHistoryVersionsAfterDeletion(); CmsServletContainerSettings servletContainerSettings = OpenCms.getSystemInfo().getServletContainerSettings(); if (!servletContainerSettings.getMode().isNone()) { Element servletContainerSettingsElem = systemElement.addElement(N_SERVLETCONTAINERSETTINGS);
if (OpenCms.getSystemInfo().isHistoryEnabled()) { try { dbc, new CmsHistoryFile(currentFolder), OpenCms.getSystemInfo().getHistoryVersions(), -1); dbc, new CmsHistoryFile(currentFolder), OpenCms.getSystemInfo().getHistoryVersionsAfterDeletion(), -1);
getSystemInfo().init(servletContainerSettings); configuration = new CmsParameterConfiguration(getSystemInfo().getConfigurationFileRfsPath()); } catch (Exception e) { throw new CmsInitException( Messages.get().container( Messages.ERR_CRITICAL_INIT_PROPFILE_1, getSystemInfo().getConfigurationFileRfsPath()), e); getSystemInfo().getServletContainerSettings().setServletThrowsException(throwExc); Messages.get().getBundle().key( Messages.LOG_STARTUP_CONSOLE_NOTE_2, OpenCms.getSystemInfo().getVersionNumber(), getSystemInfo().getWebApplicationName())); for (int i = 0; i < Messages.COPYRIGHT_BY_ALKACON.length; i++) { System.err.println(Messages.COPYRIGHT_BY_ALKACON[i]);
/** * Returns the OpenCms request context path.<p> * * This is a convenience method to use in the editor.<p> * * @return the OpenCms request context path */ public String getOpenCmsContext() { return OpenCms.getSystemInfo().getOpenCmsContext(); }
sysInfo.getLogFileRfsPath(), true, null, sysInfo.getConfigurationFileRfsPath(), false, null, key(Messages.GUI_WORKPLACE_LOGVIEW_FILE_CONF_HELP_0))); String configPath = sysInfo.getConfigFolder(); if (configPath != null) { File configFolder = new File(configPath);
/** * Returns the OpenCms workplace request context, e.g. "/opencms/workplace".<p> * * The OpenCms workplace context will always start with a "/" and never have a trailing "/". * The OpenCms context is identical to <code>getContexPath() + WORKPLACE_PATH</code>.<p> * * @return the OpenCms request context, e.g. "/opencms/workplace" * @see #getContextPath() * @see #WORKPLACE_PATH */ public String getWorkplaceContext() { return getContextPath() + WORKPLACE_PATH; }
/** * Substitutes the ${CONTEXT_NAME} and ${SERVLET_NAME} in a path with the real values.<p> * * @param path the path to substitute * @return path with real context values */ protected String insertContextStrings(String path) { // create a new macro resolver CmsMacroResolver resolver = CmsMacroResolver.newInstance(); // add special mappings for macros resolver.addMacro("CONTEXT_NAME", OpenCms.getSystemInfo().getContextPath()); resolver.addMacro("SERVLET_NAME", OpenCms.getSystemInfo().getServletPath()); // resolve the macros return resolver.resolveMacros(path); }
/** * Default constructor initializing values.<p> */ public CmsHistoryClear() { m_keepVersions = OpenCms.getSystemInfo().getHistoryVersions(); m_clearDeletedMode = CmsHistoryClearDialog.MODE_CLEANDELETED_KEEP_RESTORE_VERSION; }
/** * Returns the destination path in the "real" file system.<p> * * @return the destination */ public String getDestinationPath() { if (m_destinationPath == null) { m_destinationPath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebApplication( m_configuredDestination); } return m_destinationPath; }
/** * Creates an instance with default settings that tries to use the log file path obtained * from <code>{@link OpenCms}'s {@link org.opencms.main.CmsSystemInfo}</code> instance.<p> * * If the log file path is invalid or not configured correctly a logging is performed and the * path remains empty to allow user-specified file selection.<p> */ public CmsRfsFileViewer() { if (OpenCms.getRunLevel() >= OpenCms.RUNLEVEL_3_SHELL_ACCESS) { m_rootPath = new File(OpenCms.getSystemInfo().getLogFileRfsPath()).getParent(); } m_isLogfile = true; // system default charset: see http://java.sun.com/j2se/corejava/intl/reference/faqs/index.html#default-encoding m_fileEncoding = Charset.forName(new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding()); m_enabled = true; m_windowSize = 200; }
null, null); m_opencms.getSystemInfo().init(settings); String propertyPath = m_opencms.getSystemInfo().getConfigurationFileRfsPath(); out.println(m_messages.key(Messages.GUI_SHELL_CONFIG_FILE_1, propertyPath)); out.println();
/** * * @see org.opencms.workplace.list.A_CmsListReport#initializeThread() */ @Override public I_CmsReportThread initializeThread() { String modulename = getParamModule(); String importpath = OpenCms.getSystemInfo().getPackagesRfsPath(); importpath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(importpath + "modules/" + modulename); I_CmsReportThread importThread = new CmsDatabaseImportThread(getCms(), importpath, true); return importThread; }
m_mailSettings = OpenCms.getSystemInfo().getMailSettings(); m_configuredJobs = OpenCms.getScheduleManager().getJobs(); m_historyEnabled = OpenCms.getSystemInfo().isHistoryEnabled(); m_historyVersions = OpenCms.getSystemInfo().getHistoryVersions(); m_historyVersionsAfterDeletion = OpenCms.getSystemInfo().getHistoryVersionsAfterDeletion(); CmsServletContainerSettings servletContainerSettings = OpenCms.getSystemInfo().getServletContainerSettings(); if (!servletContainerSettings.getMode().isNone()) { Element servletContainerSettingsElem = systemElement.addElement(N_SERVLETCONTAINERSETTINGS);