@Override public String getMacroValue(String macro) { return CmsEncoder.escapeXml(super.getMacroValue(macro)); } };
@Override public String getMacroValue(String macro) { String result = super.getMacroValue(macro); // The macro may contain quotes or angle brackets, so we need to escape the values for insertion into the design file return CmsEncoder.escapeXml(result); } };
@SuppressWarnings("synthetic-access") @Override public String getMacroValue(String macro) { if (macro.startsWith(PAGE_PROPERTY_PREFIX)) { String remainder = macro.substring(PAGE_PROPERTY_PREFIX.length()); int secondColonPos = remainder.indexOf(":"); String defaultValue = ""; String propName = null; if (secondColonPos >= 0) { propName = remainder.substring(0, secondColonPos); defaultValue = remainder.substring(secondColonPos + 1); } else { propName = remainder; } if (containerPage != null) { try { CmsProperty prop = cms.readPropertyObject(containerPage, propName, true); String propValue = prop.getValue(); if ((propValue == null) || PROPERTY_EMPTY_MARKER.equals(propValue)) { propValue = defaultValue; } return propValue; } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e); return defaultValue; } } } return super.getMacroValue(macro); }
/** * @see org.opencms.util.CmsMacroResolver#getMacroValue(java.lang.String) */ @Override public String getMacroValue(String macro) { if (macro.startsWith(PREFIX_VALUE)) { String path = macro.substring(PREFIX_VALUE.length()); I_CmsXmlContentValue contentValue = m_content.getValue(path, m_contentLocale); String value = null; if (contentValue != null) { value = contentValue.getStringValue(m_cms); } if (value == null) { value = ""; } return value; } else if (macro.equals(PAGE_TITLE)) { return getContainerPageProperty(CmsPropertyDefinition.PROPERTY_TITLE); } else if (macro.equals(PAGE_NAV)) { return getContainerPageProperty(CmsPropertyDefinition.PROPERTY_NAVTEXT); } else if (macro.startsWith(NO_PREFIX)) { return "%(" + macro + ")"; // this is just to prevent the %(no_prefix:...) macro from being expanded to an empty string. We could call setKeepEmptyMacros(true) instead, // but that would also affect other macros. } else { return super.getMacroValue(macro); } }
return m_wp.getMacroResolver().getMacroValue(macro);
return m_wp.getMacroResolver().getMacroValue(macro);