<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE form-validation PUBLIC 
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN" 
    "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">

<form-validation>
	<global>
		<constant>
			<constant-name>validFileExtFormat</constant-name>
			<constant-value>bmp,gif,jpg,jpeg,png,xls,xlsx,hwp,pdf,txt</constant-value>
		</constant>
		<constant>
			<constant-name>validImgExtFormat</constant-name>
			<constant-value>bmp,gif,jpg,jpeg,png</constant-value>
		</constant>
		<constant>
			<constant-name>idCheckRegex</constant-name>
			<constant-value>^[a-zA-Z]{1}[a-zA-Z0-9_]{4,11}$</constant-value>
		</constant>
		<constant>
			<constant-name>telRegex</constant-name>
			<constant-value>^\d{2,3}-\d{3,4}-\d{4}$</constant-value>
		</constant>
		<constant>
			<constant-name>yearRegex</constant-name>
			<constant-value>^\d{4}$</constant-value>
		</constant>
		<!-- 날짜형식 (yyyy-mm-dd) -->
		<constant>
			<constant-name>dateRegex</constant-name>
			<constant-value>^(19[5-9][0-9]|2\d{3})-(0[0-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$</constant-value>
		</constant>
		<constant>
			<constant-name>validFileExtFormatDetail</constant-name>
			<constant-value>bmp,gif,jpg,jpeg,png,xls,xlsx,hwp,pdf,txt</constant-value>
		</constant>
	</global>

    <formset>
        <form name="boardVO">
			<field property="bdSubject" depends="required">
                <arg0 key="board.view.title" />
            </field>
        	<field property="bdContent" depends="required">
        		<arg0 key="board.view.content" />
			</field>
			<field property="file1" depends="fileExt">
				<msg name="fileExt" key="errors.fileext" />
				<arg0 key="${validFileExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validFileExtFormat}</var-value>
		        </var>
			</field>
			<field property="file2" depends="fileExt">
				<msg name="fileExt" key="errors.fileext" />
				<arg0 key="${validFileExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validFileExtFormat}</var-value>
		        </var>
			</field>
			<field property="file3" depends="fileExt">
				<msg name="fileExt" key="errors.fileext" />
				<arg0 key="${validFileExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validFileExtFormat}</var-value>
		        </var>
			</field>
        </form>
    </formset>
    
    <!-- 공지팝업 -->
    <formset>
        <form name="noticeVO">
			<field property="npSubject" depends="required">
                <arg0 key="board.view.title" />
            </field>
        	<field property="npText" depends="required">
        		<arg0 key="board.view.content" />
			</field>
			<field property="npWidth" depends="required">
        		<arg0 key="notice.width" />
			</field>
			<field property="npHeight" depends="required">
        		<arg0 key="notice.height" />
			</field>
			<field property="npStart" depends="required">
        		<arg0 key="notice.start" />
			</field>
			<field property="npEnd" depends="required">
        		<arg0 key="notice.end" />
			</field>
			
        </form>
    </formset>

    
	<!-- 견문보고 -->
	<formset>
        <form name="reportVO">
			<field property="inCategory1" depends="required">
				<arg0 key="report.view.category1"/>
			</field>
			<field property="inCategory2" depends="required">
				<arg0 key="report.view.category2"/>
			</field>
			<field property="inSubject" depends="required">
				<arg0 key="board.view.title" />
			</field>
			<field property="inContent" depends="required">
				<arg0 key="board.view.content" />
			</field>
			<field property="strInfodate" depends="required">
				<arg0 key="report.view.infodate" />
			</field>
			<field property="fileObj1" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="board.view.attach" />
				<arg1 key="${validFileExtFormatDetail}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validFileExtFormatDetail}</var-value>
		        </var>
			</field>
			<field property="fileObj2" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="board.view.attach" />
				<arg1 key="${validFileExtFormatDetail}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validFileExtFormatDetail}</var-value>
		        </var>
			</field>
			<field property="fileObj3" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="board.view.attach" />
				<arg1 key="${validFileExtFormatDetail}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validFileExtFormatDetail}</var-value>
		        </var>
			</field>
        </form>	
    </formset>

</form-validation>