<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<liferay-ui:error exception="<%= DDMFormLayoutValidationException.class %>" message="please-enter-a-valid-form-layout" />

<liferay-ui:error exception="<%= DDMFormLayoutValidationException.MustNotDuplicateFieldName.class %>">

	<%
	DDMFormLayoutValidationException.MustNotDuplicateFieldName mndfn = (DDMFormLayoutValidationException.MustNotDuplicateFieldName)errorException;
	%>

	<liferay-ui:message arguments="<%= HtmlUtil.escape(StringUtil.merge(mndfn.getDuplicatedFieldNames(), StringPool.COMMA_AND_SPACE)) %>" key="the-definition-field-name-x-was-defined-more-than-once" translateArguments="<%= false %>" />
</liferay-ui:error>

<liferay-ui:error exception="<%= DDMFormValidationException.class %>" message="please-enter-a-valid-form-definition" />

<liferay-ui:error exception="<%= DDMFormValidationException.MustNotDuplicateFieldName.class %>">

	<%
	DDMFormValidationException.MustNotDuplicateFieldName mndfn = (DDMFormValidationException.MustNotDuplicateFieldName)errorException;
	%>

	<liferay-ui:message arguments="<%= HtmlUtil.escape(mndfn.getFieldName()) %>" key="the-definition-field-name-x-was-defined-more-than-once" translateArguments="<%= false %>" />
</liferay-ui:error>

<liferay-ui:error exception="<%= DDMFormValidationException.MustSetFieldsForForm.class %>" message="please-add-at-least-one-field" />

<liferay-ui:error exception="<%= DDMFormValidationException.MustSetOptionsForField.class %>">

	<%
	DDMFormValidationException.MustSetOptionsForField msoff = (DDMFormValidationException.MustSetOptionsForField)errorException;
	%>

	<liferay-ui:message arguments="<%= HtmlUtil.escape(msoff.getFieldLabel()) %>" key="at-least-one-option-should-be-set-for-field-x" translateArguments="<%= false %>" />
</liferay-ui:error>

<liferay-ui:error exception="<%= DDMFormValidationException.MustSetValidCharactersForFieldName.class %>">

	<%
	DDMFormValidationException.MustSetValidCharactersForFieldName msvcffn = (DDMFormValidationException.MustSetValidCharactersForFieldName)errorException;
	%>

	<liferay-ui:message arguments="<%= HtmlUtil.escape(msvcffn.getFieldName()) %>" key="invalid-characters-were-defined-for-field-name-x" translateArguments="<%= false %>" />
</liferay-ui:error>

<liferay-ui:error exception="<%= DDMFormValidationException.MustSetValidFormRuleExpression.class %>" message="there-are-invalid-rule-expressions" />

<liferay-ui:error exception="<%= DDMFormValidationException.MustSetValidValidationExpression.class %>">

	<%
	DDMFormValidationException.MustSetValidValidationExpression msvve = (DDMFormValidationException.MustSetValidValidationExpression)errorException;
	%>

	<liferay-ui:message arguments='<%= new Object[] {StringBundler.concat("<b>", HtmlUtil.escape(msvve.getValidationExpressionArgument()), "</b>"), StringBundler.concat("<b>", HtmlUtil.escape(msvve.getFieldName()), "</b>")} %>' key="the-validation-expression-x-set-for-field-x-is-invalid" translateArguments="<%= false %>" />
</liferay-ui:error>

<liferay-ui:error exception="<%= DDMFormValidationException.MustSetValidVisibilityExpression.class %>">

	<%
	DDMFormValidationException.MustSetValidVisibilityExpression msvve = (DDMFormValidationException.MustSetValidVisibilityExpression)errorException;
	%>

	<liferay-ui:message arguments="<%= new Object[] {HtmlUtil.escape(msvve.getVisibilityExpression()), HtmlUtil.escape(msvve.getFieldName())} %>" key="the-visibility-expression-x-set-for-field-x-is-invalid" translateArguments="<%= false %>" />
</liferay-ui:error>

<liferay-ui:error exception="<%= FormInstanceFieldSettingsException.MustSetValidValueForProperties.class %>">

	<%
	FormInstanceFieldSettingsException.MustSetValidValueForProperties msvvfp = (FormInstanceFieldSettingsException.MustSetValidValueForProperties)errorException;

	Map<String, Set<String>> fieldNamePropertiesMap = msvvfp.getFieldNamePropertiesMap();

	StringBundler sb = new StringBundler(fieldNamePropertiesMap.size());

	for (Entry<String, Set<String>> fieldNameProperties : fieldNamePropertiesMap.entrySet()) {
		Set<String> value = fieldNameProperties.getValue();

		sb.append(LanguageUtil.format(request, (value.size() == 1) ? "the-setting-x-set-for-field-x-is-invalid" : "the-settings-x-set-for-field-x-are-invalid", new Object[] {HtmlUtil.escape(StringUtil.merge(value, StringPool.COMMA_AND_SPACE)), HtmlUtil.escape(fieldNameProperties.getKey())}, false));

		sb.append(StringPool.SPACE);
	}

	sb.setIndex(sb.index() - 1);
	%>

	<%= sb.toString() %>
</liferay-ui:error>

<liferay-ui:error exception="<%= FormInstanceNameException.class %>" message="please-enter-a-valid-form-name" />

<liferay-ui:error exception="<%= FormInstanceSettingsRedirectURLException.class %>">

	<%
	FormInstanceSettingsRedirectURLException formInstanceSettingsRedirectURLException = (FormInstanceSettingsRedirectURLException)errorException;
	%>

	<%= formInstanceSettingsRedirectURLException.getMessage() %>
</liferay-ui:error>

<liferay-ui:error exception="<%= StorageException.class %>" message="please-enter-a-valid-form-settings" />
<liferay-ui:error exception="<%= StructureDefinitionException.class %>" message="please-enter-a-valid-form-definition" />
<liferay-ui:error exception="<%= StructureLayoutException.class %>" message="please-enter-a-valid-form-layout" />
<liferay-ui:error exception="<%= StructureNameException.class %>" message="please-enter-a-valid-form-name" />