I'm writing my first zimlet to pull property card information and am having an issue... For some reason, it doesn't seem to insert the pin into the URL correctly. No idea why. Regexes aren't my strongest...
Data sent to the zimbra proxy service Code:
target=http://appserver/zimlets/pin2xml.php?pin=(UNDEFINED%20-%20str%20'$%7Bsrc.$1%7D'%20obj%20'%5Bobject%20Object%5D')
com_zimbra_mcis_property.xml Code:
<zimlet name="com_zimbra_mcis_property" version="1.0" description="MCIS Property Card">
<resource>mcisproperty.xsl</resource>
<contentObject>
<matchOn>
<regex attrs="ig">(?:\d{2}-\d{2}-\d{3}-\d{3})</regex>
</matchOn>
<toolTip>
<actionUrl target="http://appserver/zimlets/pin2xml.php" xslt="mcisproperty.xsl">
<param name="pin">${src.$1}</param>
</actionUrl>
</toolTip>
</contentObject>
</zimlet> mcisproperty.xsl Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="propertycard">
<div><b>Pin:</b> <xsl:value-of select="pin"/></div>
<div><b>Owner:</b> <xsl:value-of select="titleholder"/></div>
<div><b>Address:</b> <xsl:value-of select="address"/></div>
<div><b>City/State/Zip:</b> <xsl:value-of select="csz"/></div>
<div><b>Class:</b> <xsl:value-of select="class"/></div>
<div><b>Homestead:</b> <xsl:value-of select="homestead"/></div>
</xsl:template>
<xsl:template match="text()|@*"/>
</xsl:stylesheet> config_template.xml Code:
<zimletConfig name="com_zimbra_mcis_property" version="1.0">
<global>
<property name="url">http://ubuntuapp.co.marshall.ia.us/zimlets/pin2xml.php</property>
<property name="allowedDomains">*.co.marshall.ia.us</property>
</global>
</zimletConfig> Strings to match Code:
nn-nn-nnn-nnn (anywhere in message)
Parcel nnnnnnnnnn (case insensitive anywhere in message)
PIN nnnnnnnnnn (case insensitive anywhere in message)