﻿<?xml version="1.0" encoding="utf-8" ?>
<!-- Spring Manged Objects -->
<objects xmlns="http://www.springframework.net"
			xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
			xmlns:v="http://www.springframework.net/validation"
			xsi:schemaLocation="http://www.springframework.net http://www.springframework.net/xsd/spring-objects.xsd
									  http://www.springframework.net Xsd/spring-validation-1.3.xsd">

  <description>
	 Spring Validation
	 See this for more info:
	 http://www.springframework.net/doc-latest/reference/html/validation.html
  </description>


  <v:group id="releasePointValidationRules">
	 <!-- RELEASE POINT -->
	 <v:ref name="rpReleasePointValidationRules" context="CurrentReleasePoint" />
	 <v:ref name="rpReleasePointLocationValidationRules" context="CurrentReleasePoint" />

	 <!-- CUSTOM -->
	 <v:group id="AgencyCustomFields" when="#this.CurrentReleasePoint is T(Sleis.Models.AgencyReleasePoint)">
		<v:ref name ="agencyCustomFieldValidator" context="CustomFields" />
	 </v:group>

	 <v:group id="PublicCustomFields" when="#this.CurrentReleasePoint is T(Sleis.Models.PublicReleasePoint)">
		<v:ref name ="publicCustomFieldValidator" context="CustomFields" />
	 </v:group>
  </v:group>


  <!-- RELEASE POINT -->
  <v:group id="rpReleasePointValidationRules">
	 <v:required test="Identifier">
		<v:message id="valid.rp.id.required" providers="CurrentReleasePoint.Identifier">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 <v:regex test="Identifier" expression=".{1,20}" when="Identifier != null">
		<v:message id="valid.rp.id.length" providers="CurrentReleasePoint.Identifier">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:regex>

	 <v:required test="TypeCode">
		<v:message id="valid.rp.type.required" providers="CurrentReleasePoint.TypeCode">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>

	 <v:required test="Description" when="#this is T(Sleis.Models.PublicReleasePoint)">
		<v:message id="valid.rp.desc.required" providers="CurrentReleasePoint.Description" >
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 <v:regex test="Description" expression=".{0,100}" when="Description != null">
		<v:message id="valid.rp.desc.length" providers="CurrentReleasePoint.Description">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:regex>

	 <v:required test="StatusCode">
		<v:message id="valid.rp.status.required" providers="CurrentReleasePoint.StatusCode">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>

	 <v:required test="StatusAsOfDate" when="StatusCode != 'OP'">
		<v:message id="valid.rp.statusasofdate.required" providers="CurrentReleasePoint.StatusAsOfDate">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>

	 <!--
	 <v:required test="Comment">
		<v:message id="valid.rp.comment.required" providers="CurrentReleasePoint.Comment">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 -->
	 <v:regex test="Comment" expression="^[\s\S]{0,4000}$" when="Comment != null">
		<v:message id="valid.rp.comment.length" providers="CurrentReleasePoint.Comment">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:regex>

	 <!--STACK-->
	 <v:condition test="StackHeightMeasurement != null" when="(#this is T(Sleis.Models.PublicReleasePoint)) and (TypeCode != '1')">
		<v:message id="valid.rp.stackheight.when" providers="CurrentReleasePoint.StackHeightMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 <v:validator id="releasePointStackHeightMeasurementValidator" test="StackHeightMeasurement.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="(StackHeightMeasurement != null) and (TypeCode != '1')">
		<v:property name="PrecisionFormat" value="6,1" />
		<v:message id="valid.rp.stackheightmeasurement.format" providers="CurrentReleasePoint.StackHeightMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <v:condition test ="StackHeightMeasurement &gt;= 1 and StackHeightMeasurement &lt;= 1300" when="(StackHeightMeasurement != null) and (TypeCode != '1')">
		<v:message id="valid.rp.stackheight.range" providers="CurrentReleasePoint.StackHeightMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>

	 <v:condition test="StackDiameterMeasurement != null" when="(#this is T(Sleis.Models.PublicReleasePoint)) and (TypeCode != '1')">
		<v:message id="valid.rp.stack.diameter.when" providers="CurrentReleasePoint.StackDiameterMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 <v:validator id="releasePointStackDiameterMeasurementValidator" test="StackDiameterMeasurement.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="(StackDiameterMeasurement != null) and (TypeCode != '1')">
		<v:property name="PrecisionFormat" value="6,2" />
		<v:message id="valid.rp.stackdiametermeasurement.format" providers="CurrentReleasePoint.StackDiameterMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <v:condition test ="StackDiameterMeasurement &gt;= .1 and StackDiameterMeasurement &lt;= 100" when="(StackDiameterMeasurement != null) and (TypeCode != '1')">
		<v:message id="valid.rp.stack.diameter.range" providers="CurrentReleasePoint.StackDiameterMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>

	 <v:condition test="GasTemp != null" when="(#this is T(Sleis.Models.PublicReleasePoint)) and (TypeCode != '1')">
		<v:message id="valid.rp.gastemp.required" providers="CurrentReleasePoint.GasTemp">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 <v:validator id="releasePointGastTempValidator" test="GasTemp.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="(GasTemp != null) and (TypeCode != '1')">
		<v:property name="PrecisionFormat" value="4,0" />
		<v:message id="valid.rp.gastemp.format" providers="CurrentReleasePoint.GasTemp">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <v:condition test ="GasTemp &gt;= -30 and GasTemp &lt;= 4000" when="(GasTemp != null) and (TypeCode != '1')">
		<v:message id="valid.rp.gastemp.range" providers="CurrentReleasePoint.GasTemp">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>

	 <v:validator test="GasFlowRate" type="Sleis.Validation.Spring.NullableDecimalValidator" when="(#this is T(Sleis.Models.PublicReleasePoint)) and (TypeCode != '1')">
		<v:property name="MessageId" value="valid.rp.gasflowrate.required"/>
		<v:property name="Provider" value="CurrentReleasePoint.GasFlowRate"/>
	 </v:validator>
	 <v:validator id="releasePointGasFlowRate" test="GasFlowRate.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="(GasFlowRate != null) and (TypeCode != '1')">
		<v:property name="PrecisionFormat" value="18,5" />
		<v:message id="valid.rp.gasflowrate.format" providers="CurrentReleasePoint.GasFlowRate">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <!-- ADEQ GasFlowRate acfs max = 2,000,000 -->
	 <v:condition test ="GasFlowRate &gt;= 0 and GasFlowRate &lt;= 2000000" when="GasFlowRate != null and GasFlowRateUomCode != null and GasFlowRateUomCode == 'ACFS' and TypeCode != '1'">
		<v:message id="valid.rp.gasflowrate.range.acfs" providers="CurrentReleasePoint.GasFlowRate">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 <!-- ADEQ GasFlowRate acfm max = 120,000,000 -->
	 <v:condition test ="GasFlowRate &gt;= 0 and GasFlowRate &lt;= 120000000" when="GasFlowRate != null and GasFlowRateUomCode != null and GasFlowRateUomCode == 'ACFM' and TypeCode != '1'">
		<v:message id="valid.rp.gasflowrate.range.acfm" providers="CurrentReleasePoint.GasFlowRate">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>

	 <v:required test="GasFlowRateUomCode" when="(#this is T(Sleis.Models.PublicReleasePoint)) and (TypeCode != '1')">
		<v:message id="valid.rp.gasflowrateuomcode.required" providers="CurrentReleasePoint.GasFlowRateUomCode">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 <!-- Note: Regardless of optionality of GasFlowRate, GasFlowRateUomCode is required if GasVel value is provided and vice versa-->
	 <v:validator test="GasFlowRate" type="Sleis.Validation.Spring.NullableDecimalValidator" when="TypeCode != '1' and GasFlowRateUomCode != null">
		<v:property name="MessageId" value="valid.rp.gasflowrate.required.when"/>
		<v:property name="Provider" value="CurrentReleasePoint.GasFlowRate"/>
	 </v:validator>
	 <v:required test="GasFlowRateUomCode" when="TypeCode != '1' and GasFlowRate != null">
		<v:message id="valid.rp.gasflowrateuomcode.required.when" providers="CurrentReleasePoint.GasFlowRateUomCode">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>

	 <v:validator test="GasVel" type="Sleis.Validation.Spring.NullableDecimalValidator" when="(#this is T(Sleis.Models.PublicReleasePoint)) and (TypeCode != '1')">
		<v:property name="MessageId" value="valid.rp.gasvel.required"/>
		<v:property name="Provider" value="CurrentReleasePoint.GasVel"/>
	 </v:validator>
	 <v:validator id="releasePointGasVel" test="GasVel.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="GasVel != null and TypeCode != '1'">
		<v:property name="PrecisionFormat" value="18,5" />
		<v:message id="valid.rp.gasvel.format" providers="CurrentReleasePoint.GasVel">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <!-- ADEQ GasVel fps = 1200 -->
	 <v:condition test ="GasVel &gt;= 0 and GasVel &lt;= 1200" when="GasVel != null and GasVelUomCode != null and GasVelUomCode == 'FPS' and TypeCode != '1'">
		<v:message id="valid.rp.gasvel.range.fps" providers="CurrentReleasePoint.GasVel">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 <v:condition test ="GasVel &gt;= 0 and GasVel &lt;= 36000" when="GasVel != null and GasVelUomCode != null and GasVelUomCode == 'FPM' and TypeCode != '1'">
		<v:message id="valid.rp.gasvel.range.fpm" providers="CurrentReleasePoint.GasVel">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>

	 <v:required test="GasVelUomCode" when="(#this is T(Sleis.Models.PublicReleasePoint)) and (TypeCode != '1')">
		<v:message id="valid.rp.gasveluomcode.required" providers="CurrentReleasePoint.GasVelUomCode">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 <!-- Note: Regardless of optionality of GasVel, GasVelUomCode is required if GasVel value is provided and vice versa-->
	 <v:validator test="GasVel" type="Sleis.Validation.Spring.NullableDecimalValidator" when="TypeCode != '1' and GasVelUomCode != null">
		<v:property name="MessageId" value="valid.rp.gasvel.required.when"/>
		<v:property name="Provider" value="CurrentReleasePoint.GasVel"/>
	 </v:validator>
	 <v:required test="GasVelUomCode" when="TypeCode != '1' and GasVel != null">
		<v:message id="valid.rp.gasveluomcode.required.when" providers="CurrentReleasePoint.GasVelUomCode">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>

	 <!--
	 EXIT GAS FLOW RATE AND VELOCITY VALIDATION
	 
	 Equations
	 Exit Gas Velocity (calculated in FPM)
	 Stack Area = Pi * (stack diameter / 2) * (stack diameter / 2)
	 Velocity = (exit gas flow rate in ACFM) / (stack area)

	 Exit Gas Flow Rate (calculated in ACFM)
	 Flow Rate = Pi *(stack Diameter / 2) * (stack diameter / 2) * (velocity in FPM)

	 Using the calculations check if within +/- 5% of what the entered value is on the page.

	 If both values are entered and the time basis (the unit of measure can be either in minutes or seconds) 
	 does NOT match, the values should be normalized to either ACFM/FPM or ACFS/FPS
	 -->
	 <v:condition test ="((GasVel * .9500) &lt;= (GasFlowRate / (3.141592653589793  * (StackDiameterMeasurement/2) * (StackDiameterMeasurement/2)))) and ((GasVel * 1.0500) &gt;= (GasFlowRate /  (3.141592653589793  * (StackDiameterMeasurement/2) * (StackDiameterMeasurement/2))))" when="TypeCode != '1' and GasFlowRateUomCode == 'ACFM' and GasVelUomCode == 'FPM' and GasFlowRate != null and GasVel != null and StackDiameterMeasurement != null">
		<v:message id="valid.rp.gasval.gasflow.range" providers="CurrentReleasePoint.GasVel, CurrentReleasePoint.GasFlowRate, CurrentReleasePoint.StackDiameterMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 <v:condition test ="((GasVel * .9500) &lt;= (GasFlowRate / (3.141592653589793  * (StackDiameterMeasurement/2) * (StackDiameterMeasurement/2))))  and ((GasVel * 1.0500) &gt;= (GasFlowRate /  (3.141592653589793  * (StackDiameterMeasurement/2) * (StackDiameterMeasurement/2))))" when="TypeCode != '1' and GasFlowRateUomCode == 'ACFS' and GasVelUomCode == 'FPS' and GasFlowRate != null and GasVel != null and StackDiameterMeasurement != null ">
		<v:message id="valid.rp.gasval.gasflow.range" providers="CurrentReleasePoint.GasVel, CurrentReleasePoint.GasFlowRate, CurrentReleasePoint.StackDiameterMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 <v:condition test ="(((GasVel / 60) * .9500) &lt;= (GasFlowRate / (3.141592653589793  * (StackDiameterMeasurement/2) * (StackDiameterMeasurement/2))))  and (((GasVel / 60) * 1.0500) &gt;= (GasFlowRate /  (3.141592653589793  * (StackDiameterMeasurement/2) * (StackDiameterMeasurement/2))))" when="TypeCode != '1' and GasFlowRateUomCode == 'ACFS' and GasVelUomCode == 'FPM' and GasFlowRate != null and GasVel != null and StackDiameterMeasurement != null">
		<v:message id="valid.rp.gasval.gasflow.range" providers="CurrentReleasePoint.GasVel, CurrentReleasePoint.GasFlowRate, CurrentReleasePoint.StackDiameterMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 <v:condition test ="(GasVel * .9500) &lt;= (GasFlowRate / (3.141592653589793  * (StackDiameterMeasurement/2) * (StackDiameterMeasurement/2))) / 60  and (GasVel * 1.0500) &gt;= (GasFlowRate /  (3.141592653589793  * (StackDiameterMeasurement/2) * (StackDiameterMeasurement/2))) / 60" when="TypeCode != '1' and GasFlowRateUomCode == 'ACFM' and GasVelUomCode == 'FPS' and GasFlowRate != null and GasVel != null and StackDiameterMeasurement != null">
		<v:message id="valid.rp.gasval.gasflow.range" providers="CurrentReleasePoint.GasVel, CurrentReleasePoint.GasFlowRate, CurrentReleasePoint.StackDiameterMeasurement">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>

	 <!--
	 <v:validator test="FenceLineDistance" type="Sleis.Validation.Spring.NullableDecimalValidator" when="TypeCode != '1'">
		<v:property name="MessageId" value="valid.rp.fencelinedistance.required"/>
		<v:property name="Provider" value="CurrentReleasePoint.FenceLineDistance"/>
	 </v:validator>
	 -->
	 <v:validator id="releasePointFenceLineDistanceValidator" test="FenceLineDistance.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="FenceLineDistance != null and TypeCode != '1'">
		<v:property name="PrecisionFormat" value="5,0" />
		<v:message id="valid.rp.fencelinedistance.format" providers="CurrentReleasePoint.FenceLineDistance">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <v:condition test ="FenceLineDistance &gt;= 0 and FenceLineDistance &lt;= 99999" when="FenceLineDistance != null and TypeCode != '1'">
		<v:message id="valid.rp.fencelinedistance.range" providers="CurrentReleasePoint.FenceLineDistance">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 <!--/STACK-->


	 <!--FUGITIVE-->
	 <!--
	 <v:condition test="FugitiveHeight != null" when="TypeCode == '1'">
		<v:message id="valid.rp.fugitive.height.when" providers="CurrentReleasePoint.FugitiveHeight">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 -->
	 <v:validator id="releasePointFugitiveHeightValidator" test="FugitiveHeight.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="FugitiveHeight != null and TypeCode == '1'">
		<v:property name="PrecisionFormat" value="3,0" />
		<v:message id="valid.rp.fugitive.height.format" providers="CurrentReleasePoint.FugitiveHeight">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <v:condition test ="FugitiveHeight &gt;= 0 and FugitiveHeight &lt;= 500" when="FugitiveHeight != null and TypeCode == '1'">
		<v:message id="valid.rp.fugitive.height.range" providers="CurrentReleasePoint.FugitiveHeight">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>

	 <!--
	 <v:condition test="FugitiveWidth != null" when="TypeCode == '1'">
		<v:message id="valid.rp.fugitive.width.when" providers="CurrentReleasePoint.FugitiveWidth">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 -->
	 <v:validator id="releasePointFugitiveWidthValidator" test="FugitiveWidth.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="FugitiveWidth != null and TypeCode == '1'">
		<v:property name="PrecisionFormat" value="6,0" />
		<v:message id="valid.rp.fugitive.width.format" providers="CurrentReleasePoint.FugitiveWidth">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <v:condition test ="FugitiveWidth &gt;= 1 and FugitiveWidth &lt;= 10000" when="FugitiveWidth != null and TypeCode == '1'">
		<v:message id="valid.rp.fugitive.width.range" providers="CurrentReleasePoint.FugitiveWidth">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>

	 <!--
	 <v:condition test="FugitiveLength != null" when="TypeCode == '1'">
		<v:message id="valid.rp.fugitive.length.when" providers="CurrentReleasePoint.FugitiveLength">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 -->
	 <v:validator id="releasePointFugitiveLengthValidator" test="FugitiveLength.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="FugitiveLength != null and TypeCode == '1'">
		<v:property name="PrecisionFormat" value="6,0" />
		<v:message id="valid.rp.fugitive.length.format" providers="CurrentReleasePoint.FugitiveLength">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <v:condition test ="FugitiveLength &gt;= 1 and FugitiveLength &lt;= 10000" when="FugitiveLength != null and TypeCode == '1'">
		<v:message id="valid.rp.fugitive.length.range" providers="CurrentReleasePoint.FugitiveLength">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>

	 <!--
	 <v:condition test="FugitiveAngle != null" when="TypeCode == '1'">
		<v:message id="valid.rp.fugitive.angle.when" providers="CurrentReleasePoint.FugitiveAngle">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>
	 -->
	 <v:validator id="releasePointFugitiveAngleValidator" test="FugitiveAngle.ToString()" type="Sleis.Validation.Spring.DecimalValidator" when="FugitiveAngle != null and TypeCode == '1'">
		<v:property name="PrecisionFormat" value="3,0" />
		<v:message id="valid.rp.fugitive.angle.format" providers="CurrentReleasePoint.FugitiveAngle">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:validator>
	 <v:condition test ="FugitiveAngle &gt;= 0 and FugitiveAngle &lt;= 179" when="FugitiveAngle != null and TypeCode == '1'">
		<v:message id="valid.rp.fugitive.angle.range" providers="CurrentReleasePoint.FugitiveAngle">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:condition>


	 <!-- Needed in case migration resulted in no Location related fields, thus making the object NULL -->
	 <v:required test="Location" when="UsesFacilitySiteLocation != true">
		<v:message id="valid.rp.loc.required" providers="CurrentReleasePoint.Location">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
  </v:group>


  <!--RELEASE POINT LOCATION-->
  <v:group id="rpReleasePointLocationValidationRules" when="UsesFacilitySiteLocation != true and Location != null">
	 <v:required test="Location.Latitude" when="#this is T(Sleis.Models.PublicReleasePoint)">
		<v:message id="valid.rp.location.lat.required" providers="CurrentReleasePoint.Location.Latitude">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 <!-- Latitude must be between 17 and 71.5, with minimum of 3 digits past decimal point, and max of 7-->
	 <v:regex test="Location.Latitude"
			 expression="^([1][7-9]|[2-6][0-9]|[7][0-1])\.{1}\d{3,7}$"
			 when="Location.Latitude != null">
		<v:message id="valid.rp.location.lat.format" providers="CurrentReleasePoint.Location.Latitude" >
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:regex>

	 <v:required test="Location.Longitude" when="#this is T(Sleis.Models.PublicReleasePoint)">
		<v:message id="valid.rp.location.lng.required" providers="CurrentReleasePoint.Location.Longitude">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 <!-- Longitude must be between -177 and -64, with minimum of 3 digits past decimal point, and a maximum of 6-->
	 <v:regex test="Location.Longitude"
			 expression="^-([1][7][0-7]|[1][0-6][0-9]|[7-9][0-9]|[6][0-4])\.{1}\d{3,6}$"
			 when="Location.Longitude != null">
		<v:message id="valid.rp.location.lng.format" providers="CurrentReleasePoint.Location.Longitude" >
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:regex>

	 <!-- UTM -->
	 <v:required test="Location.UtmNorth" when="#this is T(Sleis.Models.PublicReleasePoint)">
		<v:message id="valid.rp.location.utm.north.required" providers="CurrentReleasePoint.Location.UtmNorth">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 <v:regex test="Location.UtmNorth"
			  expression="^([0-9]*|\d*\.\d{1}?\d*)$"
			  when="Location.UtmNorth != null">
		<v:message id="valid.rp.location.utm.north.format" providers="CurrentReleasePoint.Location.UtmNorth">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:regex>

	 <v:required test="Location.UtmEast" when="#this is T(Sleis.Models.PublicReleasePoint)">
		<v:message id="valid.rp.location.utm.east.required" providers="CurrentReleasePoint.Location.UtmEast">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 <v:regex test="Location.UtmEast"
			  expression="^([0-9]*|\d*\.\d{1}?\d*)$"
			  when="Location.UtmEast != null">
		<v:message id="valid.rp.location.utm.east.format" providers="CurrentReleasePoint.Location.UtmEast">
		  <v:param value="ValidationContxt"/>
		</v:message>
		<v:property name="AllowPartialMatching" value="true"/>
	 </v:regex>

	 <v:required test="Location.UtmZone" when="#this is T(Sleis.Models.PublicReleasePoint)">
		<v:message id="valid.rp.utmzone.required" providers="CurrentReleasePoint.Location.UtmZone">
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>

	 <!--
	 <v:required test="Location.CollectionMethodCode">
		<v:message id="valid.rp.collectionmethodcode.required" providers="CurrentReleasePoint.Location.CollectionMethodCode" >
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 -->


	 <!--
	 <v:required test="Location.CollectionTime">
		<v:message id="valid.rp.collectiontime.required" providers="CurrentReleasePoint.Location.CollectionTime" >
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 -->

	 <!--
	 <v:required test="Location.ReferencePointCode">
		<v:message id="valid.rp.referencepointcode.required" providers="CurrentReleasePoint.Location.ReferencePointCode" >
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 -->

	 <!--
	 <v:required test="Location.referencesystemcode">
		<v:message id="valid.rp.referencesystemcode.required" providers="CurrentReleasePoint.Location.ReferenceSystemCode" >
		  <v:param value="ValidationContxt"/>
		</v:message>
	 </v:required>
	 -->
  </v:group>

</objects>