/** * Sets the list of compiled browser patterns.<p> * * @param pattern the list of compiled browser patterns */ private void setBrowserPattern(List pattern) { if ((pattern == null) || (pattern.size() == 0)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_PATTERN_0)); } m_browserPattern = pattern; }
/** * Sets the list of compiled browser patterns.<p> * * @param pattern the list of compiled browser patterns */ private void setBrowserPattern(List<Pattern> pattern) { if ((pattern == null) || (pattern.size() == 0)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_PATTERN_0)); } m_browserPattern = pattern; }
/** * Sets the valid user agents regular expressions of the editor.<p> * * @param agents the valid user agents regular expressions of the editor */ private void setUserAgentsRegEx(List<String> agents) { if ((agents == null) || (agents.size() == 0)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_NO_USER_AGENTS_0)); } m_userAgentsRegEx = agents; }
/** * Sets the valid resource types of the editor.<p> * * @param types the valid resource types of the editor */ private void setResourceTypes(Map types) { if ((types == null) || (types.size() == 0)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_NO_RESOURCE_TYPES_0)); } m_resTypes = types; }
/** * Sets the valid resource types of the editor.<p> * * @param types the valid resource types of the editor */ private void setResourceTypes(Map<String, String[]> types) { if ((types == null) || (types.size() == 0)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_NO_RESOURCE_TYPES_0)); } m_resTypes = types; }
/** * Sets the valid user agents regular expressions of the editor.<p> * * @param agents the valid user agents regular expressions of the editor */ private void setUserAgentsRegEx(List agents) { if ((agents == null) || (agents.size() == 0)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_NO_USER_AGENTS_0)); } m_userAgentsRegEx = agents; }
/** * Sets the editor workplace URI.<p> * @param uri the editor workplace URI */ private void setEditorUri(String uri) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(uri)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_URI_0)); } m_editorUri = uri; }
/** * Sets the editor workplace URI.<p> * @param uri the editor workplace URI */ private void setEditorUri(String uri) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(uri)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_URI_0)); } m_editorUri = uri; }
/** * Sets the editor label key used for the localized nice name.<p> * * @param label the editor label key used for the localized nice name */ private void setEditorLabel(String label) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(label)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_LABEL_0)); } m_editorLabel = label; }
/** * Sets the editor label key used for the localized nice name.<p> * * @param label the editor label key used for the localized nice name */ private void setEditorLabel(String label) { if (CmsStringUtil.isEmptyOrWhitespaceOnly(label)) { setValidConfiguration(false); LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_LABEL_0)); } m_editorLabel = label; }
/** * Logs configuration errors and invalidates the current configuration.<p> * * @param message the message specifying the configuration error * @param t the Throwable object or null */ private void logConfigurationError(String message, Throwable t) { setValidConfiguration(false); if (LOG.isErrorEnabled()) { if (t == null) { LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_ERROR_1, message)); } else { LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_ERROR_1, message), t); } } }
/** * Logs configuration errors and invalidates the current configuration.<p> * * @param message the message specifying the configuration error * @param t the Throwable object or null */ private void logConfigurationError(String message, Throwable t) { setValidConfiguration(false); if (LOG.isErrorEnabled()) { if (t == null) { LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_ERROR_1, message)); } else { LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_ERROR_1, message), t); } } }
/** * Constructor with xml data String.<p> * * @param xmlData the XML data String containing the information about the editor * @param editorUri the editor workplace URI */ public CmsWorkplaceEditorConfiguration(byte[] xmlData, String editorUri) { setValidConfiguration(true); try { initialize(CmsXmlUtils.unmarshalHelper(xmlData, null), editorUri); } catch (CmsXmlException e) { // xml String could not be parsed logConfigurationError(Messages.get().getBundle().key(Messages.ERR_XML_PARSE_0), e); } }
/** * Constructor with xml data String.<p> * * @param xmlData the XML data String containing the information about the editor * @param editorUri the editor workplace URI * @param name the editor configuration name */ public CmsWorkplaceEditorConfiguration(byte[] xmlData, String editorUri, String name) { setValidConfiguration(true); try { m_name = name; initialize(CmsXmlUtils.unmarshalHelper(xmlData, null), editorUri); } catch (CmsXmlException e) { // xml String could not be parsed logConfigurationError(Messages.get().getBundle().key(Messages.ERR_XML_PARSE_0), e); } }