Index: /DCWoRMS/branches/coolemall/simulator/xslt/debb/PLMXMLTranslator.xsl
===================================================================
--- /DCWoRMS/branches/coolemall/simulator/xslt/debb/PLMXMLTranslator.xsl	(revision 1260)
+++ /DCWoRMS/branches/coolemall/simulator/xslt/debb/PLMXMLTranslator.xsl	(revision 1266)
@@ -11,4 +11,5 @@
 	<xsl:param name="templateStartLevel" select="templateStartLevel" />
 	
+	<xsl:param name="plmxmlFolderName" select="plmxmlFolderName" />
 	<xsl:param name="plmxmlFileName" select="plmxmlFileName" />
 		
@@ -54,9 +55,77 @@
 
 	<xsl:template match="plm:InstanceGraph" mode="createTemplates">
-     <xsl:apply-templates select="//plm:ProductRevisionView[plm:UserData/plm:UserValue/@title='DEBBLevel' and plm:UserData/plm:UserValue/@value=$templateStartLevel]" mode="createTemplates"/>
-
-		
-	</xsl:template>
-
+			<xsl:variable name="rootRef" select="@rootRefs" />
+		<xsl:apply-templates select="//plm:ProductInstance[@id=$rootRef]" mode="createTemplates"/>
+	   
+	</xsl:template>
+
+	<xsl:template match="plm:ProductInstance" mode="createTemplates">
+
+ 		<xsl:variable name="nodesTemplates" select="distinct-values(//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$templateStartLevel]/plm:UserData/plm:UserValue[@title='DEBBComponentFile']/@value)"/>
+		<xsl:for-each select="1 to count($nodesTemplates)">
+			<xsl:variable name="index" select="." />
+			<xsl:variable name="debbFileName" select="$nodesTemplates[$index]"/>
+			<xsl:variable name="nodesTemplatesIds" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$debbFileName]/plm:UserData/plm:UserValue[@title='DEBBComponentId']/@value)"/>
+			<xsl:for-each select="1 to count($nodesTemplatesIds)">
+				<xsl:variable name="index2" select="." />
+				<xsl:variable name="debbFileFullName">
+					<xsl:value-of select="$plmxmlFolderName"/>
+						<xsl:text>/</xsl:text>
+					<xsl:value-of select="$debbFileName"/>
+				</xsl:variable>
+				<xsl:variable name="nestedDoc" select="document($debbFileFullName)" />
+				<xsl:variable name="debbComponentId" select="$nodesTemplatesIds[$index2]"/>
+				
+					<xsl:variable name="instancesReferences" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$debbFileName and plm:UserData/plm:UserValue/@value=$debbComponentId]/@instanceRefs)"/>
+
+					<xsl:variable name="partsReferences" select="distinct-values($rootDoc//plm:ProductInstance[@id=($instancesReferences)]/@partRef)"/>
+
+					<xsl:variable name="devicesIds" select="distinct-values($rootDoc//plm:ProductRevisionView[@id=($partsReferences)]/plm:UserData/plm:UserValue[@title='DEBBComponentId']/@value)"/>
+					
+					<xsl:for-each select="1 to count($devicesIds)">
+						<xsl:variable name="index3" select="." />
+						<xsl:element name="computingResourceTemplate">
+						<xsl:attribute name="name">
+							<xsl:value-of select="$templateStartLevel"/>
+							<xsl:text>-</xsl:text>
+							<xsl:value-of select="$debbComponentId"/>
+						</xsl:attribute>
+						<xsl:attribute name="class">
+							<xsl:value-of select="$templateStartLevel"/>
+						</xsl:attribute>
+						<xsl:apply-templates select="$nestedDoc//*[ComponentId=$debbComponentId]" mode="component"/>		
+						<xsl:element name="device">
+						<xsl:variable name="deviceName" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$devicesIds[$index3]]/@name)[1]" />		
+										<xsl:attribute name="name">
+					<xsl:value-of select="$deviceName" />
+				</xsl:attribute>
+					<xsl:variable name="deviceClass" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$devicesIds[$index3]]/plm:UserData/plm:UserValue[@title='DEBBLevel']/@value)[1]" />		
+										<xsl:attribute name="class">
+							<xsl:value-of select="$deviceClass"/>
+						</xsl:attribute>
+							<xsl:variable name="devicesTemplates" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$devicesIds[$index3]]/plm:UserData/plm:UserValue[@title='DEBBComponentFile']/@value)"/>
+							
+							<xsl:for-each select="1 to count($devicesTemplates)">
+								<xsl:variable name="index4" select="." />
+												<xsl:variable name="deviceFileFullName">
+					<xsl:value-of select="$plmxmlFolderName"/>
+						<xsl:text>/</xsl:text>
+					<xsl:value-of select="$devicesTemplates[$index4]"/>
+				</xsl:variable>
+								<xsl:variable name="nestedDoc2" select="document($deviceFileFullName)" />
+								<xsl:apply-templates select="$nestedDoc2//*[ComponentId=$devicesIds[$index3]]" mode="heatsink">
+						<xsl:with-param name="instanceRefs" select="distinct-values($rootDoc//plm:ProductRevisionView[plm:UserData/plm:UserValue/@value=$devicesIds[$index3]]/@id)[1]" />		
+							</xsl:apply-templates>
+								</xsl:for-each>
+						</xsl:element>
+					</xsl:element>
+					
+										
+					</xsl:for-each>
+
+			</xsl:for-each>
+		</xsl:for-each>	
+	</xsl:template>
+	
 	<xsl:template match="plm:ProductInstance" mode="createHierarchy">
 		<xsl:variable name="partRef" select="@partRef" />
Index: /DCWoRMS/branches/coolemall/simulator/xslt/debb/coolemallPlugins.xml
===================================================================
--- /DCWoRMS/branches/coolemall/simulator/xslt/debb/coolemallPlugins.xml	(revision 1260)
+++ /DCWoRMS/branches/coolemall/simulator/xslt/debb/coolemallPlugins.xml	(revision 1266)
@@ -89,5 +89,5 @@
 	</energyEstimationPlugin>
 	
-		<energyEstimationPlugin>
+	<energyEstimationPlugin>
 		<name>example.energy.coolemall.FlowPumpInletEnergyEstimationPlugin</name>
 		<resources>
@@ -111,3 +111,22 @@
 		</resources>
 	</energyEstimationPlugin>
+	
+	<loadEstimationPlugin>
+		<name>example.energy.coolemall.DefaultLoadEstimationPlugin</name>
+		<resources>
+			<class>ComputeBox2</class>
+			<class>Room</class>
+			<class>ComputeBox1</class>
+			<class>Rack</class>
+			<class>NodeGroup</class>
+			<class>Node</class>
+		</resources>
+	</loadEstimationPlugin>
+	
+		<loadEstimationPlugin>
+		<name>example.energy.coolemall.ProcessorLoadEstimationPlugin</name>
+		<resources>
+			<class>Processor</class>
+		</resources>
+	</loadEstimationPlugin>
 </plugins>
