<?xml version="1.0" encoding="UTF-8"?>
<ucp:component 
	xmlns:ucp="http://DigitalLeadersInitiative.com/EAMD.ucp/2.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://DigitalLeadersInitiative.com/EAMD.ucp/2.0 
	https://raw.githubusercontent.com/DigitalLeadersInitiative/EAMD.ucp/master/ucp/2.0/Component.xsd"
	>
	
	<!-- Nexus "dependency.groupId"."dependency.artifactId" -->
	<name>${this.ucpComponent.package}.${this.ucpComponent.className}</name>
	
	<!-- Nexus "dependency.version" -->
	<version>${this.version.name}</version>
	

	<!-- 1 to 5 -->
	<layer>${this.ucpComponent.layer.value}</layer>
	
	<lifecycle phase="${this.ucpComponent.lifecycle.name}"/>

	<!-- human-readable name, not necessarily unique -->
	<displayName>${this.ucpComponent.displayConfig.displayName}</displayName>
	
	<!-- human-readable name, not necessarily unique -->
	<detailText>
		${this.ucpComponent.displayConfig.detailText}
	</detailText>

	<!-- example of a linked resource, can also be embedded -->
	<displayImage href="${this.ucpComponent.displayConfig.displayImage.path}"></displayImage>

    <!-- NEW -->
	<!-- Refers to a class in a hierarchy. Name attribute values limited to the list of all possible class names. -->
	<!-- Default stereotype name defined in the XSD -->
	<stereotype name="Service"/>

	
	
	<unitList>
		<unit type="someTypeString">value</unit>
		<unit type="maven:target:subTarget">string</unit>
		<unit type="WSDL-File" name="someWSDLunitName" href="reletive/path/to/Component.xml/file.wsdl"/>

		<unit lifecycle="build"					type="ant">build.xml</unit>
		<unit lifecycle="build"					type="ant::build">#!sh ant build</unit>
		<unit lifecycle="deploy"				type="ant::deploy">#!sh ant deploy</unit>
		<unit lifecycle="install"				type="apt-get">#!sh apt-get install thisComponent</unit>
		<unit lifecycle="install:configure"		type="ant::configure">#!sh ant configure</unit>
		<unit lifecycle="start"					type="sh">#!sh startServer -port ${server.port} -name MAIN</unit>
		<unit lifecycle="stop"					type="sh">#!sh stopServer -name MAIN</unit>
		<unit lifecycle="stop"					type="sh">#!sh stopServer -name MAIN</unit>
		${{ 

			var that = Structr.get("this");
		
			var test= [];

			that.version.folders.forEach(function(f) {
				test.push(f);
			});


			test.forEach(function(f) {
				Structr.print(
"\n		<unit lifecycle='build'	type='Folder'   data-structr-hash='"+f.id+"'>./"+f.name+"</unit>"
				);
			});
		
		
		
		}}

	</unitList>
	
	<interfaceList>
		<interface type="Semantic" name="Object"/>
		<interface type="Semantic" name="List"/>
		<interface type="Semantic" name="Tree"/>

		<interface type="WSDL" unitName="someWSDLunitName"/>

		<property key="some.property.key"/>
		<property key="server.port"/>
	</interfaceList>

	<package>
		${{ 
			var that = Structr.get("this");
		
			var test= [];

			that.ucpComponent.folders.forEach(function(f) {
				test.push(f);
			});


			test.forEach(function(f) {
				if( f.type === "UcpComponent") { 
					Structr.print(
"\n		<componentRef name='"+f.package+"."+f.name+"' version='"+that.version.name+"' minVersion='"+that.version.name+"' maxVersion='"+f.latestVersion.name+"'/>"
					);
				}
			});
		
		
		}}
	</package>

	
	<dependency type="requires" name="" version=""/>
	<dependency version="" name="" type="requires"/>
	<dependency type="requires" name="SLES.OS" version="12.0.1.123" minVersion="12.0.1.0"/>

</ucp:component>
