Results 1 to 5 of 5

Thread: Help with first Zimlet

  1. #1
    Join Date
    Apr 2007
    Posts
    29
    Rep Power
    8

    Default Help with first Zimlet

    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)

  2. #2
    Join Date
    Oct 2005
    Location
    Thatcher, AZ
    Posts
    5,606
    Rep Power
    21

    Default

    Is: http://appserver/zimlets/pin2xml.php? on the zimbra server?

    If so, it should be:
    http://appserver/service/zimlet/(name of deployed zimlet)pin2xml.php?

    If it's not, It might be helpful if you put it there. We run php, and the script probably will run fine.
    There might be some cross-domain security issues, and perhaps that's what's happening.

  3. #3
    Join Date
    Apr 2007
    Posts
    29
    Rep Power
    8

    Default

    The PHP script isn't on the Zimbra server - it's on a second app server. Zimbra is sending the request via the Zimbra server (/service/proxy, I think) to the app server. The problem I'm having is what it's passing in the target. Rather than a result from the regex, it looks like an error message.

  4. #4
    Join Date
    Apr 2007
    Posts
    29
    Rep Power
    8

    Default

    Quick update.. Based on what is in the URL, it looks like the mail client is inserting what is below as the variable returned by the regex - I've URL decoded it..

    Code:
    (UNDEFINED - str '${src.$1}' obj '[object Object]')

  5. #5
    Join Date
    Apr 2007
    Posts
    29
    Rep Power
    8

    Default

    Ok.. Figured it out..

    Replaced...

    Code:
    <param name="pin">${src.$1}</param>
    ...with...

    Code:
    <param name="pin">${src.objectContent}</param>
    ...and all is fine.

Similar Threads

  1. Replies: 21
    Last Post: 02-04-2010, 10:06 AM
  2. Replies: 5
    Last Post: 01-11-2008, 05:34 AM
  3. Replies: 13
    Last Post: 07-20-2007, 04:21 AM
  4. Domain Admin Error: Permission Denied
    By shanson in forum Administrators
    Replies: 3
    Last Post: 05-29-2007, 06:48 AM
  5. Post instsallation problems
    By Assaf in forum Installation
    Replies: 14
    Last Post: 01-29-2007, 11:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •