Commit ca5db729 authored by Alessio Carenini's avatar Alessio Carenini
Browse files

Added all details from xml chorspec to internal configuration

parent 7643ac00
......@@ -18,7 +18,7 @@
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/choreography">
name: CHOREOGRAPHY_NAME
......@@ -29,33 +29,51 @@ services:
<xsl:apply-templates></xsl:apply-templates>
</xsl:template>
<xsl:template match="service_group">
- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
<xsl:template match="service_groups">
- type: org.apache.brooklyn.entity.webapp.chorevolution.ControlledDynamicChoreographyCluster
name: StApp_wp4_<xsl:number/>
brooklyn.config:
chorSpecDependencies:
<xsl:for-each select="service[dependency]">
<xsl:value-of select="name" />
<xsl:text>:&#xa; </xsl:text>
<xsl:for-each select="dependency">
<xsl:value-of select="serviceSpecRole" /><xsl:text>: </xsl:text><xsl:value-of select="serviceSpecName" />
<xsl:choose>
<xsl:when test="position() != last()">
<xsl:text>&#xa; </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>&#xa; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
chorspec: |<xsl:for-each select="services">
- service:
name: <xsl:value-of select="name"/>
<xsl:if test="roles">
roles: <xsl:value-of select="roles"/>
</xsl:if>
<xsl:if test="serviceType">
service_type: <xsl:value-of select="serviceType"/>
</xsl:if>
<xsl:if test="@xsi:type">
artifact_type: <xsl:value-of select="@xsi:type"/>
</xsl:if>
<xsl:if test="packageType">
package_type: <xsl:value-of select="packageType"/>
</xsl:if>
<xsl:if test="packageUrl">
package_url: <xsl:value-of select="packageUrl"/>
</xsl:if>
<xsl:if test="dependencies">
dependencies:
<xsl:for-each select="dependencies">
<xsl:text>- </xsl:text><xsl:value-of select="serviceSpecRole" /><xsl:text>: </xsl:text><xsl:value-of select="serviceSpecName" />
<xsl:choose>
<xsl:when test="position() != last()">
<xsl:text>&#xa; </xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>&#xa; </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
wars.named: [<xsl:for-each select="service[packageType='WAR']">
wars.named: [<xsl:for-each select="services[packageType='WAR']">
"<xsl:value-of select="packageUrl"/>"<xsl:choose><xsl:when test="position() != last()">,</xsl:when></xsl:choose>
</xsl:for-each>
]
coordination_delegates:
<xsl:for-each select="service[packageType='ODE']">
<xsl:for-each select="services[packageType='ODE']">
<xsl:text> </xsl:text><xsl:value-of select="name"/><xsl:text>: '</xsl:text><xsl:value-of select="packageUrl"/>'
</xsl:for-each>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment