/** * Returns <code>true</code> if there is at last one error in the selected locale.<p> * * @param locale the locale to check * * @return <code>true</code> if there is at last one error in the selected locale */ public boolean hasErrors(Locale locale) { return null != getErrors(locale); }
/** * Returns <code>true</code> if there is at last one error in the selected locale.<p> * * @param locale the locale to check * * @return <code>true</code> if there is at last one error in the selected locale */ public boolean hasErrors(Locale locale) { return null != getErrors(locale); }
for (Entry<Locale, Map<String, String>> localeEntry : errorHandler.getErrors().entrySet()) { Map<String[], String> errors = new HashMap<String[], String>(); for (Entry<String, String> error : localeEntry.getValue().entrySet()) {
/** * @see org.opencms.ugc.shared.rpc.I_CmsUgcEditService#validateContent(org.opencms.util.CmsUUID, java.util.Map) */ public Map<String, String> validateContent(CmsUUID sessionId, Map<String, String> contentValues) throws CmsUgcException { Map<String, String> result = Maps.newHashMap(); try { CmsUgcSession session = getFormSession(sessionId); if ((session != null) && sessionId.equals(session.getId())) { CmsXmlContentErrorHandler errorHandler = session.validateContent(contentValues); result = errorHandler.getErrors(session.getMessageLocale()); } else { // invalid session } } catch (Exception e) { error(e); } return result; }
"<span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: 0.3em;\"></span>"); boolean differentLocaleErrors = false; if ((getValidationHandler().getErrors(getElementLocale()) == null) || (getValidationHandler().getErrors().size() > getValidationHandler().getErrors( getElementLocale()).size())) { Map<Locale, Map<String, String>> locErrors = getValidationHandler().getErrors(); Iterator<Map.Entry<Locale, Map<String, String>>> locErrorsIter = locErrors.entrySet().iterator(); while (locErrorsIter.hasNext()) { && getValidationHandler().getErrors(getElementLocale()).containsKey(key)) { result.append(getEditorResourceUri()); result.append("error.png\" border=\"0\" alt=\"\" align=\"left\" hspace=\"5\">"); result.append(resolveMacros(getValidationHandler().getErrors(getElementLocale()).get(key))); result.append("</td><td></td></tr>\n"); } else { result.append("error.png"); result.append("\" border=\"0\" alt=\"\"></td><td class=\"xmlTdError\">"); result.append(resolveMacros(getValidationHandler().getErrors(getElementLocale()).get(key))); result.append("</td><td></td></tr>\n");
result.append("<span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: 0.3em;\"></span>"); boolean differentLocaleErrors = false; if ((getValidationHandler().getErrors(getElementLocale()) == null) || (getValidationHandler().getErrors().size() > getValidationHandler().getErrors(getElementLocale()).size())) { Map locErrors = getValidationHandler().getErrors(); Iterator locErrorsIter = locErrors.entrySet().iterator(); while (locErrorsIter.hasNext()) { if (showErrors && getValidationHandler().hasErrors(getElementLocale()) && getValidationHandler().getErrors(getElementLocale()).containsKey(key)) { result.append(getEditorResourceUri()); result.append("error.png\" border=\"0\" alt=\"\" align=\"left\" hspace=\"5\">"); result.append(resolveMacros(getValidationHandler().getErrors(getElementLocale()).get(key))); result.append("</td><td></td></tr>\n"); } else { result.append("error.png"); result.append("\" border=\"0\" alt=\"\"></td><td class=\"xmlTdError\">"); result.append(resolveMacros(getValidationHandler().getErrors(getElementLocale()).get(key))); result.append("</td><td></td></tr>\n");
/** * @see org.opencms.ugc.shared.rpc.I_CmsUgcEditService#saveContent(org.opencms.util.CmsUUID, java.util.Map) */ public Map<String, String> saveContent(CmsUUID sessionId, Map<String, String> contentValues) throws CmsUgcException { Map<String, String> result = null; try { CmsUgcSession session = getFormSession(sessionId); if ((session != null) && sessionId.equals(session.getId())) { CmsXmlContentErrorHandler errorHandler = session.saveContent(contentValues); if (errorHandler.hasErrors()) { result = errorHandler.getErrors(session.getMessageLocale()); } else { session.finish(); result = Collections.emptyMap(); } } else { // invalid session } } catch (Exception e) { error(e); } return result; }