Hello Guys,
after I successfully connected the Basic Connector to the CMDBuild for sending the standard PC datas (those mentioned in the manual), I am trying to configure the Basic Connector for sending more data to the CMDBuild. This is the point where I am actually failing and I could really need some help.
So, what I am trying is: I added a Class named Java in CMDBuild and I want the Basic Connector to automatically fill it with Java based information.
This is, how my cmdbuild-schema.xml actually looks like:
<?xml version="1.0"?>
<CMDBUILD>
<PC>
<Code />
<Description />
<IPAddress />
<RAM />
<CPUNumber />
<CPUSpeed />
</PC>
<Java>
<Code />
<Description />
<Name />
<Version />
<JavaHome />
<InstallDir />
</Java>
</CMDBUILD>
And this is, how by transform.xsl actually looks like:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes" />
<xsl:template match="/">
<CMDBUILD>
<xsl:apply-templates />
</CMDBUILD>
</xsl:template>
<xsl:template match="*">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="text()"></xsl:template>
<xsl:template match="/inventory/device">
<PC key="Code">
<xsl:attribute name="objid">
<xsl:value-of select="./@objid" />
</xsl:attribute>
<Code>
<xsl:value-of select="./TAG" />
</Code>
<Description>
<xsl:value-of select="./NAME" />
</Description>
<IPAddress>
<xsl:value-of select="./IPADDR" />
</IPAddress>
<RAM>
<xsl:value-of select="./MEMORY" />
</RAM>
<CPUNumber>
<xsl:value-of select="./PROCESSORN" />
</CPUNumber>
<CPUSpeed>
<xsl:value-of select="./PROCESSORS" />
</CPUSpeed>
</PC>
</xsl:template>
<xsl:template match="/CMDBUILD/PC">
<PC key="Code">
<xsl:attribute name="objid">
<xsl:value-of select="./@objid" />
</xsl:attribute>
<Code>
<xsl:value-of select="./Code" />
</Code>
<Description>
<xsl:value-of select="./Description" />
</Description>
<IPAddress>
<xsl:value-of select="./SO" />
</IPAddress>
<RAM>
<xsl:value-of select="./RAM" />
</RAM>
<CPUNumber>
<xsl:value-of select="./CPUNumber" />
</CPUNumber>
<CPUSpeed>
<xsl:value-of select="./CPUSpeed" />
</CPUSpeed>
</PC>
</xsl:template>
<xsl:template match="/inventory/java">
<Java key="Code">
<xsl:attribute name="objid">
<xsl:value-of select="./@objid" />
</xsl:attribute>
<Code>
<xsl:value-of select="/inventory/device/TAG" />
</Code>
<Description>
<xsl:value-of select="/inventory/device/NAME" />
</Description>
<Name>
<xsl:value-of select="./NAME" />
</Name>
<Version>
<xsl:value-of select="./VERSION" />
</Version>
<JavaHome>
<xsl:value-of select="./JAVA_HOME" />
</JavaHome>
<InstallDir>
<xsl:value-of select="./INSTALL_DIR" />
</InstallDir>
</Java>
</xsl:template>
<xsl:template match="/CMDBUILD/Java">
<Java key="Code">
<xsl:attribute name="objid">
<xsl:value-of select="./@objid" />
</xsl:attribute>
<Code>
<xsl:value-of select="./Code" />
</Code>
<Description>
<xsl:value-of select="./Description" />
</Description>
<Name>
<xsl:value-of select="./Name" />
</Name>
<Version>
<xsl:value-of select="./Version" />
</Version>
<JavaHome>
<xsl:value-of select="./JavaHome" />
</JavaHome>
<InstallDir>
<xsl:value-of select="./InstallDir" />
</InstallDir>
</Java>
</xsl:template>
</xsl:stylesheet>
I already got a view named CMDBuild_java which contains the data I need.
Also I somehow already managed to get the information filled in, but I had multiple entries after starting the Basic Connector again, it just didn't wanted to replace it.
Is anyone able to tell me, what I did wrong?
I would be really grateful for any kind of help.
Greetings