<?xml version="1.0" encoding="UTF-8"?>
<!-- Definition of new Model -->
<model name="pack:packmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
	<!-- Optional meta-data about the model -->
	<description>pack Model</description>
	<author>QUERE</author>
	<version>1.0</version>
	<!-- Imports are required to allow references to definitions in other models -->
	<imports>
		<!-- Import Alfresco Dictionary Definitions -->
		<import uri="http://www.alfresco.org/model/dictionary/1.0"
			prefix="d" />
		<!-- Import Alfresco Content Domain Model Definitions -->
		<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
		<import uri="http://www.bcpg.fr/model/becpg/1.0" prefix="bcpg" />
	</imports>
	<!-- Introduction of new namespaces defined by this model -->
	<namespaces>
		<namespace uri="http://www.bcpg.fr/model/pack/1.0" prefix="pack" />
	</namespaces>

	<constraints>
	
		<constraint name="pack:pmPrintTypes"
			type="fr.becpg.repo.dictionary.constraint.DynListConstraint">
			<parameter name="path">
				<list>
					<value>/System/Lists/bcpg:entityLists/pmPrintTypes</value>
				</list>
			</parameter>
			<parameter name="addEmptyValue">
				<value>true</value>
			</parameter>
			<parameter name="constraintType">
				<value>bcpg:listValue</value>
			</parameter>
			<parameter name="constraintProp">
				<value>bcpg:lvValue</value>
			</parameter>
		</constraint>

		<constraint name="pack:pmPrintVarnishs"
			type="fr.becpg.repo.dictionary.constraint.DynListConstraint">
			<parameter name="path">
				<list>
					<value>/System/Lists/bcpg:entityLists/pmPrintVarnishs</value>
				</list>
			</parameter>
			<parameter name="addEmptyValue">
				<value>true</value>
			</parameter>
			<parameter name="constraintType">
				<value>bcpg:listValue</value>
			</parameter>
			<parameter name="constraintProp">
				<value>bcpg:lvValue</value>
			</parameter>
		</constraint>

		<constraint name="pack:tareUnits" type="LIST">
			<parameter name="allowedValues">
				<list>
					<value>g</value>
					<value>kg</value>
					<value>oz</value>
					<value>lb</value>
				</list>
			</parameter>
			<parameter name="caseSensitive">
				<value>true</value>
			</parameter>
		</constraint>
		<constraint name="pack:labelingPositions"
			type="fr.becpg.repo.dictionary.constraint.DynListConstraint">
			<parameter name="path">
				<list>
					<value>/System/Lists/bcpg:entityLists/LabelingPositions</value>
				</list>
			</parameter>
			<parameter name="constraintType">
				<value>bcpg:listValue</value>
			</parameter>
			<parameter name="constraintProp">
				<value>bcpg:lvValue</value>
			</parameter>
		</constraint>
		<constraint name="pack:labelingTypes"
			type="fr.becpg.repo.dictionary.constraint.DynListConstraint">
			<parameter name="path">
				<list>
					<value>/System/Lists/bcpg:entityLists/LabelingTypes</value>
				</list>
			</parameter>
			<parameter name="constraintType">
				<value>bcpg:listValue</value>
			</parameter>
			<parameter name="constraintProp">
				<value>bcpg:lvValue</value>
			</parameter>
		</constraint>
		<constraint name="pack:labelTypes"
			type="fr.becpg.repo.dictionary.constraint.DynListConstraint">
			<parameter name="path">
				<list>
					<value>/System/Lists/bcpg:entityLists/LabelTypes</value>
				</list>
			</parameter>
			<parameter name="constraintType">
				<value>bcpg:listValue</value>
			</parameter>
			<parameter name="constraintProp">
				<value>bcpg:lvValue</value>
			</parameter>
		</constraint>
	</constraints>

	<types>
		<type name="pack:labelingTemplate">
			<parent>bcpg:entityListItem</parent>
			<mandatory-aspects>
				<aspect>bcpg:isDeletedAspect</aspect>
			</mandatory-aspects>
		</type>
      
      
      
		<type name="pack:label">
			<parent>bcpg:entityListItem</parent>
			<properties>
				<property name="pack:labelType">
					<type>d:text</type>
					<constraints>
						<constraint ref="pack:labelTypes" />
					</constraints>
				</property>
			</properties>
			<mandatory-aspects>
				<aspect>bcpg:isDeletedAspect</aspect>
			</mandatory-aspects>
		</type>




		<type name="pack:labelingList">
			<parent>bcpg:productListItem</parent>
			<properties>
				<property name="pack:llType">
					<type>d:text</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>false</facetable>
					 </index>
					<constraints>
						<constraint ref="pack:labelTypes" />
					</constraints>
				</property>
				<property name="pack:llPosition">
					<type>d:text</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>false</facetable>
					 </index>
					<constraints>
						<constraint ref="pack:labelingPositions" />
					</constraints>
				</property>
			</properties>
			<associations>
				<association name="pack:llLabel">
					<source>
						<mandatory>false</mandatory>
						<many>true</many>
					</source>
					<target>
						<class>pack:label</class>
						<mandatory>false</mandatory>
						<many>false</many>
					</target>
				</association>
			</associations>
			<mandatory-aspects>
				<aspect>bcpg:sortableListAspect</aspect>
			</mandatory-aspects>
		</type>
		
		
      <type name="pack:packMaterialList">
			<parent>bcpg:productListItem</parent>
			<properties>
			    <property name="pack:pmlPerc">
					<type>d:double</type>
					<index enabled="false"/>
				</property>
				<property name="pack:pmlWeight">
					<type>d:double</type>
					<index enabled="false"/>
				</property>
				<property name="pack:pmlRecycledPercentage">
					<type>d:double</type>
					<index enabled="false"/>
				</property>
				<property name="pack:pmlLevel">
					<type>d:text</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>false</facetable>
					 </index>
					<constraints>
						<constraint ref="bcpg:packagingLevel" />
					</constraints>
				</property>
			</properties>
			
			<associations>
				<association name="pack:pmlMaterial">
					<source>
						<mandatory>false</mandatory>
						<many>true</many>
					</source>
					<target>
						<class>pack:packMaterial</class>
						<mandatory>true</mandatory>
						<many>false</many>
					</target>
				</association>
			</associations>
			<mandatory-aspects>
				<aspect>bcpg:sortableListAspect</aspect>
			</mandatory-aspects>
	</type>

	<type name="pack:packMaterial">
		<parent>bcpg:listValue</parent>
		<properties>
			<property name="pack:pmIsNotRecyclable">
				<type>d:boolean</type>
				<index enabled="false" />
			</property>
			<property name="pack:pmEcoTaxeCategory">
				<type>d:text</type>
				<index enabled="false" />
			</property>
			<property name="pack:pmEcoScore">
				<type>d:int</type>
				<index enabled="false" />
			</property>
		</properties>
	</type>
	
		
	</types>
	

	<aspects>


		<!-- pallet -->
		<aspect name="pack:palletAspect">
			<title>Palettisation</title>
			<properties>
				<property name="pack:palletProductsPerBox">
					<title>Nombre de produits / colis</title>
					<type>d:int</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:palletLayers">
					<title>Nombre de couches / palette</title>
					<type>d:int</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:palletBoxesPerLayer">
					<title>Nombre d'emb / couche</title>
					<type>d:int</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:palletBoxesPerLastLayer">
					<title>Nombre d'emb / dernière couche</title>
					<type>d:int</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:palletBoxesPerPallet">
					<title>Nombre d'emb / palette</title>
					<type>d:int</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:palletHeight">
					<title>Hauteur palette (mm)</title>
					<type>d:double</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:palletNumberOnGround">
					<title>Stacking capacity</title>
					<type>d:int</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:palletStackingMaxWeight">
					<title>Pallet stacking max weight</title>
					<type>d:double</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
			</properties>
		</aspect>


		<aspect name="pack:tareAspect">
			<title>Emballage - Tare</title>
			<properties>
				<property name="pack:tare">
					<title>Tare</title>
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:tareUnit">
					<title>Unité de tare</title>
					<type>d:text</type>
					<mandatory>true</mandatory>
					<default>g</default>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
					<constraints>
						<constraint ref="pack:tareUnits" />
					</constraints>
				</property>
			</properties>
			<associations />
			<overrides />
			<mandatory-aspects />
		</aspect>


		<aspect name="pack:sizeAspect">
			<properties>
				<property name="pack:length">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:width">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:height">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
			</properties>
		</aspect>

		<aspect name="pack:labelingAspect">
			<properties>
				<property name="pack:labelingPosition">
					<type>d:text</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
					<constraints>
						<constraint ref="pack:labelingPositions" />
					</constraints>
				</property>
				<property name="pack:labelingType">
					<type>d:text</type>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
					<constraints>
						<constraint ref="pack:labelingTypes" />
					</constraints>
				</property>
			</properties>
			<associations>
				<association name="pack:labelingLabelingTemplate">
					<source>
						<mandatory>false</mandatory>
						<many>true</many>
					</source>
					<target>
						<class>pack:labelingTemplate</class>
						<mandatory>false</mandatory>
						<many>false</many>
					</target>
				</association>
			</associations>
		</aspect>

		<aspect name="pack:pmThicknessAspect">
			<properties>
				<property name="pack:pmThickness">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:pmPaperWeight">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
			</properties>
		</aspect>
		<aspect name="pack:pmMaterialAspect">
			<properties>
				<property name="pack:pmAdditionnalMaterial">
					<type>d:text</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>both</tokenised>
						<facetable>false</facetable>
					 </index>
				</property>
			</properties>
			<associations>
					<association name="pack:pmMaterialRefs">
						<source>
							<mandatory>false</mandatory>
							<many>true</many>
						</source>
						<target>
							<class>pack:packMaterial</class>
							<mandatory>false</mandatory>
							<many>true</many>
						</target>
					</association>
			</associations>
		</aspect>
		
		
		<aspect name="pack:pmIntSizeAspect">
			<properties>
				<property name="pack:pmIntLength">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:pmIntWidth">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:pmIntHeight">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
			</properties>
		</aspect>

		<aspect name="pack:pmCoilAspect">
			<properties>
				<property name="pack:pmCoreDiameter">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:pmCoilDiameter">
					<type>d:double</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
			</properties>
		</aspect>

		<aspect name="pack:pmPrintAspect">
			<properties>
				<property name="pack:pmPrintNbColors">
					<type>d:int</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:pmPrintColor">
					<type>d:text</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
				</property>
				<property name="pack:pmPrintType">
					<type>d:text</type>
					<mandatory>false</mandatory>
					<multiple>true</multiple>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
					<constraints>
						<constraint ref="pack:pmPrintTypes" />
					</constraints>
				</property>
				<property name="pack:pmPrintVarnish">
					<type>d:text</type>
					<mandatory>false</mandatory>
					<index enabled="true">
						<tokenised>false</tokenised>
						<facetable>true</facetable>
					 </index>
					<constraints>
						<constraint ref="pack:pmPrintVarnishs" />
					</constraints>
				</property>
			</properties>
		</aspect>


	</aspects>
</model>
