/** * Creates a new instance.<p> * * @param configuration a pipe-separated list of colon-separated key-value pairs, where the key is the prefix and the value is the replacement */ public CmsReplaceMessageKeyPrefix(String configuration) { m_substitutions = CmsStringUtil.splitAsMap(configuration, "|", ":"); }
/** * Gets the parameters as a map of strings.<p> * * @return the parameters as a map of strings */ public Map<String, String> getParamsMap() { if (m_params == null) { return Collections.emptyMap(); } return CmsStringUtil.splitAsMap(m_params, "|", "="); }
/** * Returns the collector parameters.<p> * * @param param the collector parameter * * @return the collector parameters */ private Map<String, String> getParameters(String param) { if (CmsStringUtil.isNotEmpty(param)) { return CmsStringUtil.splitAsMap(param, "|", "="); } return Collections.emptyMap(); }
/** * Returns the collector parameters.<p> * * @param param the collector parameter * * @return the collector parameters */ private Map<String, String> getParameters(String param) { if (CmsStringUtil.isNotEmpty(param)) { return CmsStringUtil.splitAsMap(param, "|", "="); } return Collections.emptyMap(); } }
/** * Splits the given parameter String into the query part and the cms specific arguments.<p> * * @param param the parameter String to parse * * @return a map containing the arguments */ private Map<String, String> getParamsAsMap(String param) { Map<String, String> result = new HashMap<String, String>(); if (param != null) { int in = (param.indexOf('|')); if (in != -1) { String solrPart = param.substring(0, in); String cmsPart = param.substring(in); result = CmsStringUtil.splitAsMap(cmsPart, "|", "="); result.put(SOLR_PART, solrPart); } else { result.put(SOLR_PART, param); } } return result; } }
/** * Initializes the configuration date from the given configuration string.<p> * * This should be called by subclasses of this class.<p> * * @param config the widget configuration string */ public final void initConfiguration(String config) { m_configuration = config; m_configurationMap = CmsStringUtil.splitAsMap(config, "|", ":"); m_configurationMap.put(CmsContentDefinition.PARAM_INIT_CALL, INIT_FUNCTION_PREFIX + getName()); m_jsonConfig = new JSONObject(new HashMap<String, Object>(m_configurationMap)); }
/** * Looks up the given key from the map that is passed as a String, and returns either the * element found or the default value.<p> * * The map String must have the form <code>"key1:value1|key2:value2"</code> etc.<p> * * @param key the key to look up * @param map the map represented as a String * @param defaultValue the default value * @return the element found in the map with the given key, or the default value */ public static String lookup(String key, String map, String defaultValue) { Map<String, String> values = CmsStringUtil.splitAsMap(map, "|", ":"); String result = values.get(key); if (CmsStringUtil.isEmptyOrWhitespaceOnly(result)) { return defaultValue; } return result; }
/** * @see org.opencms.loader.I_CmsTemplateContextProvider#initialize(org.opencms.file.CmsObject, java.lang.String) */ public void initialize(CmsObject cms, String config) { m_cms = cms; if (CmsStringUtil.isEmptyOrWhitespaceOnly(config)) { m_params = new HashMap<String, String>(); } else { m_params = CmsStringUtil.splitAsMap(config, ",", "="); } getAllContexts(); }
/** * Gets ADE parameters.<p> * * @param cms the current CMS context * @return the ADE parameters for the current user */ public Map<String, String> getParameters(CmsObject cms) { Map<String, String> result = new LinkedHashMap<String, String>(m_parameters); if (cms != null) { String userParamsStr = (String)(cms.getRequestContext().getCurrentUser().getAdditionalInfo().get( "ADE_PARAMS")); if (userParamsStr != null) { Map<String, String> userParams = CmsStringUtil.splitAsMap(userParamsStr, "|", ":"); result.putAll(userParams); } } return result; }
Map<String, String> optionMap = CmsStringUtil.splitAsMap(options, ",", ":"); Matcher matcher = REGEX_COMPILED.matcher(link); if (!matcher.find()) {
/** * Gets the container name for function detail elements depending on the parent folder.<p> * * @param parent the parent folder * @return the name of the function detail container */ private String getFunctionDetailContainerName(CmsResource parent) { CmsObject cms = getCmsObject(); String notFound = null; String containerInfo = OpenCms.getTemplateContextManager().readPropertyFromTemplate( cms, parent, CmsPropertyDefinition.PROPERTY_CONTAINER_INFO, notFound); if (containerInfo == notFound) { return null; } Map<String, String> attrs = CmsStringUtil.splitAsMap(containerInfo, "|", "="); //$NON-NLS-2$ String functionDetailContainerName = attrs.get(KEY_FUNCTION_DETAIL); return functionDetailContainerName; }
return items; Map<String, String> colVals = CmsStringUtil.splitAsMap(searchFilter, PARAM_DELIM, KEY_VAL_DELIM); List res = new ArrayList(); Iterator itItems = items.iterator();
return items; Map<String, String> colVals = CmsStringUtil.splitAsMap(searchFilter, PARAM_DELIM, KEY_VAL_DELIM); List<CmsListItem> res = new ArrayList<CmsListItem>(); Iterator<CmsListItem> itItems = items.iterator();
/** * Returns the widget configuration string parsed into a JSONObject.<p> * * The configuration string should be a map of key value pairs separated by ':' and '|': KEY_1:VALUE_1|KEY_2:VALUE_2 ... * * @param widgetConfiguration the configuration to parse * * @return the configuration JSON */ public static JSONObject getWidgetConfigurationAsJSON(String widgetConfiguration) { JSONObject result = new JSONObject(); if (CmsStringUtil.isEmptyOrWhitespaceOnly(widgetConfiguration)) { return result; } Map<String, String> confEntries = CmsStringUtil.splitAsMap( widgetConfiguration, CONF_PARAM_SEPARATOR, CONF_KEYVALUE_SEPARATOR); for (Map.Entry<String, String> entry : confEntries.entrySet()) { try { result.put(entry.getKey(), entry.getValue()); } catch (JSONException e) { // should never happen LOG.error( Messages.get().container(Messages.ERR_XMLCONTENT_UNKNOWN_ELEM_PATH_SCHEMA_1, widgetConfiguration), e); } } return result; }
/** * @see org.opencms.setup.xml.A_CmsSetupXmlUpdate#executeUpdate(org.dom4j.Document, java.lang.String, boolean) */ @Override protected boolean executeUpdate(Document document, String xpath, boolean forReal) { if (!forReal) { return true; } else { String[] types = new String[] {"xmlcontent"}; String[] advancedEntries = new String[] { "key:GUI_EXPLORER_CONTEXT_ADE_PUBLISHSCHEDULED_0|name:org.opencms.gwt.client.ui.contextmenu.CmsEmbeddedAction|params:dialogId=org.opencms.ui.actions.CmsPublishScheduledDialogAction|rule:ade-publishscheduled"}; for (String type : types) { String advancedPath = xpathForType(type) + "/editoptions/contextmenu/entry[@key='GUI_EXPLORER_CONTEXT_ADE_ADVANCED_0']"; Element advancedElem = (Element)(document.selectSingleNode(advancedPath)); for (String advanced : advancedEntries) { Map<String, String> entryMap = CmsStringUtil.splitAsMap(advanced, "|", ":"); Element existingElem = (Element)(advancedElem.selectSingleNode( "entry[@key='" + entryMap.get("key") + "']")); if (existingElem == null) { Element newElem = advancedElem.addElement("entry"); for (Map.Entry<String, String> entry : entryMap.entrySet()) { newElem.addAttribute(entry.getKey(), entry.getValue()); } } } } return true; } }
Map<String, String> config = CmsStringUtil.splitAsMap(configString, "|", "=");
Map params = CmsStringUtil.splitAsMap( parameter, I_CmsListResourceCollector.SEP_PARAM,
Map<String, String> params = CmsStringUtil.splitAsMap( parameter, I_CmsListResourceCollector.SEP_PARAM,
/** * Contains the visibility handler configuration for a content field path.<p> */ protected static class VisibilityConfiguration { /** The handler instance. */ private I_CmsXmlContentVisibilityHandler m_handler; /** The handler configuration parameters. */ private String m_params; /** * Constructor.<p> * * @param handler the handler instance * @param params the handler configuration parameteres */ protected VisibilityConfiguration(I_CmsXmlContentVisibilityHandler handler, String params) { m_handler = handler; m_params = params; } /** * Returns the visibility handler instance.<p> * * @return the handler instance */ public I_CmsXmlContentVisibilityHandler getHandler() {
name = name.replace('/', '_'); Map<String, String> configMap = CmsStringUtil.splitAsMap(config, "|", ":"); String parentPath = configMap.get("parent"); String id = configMap.get("id");