<?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</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="subject" depends="required">
                <arg0 key="board.view.title" />
            </field>
        	<field property="content" 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="incidentVO">
			<field property="chargeNm" depends="required">
				<arg0 key="susa.in.view.chargeNm" />
			</field>
			<field property="title" depends="required">
				<arg0 key="susa.in.view.title" />
			</field>
			<field property="sdate" depends="required">
				<arg0 key="susa.in.view.sdate" />
			</field>
			<field property="edate" depends="required">
				<arg0 key="susa.in.view.edate" />
			</field>
			<field property="contents" depends="required">
				<arg0 key="susa.in.view.contents" />
			</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="promotVO">
			<field property="chargeNm" depends="required">
				<arg0 key="susa.pr.view.chargeNm" />
			</field>
			<field property="title" depends="required">
				<arg0 key="susa.pr.view.title" />
			</field>
			<field property="sdate" depends="required">
				<arg0 key="susa.pr.view.sdate" />
			</field>
			<field property="edate" depends="required">
				<arg0 key="susa.in.view.edate" />
			</field>
			<field property="contents" depends="required">
				<arg0 key="susa.pr.view.contents" />
			</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="memberVO">
			<field property="userid" depends="required">
				<arg0 key="member.view.userid" />
			</field>
			<field property="passwd" depends="required">
				<arg0 key="member.view.password" />
			</field>
			<field property="name" depends="required">
				<arg0 key="member.view.name" />
			</field>
			<field property="sdate" depends="mask">
				<msg name="mask" key="errors.invalid" />
				<arg0 key="member.view.sdate" />
		        <var>
		            <var-name>mask</var-name>
		            <var-value>${dateRegex}</var-value>
		        </var>
			</field>
			<field property="pdate" depends="mask">
				<msg name="mask" key="errors.invalid" />
				<arg0 key="member.view.pdate" />
		        <var>
		            <var-name>mask</var-name>
		            <var-value>${dateRegex}</var-value>
		        </var>
			</field>
			<field property="adate" depends="mask">
				<msg name="mask" key="errors.invalid" />
				<arg0 key="member.view.adate" />
		        <var>
		            <var-name>mask</var-name>
		            <var-value>${dateRegex}</var-value>
		        </var>
			</field>
			<!-- <field property="sdate" depends="required">
				<arg0 key="member.view.sdate" />
			</field>
			<field property="pdate" depends="required">
				<arg0 key="member.view.pdate" />
			</field>
			<field property="adate" depends="required">
				<arg0 key="member.view.adate" />
			</field> -->
			<field property="inout" depends="required">
				<arg0 key="member.view.inout" />
			</field>
			<field property="img" depends="fileExt">
				<msg name="fileExt" key="errors.fileext" />
				<arg0 key="${validImgExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validImgExtFormat}</var-value>
		        </var>
			</field>
			<field property="sign" depends="fileExt">
				<msg name="fileExt" key="errors.fileext" />
				<arg0 key="${validImgExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validImgExtFormat}</var-value>
		        </var>
			</field>
		</form>
	</formset>
	
	<formset>
		<form name="exmemberVO">
			<field property="name" depends="required">
				<arg0 key="member.view.name" />
			</field>
			<field property="email" depends="email">
				<arg0 key="member.view.email" />
			</field>
			<field property="sdate" depends="required">
				<arg0 key="member.view.sdate" />
			</field>
			<field property="pdate" depends="required">
				<arg0 key="member.view.pdate" />
			</field>
			<field property="adate" depends="required">
				<arg0 key="member.view.adate" />
			</field>
			<field property="inout" depends="required">
				<arg0 key="member.view.inout" />
			</field>
			<field property="img" depends="fileExt">
				<msg name="fileExt" key="errors.fileext" />
				<arg0 key="${validImgExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validImgExtFormat}</var-value>
		        </var>
			</field>
		</form>
	</formset>
	
	<!-- 외사취약지 -->
	<formset>
		<form name="weakPlaceVO">
			<field property="file1" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="target.wp.filename1" />
				<arg1 key="jpg,gif,bmp" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>jpg,gif,bmp</var-value>
		        </var>
			</field>
			<field property="file2" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="target.wp.filename2" />
				<arg1 key="txt,hwp,xls,pdf" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>txt,hwp,xls,pdf</var-value>
		        </var>
			</field>
		</form>
	</formset>
	
	<!-- 치안대상 -->
	<formset>
		<form name="corpVO">
			<field property="name" depends="required">
                <arg0 key="target.corp.name" />
            </field>
			<field property="tel" depends="mask">
				<msg name="mask" key="errors.invalid" />
				<arg0 key="target.corp.tel" />
		        <var>
		            <var-name>mask</var-name>
		            <var-value>${telRegex}</var-value>
		        </var>
			</field>
			<field property="fax" depends="mask">
				<msg name="mask" key="errors.invalid" />
				<arg0 key="target.corp.fax" />
		        <var>
		            <var-name>mask</var-name>
		            <var-value>${telRegex}</var-value>
		        </var>
			</field>
			<field property="basicYear" depends="mask">
				<msg name="mask" key="errors.year" />
				<arg0 key="target.corp.basicyear" />
		        <var>
		            <var-name>mask</var-name>
		            <var-value>${yearRegex}</var-value>
		        </var>
			</field>
		</form>
	</formset>
	
	<!-- 외사분실운영현황 -->
	<formset>
		<form name="divMngVO">
			<field property="local" depends="required">
                <arg0 key="target.divmng.local" />
            </field>
			<field property="tel" depends="mask">
				<msg name="mask" key="errors.invalid" />
				<arg0 key="target.divmng.tel" />
		        <var>
		            <var-name>mask</var-name>
		            <var-value>${telRegex}</var-value>
		        </var>
			</field>            
            <field property="staffNum" depends="integer">
                <arg0 key="target.divmng.staffNum" />
            </field>
			<field property="fileImgObj" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="target.divmng.fileImg" />
				<arg1 key="${validImgExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validImgExtFormat}</var-value>
		        </var>
			</field>
			<field property="file1obj" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="target.divmng.file" />
				<arg1 key="${validFileExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validFileExtFormat}</var-value>
		        </var>
			</field>
			<field property="file2obj" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="target.divmng.file" />
				<arg1 key="${validFileExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validFileExtFormat}</var-value>
		        </var>
			</field>
			<field property="file3obj" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="target.divmng.file" />
				<arg1 key="${validFileExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validFileExtFormat}</var-value>
		        </var>
			</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="inCategory3" depends="required">
				<arg0 key="report.view.category3"/>
			</field>
			<field property="inCategory4" depends="required">
				<arg0 key="report.view.category4"/>
			</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>
			<field property="fileObj4" 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="fileObj5" 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>

	<!-- 국제여객선 -->
	<formset>
		<form name="ferryVO">
			<field property="ferryName" depends="required">
                <arg0 key="target.ferry.name" />
            </field>
            <field property="tel" depends="mask">
				<msg name="mask" key="errors.invalid" />
				<arg0 key="target.ferry.tel" />
		        <var>
		            <var-name>mask</var-name>
		            <var-value>${telRegex}</var-value>
		        </var>
			</field>
            <field property="ferryGuestCnt" depends="integer">
                <arg0 key="target.ferry.guestCnt" />
            </field>
            <field property="ferryClueCnt" depends="integer">
                <arg0 key="target.ferry.clueCnt" />
            </field>
            <field property="runCnt" depends="maxlength">
                <arg0 key="target.ferry.runCnt" />
                <arg1 key="1" />
               	<var>
		            <var-name>maxlength</var-name>
		            <var-value>1</var-value>
		        </var>
            </field>
			<field property="imgFileObj" depends="fileExt">
				<msg name="fileExt" key="errors.fileext2" />
				<arg0 key="target.ferry.imgFile" />
				<arg1 key="${validImgExtFormat}" />
		        <var>
		            <var-name>ext</var-name>
		            <var-value>${validImgExtFormat}</var-value>
		        </var>
			</field>
			<field property="sailingDate" depends="mask">
				<msg name="mask" key="errors.invalid" />
				<arg0 key="target.ferry.sailingDate" />
		        <var>
		            <var-name>mask</var-name>
		            <var-value>${dateRegex}</var-value>
		        </var>
			</field>
		</form>
	</formset>

	<!-- 교육현황 -->
	<formset>
		<form name="eduVO">
			<field property="name" depends="required">
                <arg0 key="fa.edu.name" />
            </field>
			<field property="stdate" depends="required">
                <arg0 key="fa.edu.stdate" />
            </field>
            <field property="eddate" depends="required">
                <arg0 key="fa.edu.eddate" />
            </field>
            <field property="eduCourse" depends="required">
                <arg0 key="fa.edu.eduCourse" />
            </field>
			<field property="eduPlace" depends="required">
                <arg0 key="fa.edu.eduPlace" />
            </field>
            <field property="place1" depends="required">
                <arg0 key="fa.edu.place1" />
            </field>
		</form>
	</formset>
	
	<!--  -->
	<formset>
		<form name="arrestVO">
			<field property="arrestDate" depends="required">
				<arg0 key="arrest.arrestDate" />
			</field>
			<field property="addrArea" depends="required">
				<arg0 key="arrest.addrArea" />
			</field>
			<field property="addrCity" depends="required">
				<arg0 key="arrest.addrCity" />
			</field>
			<field property="violateType" depends="required">
				<arg0 key="arrest.violateType" />
			</field>
			<field property="invasionType" depends="required">
				<arg0 key="arrest.invasionType" />
			</field>
			<field property="shipType" depends="required">
				<arg0 key="arrest.shipType" />
			</field>
			<field property="agencyType" depends="required">
				<arg0 key="arrest.agencyType" />
			</field>
			
			<field property="invasionType" depends="required">
				<arg0 key="arrest.agencyVessel" />
			</field>
			<field property="shipName" depends="required">
				<arg0 key="arrest.shipName" />
			</field>
			<field property="capName" depends="required">
				<arg0 key="arrest.capName" />
			</field>			
			<field property="procCondition" depends="required">
				<arg0 key="arrest.procCondition" />
			</field>
			<field property="shipProcType" depends="required">
				<arg0 key="arrest.shipProcType" />
			</field>			
		</form>		
	</formset>
	<!-- 20180530 국제어선 단속시스템 관련 꼭 적어야 하는 항목들 -->
	<formset>
		<form name="internationalVO">
			<field property="arrestDate" depends="required">
				<arg0 key="interArrest.arrestDate" />
			</field>
			<field property="fieldArrestDate" depends="required">
				<arg0 key="interArrest.fieldArrestDate" />
			</field>
			
			<field property="violateType" depends="required">
				<arg0 key="interArrest.violateType" />
			</field>
			<field property="violateDetail" depends="required">
				<arg0 key="interArrest.Placeofarrest" />
			</field>
			<field property="marginPaymentYn" depends="required">
				<arg0 key="interArrest.marginPayment" />
			</field>
			<!-- <field property="shipName" depends="required">
				<arg0 key="interArrest.shipData" />
			</field> -->
			<!-- <field property="custopmSelect" depends="required">
				<arg0 key="arrest.shipType" />
			</field> -->
			<field property="addrArea" depends="required">
				<arg0 key="interArrest.violatePlace" />
			</field>
			<!-- <field property="woDetentionType" depends="required">
				<arg0 key="arrest.woDetentionType" />
			</field> -->
			
			<!-- <field property="addrArea" depends="required">
				<arg0 key="arrest.addrArea" />
			</field> -->
			<!-- <field property="addrCity" depends="required">
				<arg0 key="arrest.addrCity" />
			</field> -->
			<!-- <field property="invasionType" depends="required">
				<arg0 key="arrest.invasionType" />
			</field> -->
			<!-- <field property="shipType" depends="required">
				<arg0 key="arrest.shipType" />
			</field> -->
			<field property="agencyType" depends="required">
				<arg0 key="arrest.agencyType" />
			</field>
			
			<!-- <field property="invasionType" depends="required">
				<arg0 key="arrest.agencyVessel" />
			</field> -->
			<!-- <field property="shipName" depends="required">
				<arg0 key="arrest.shipName" />
			</field> -->
			<!-- <field property="capName" depends="required">
				<arg0 key="arrest.capName" />
			</field>	 -->		
			<field property="procCondition" depends="required">
				<arg0 key="arrest.procCondition" />
			</field>
			<field property="shipProcType" depends="required">
				<arg0 key="arrest.shipProcType" />
			</field>			
		</form>		
	</formset>
	<formset>
		<form name="equipVO">
			<field property="police" depends="required">
				<arg0 key="equip.police" />
			</field>
			<field property="equipType" depends="required">
				<arg0 key="equip.equipType" />
			</field>
			<field property="equipName" depends="required">
				<arg0 key="equip.equipName" />
			</field>
			<field property="buyDate" depends="required">
				<arg0 key="equip.buyDate" />
			</field>
			<field property="useTerm" depends="required">
				<arg0 key="equip.useTerm" />
			</field>								
		</form>
	</formset>

</form-validation>