Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Zimlets

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Posts
    15
    Rep Power
    9

    Default Zimlets

    I downloaded the Zimlets Preliminary draft found on your blog. Spent my afternoon trying to figure out how to create my own zimlets. Now I think I understand what is going on but still confused on how they actually work.

    Been looking at the com_zimbra_url zimlet as my learning tool while trying to learn what I need to learn. I understand the definition file quite well. My problem comes from looking at the com_zimbra_url.zip contents it includes a javascript file and a class file. I'm trying to place how these are being called in the whole picture.

    Unless I'm misunderstanding the xml file. (which is possible) Besides defining the include and resources I don't see where it makes use of the javascript file. As the xml file has the regex for the match and the 2 actions that can be taken on the matched content. Am I missing something here? It looks like to me the com_zimbra_url zimlet could work without the javascript code. This is why I'm confused about the whole thing, maybe looking at the com_zimbra_url zimlet as my basic learning tool was a bad choice but it basically does what I want my custom zimlet to do (get info from a website and display it in a bubble).

    On a side note any help regarding zimlets would be greatful, including any simple zimlet test code to help me learn more about creating them. Thank you.

  2. #2
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    The URL Zimlet is a good one for what your trying to do it seems. As you said it should be possible to complete this Zimlet without any JavaScript code but some things for the time being need to be written in JavaScript. In the URL Zimlet in particular we do some re-wrting of the regex match and define the detials of the linking and image hover.

    You'll see the <handlerObject>Com_Zimbra_Url</handlerObject> this tells the Zimlet framework which JavaScript object to create to init this Zimlet. All the code for the ~10 sample zimlets are available in the CVS tree. You should also see this in the zimlets directory on your install.

    If you have specfic questions about writing a Zimlet we can try to anwser that here.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    Join Date
    Jan 2006
    Posts
    15
    Rep Power
    9

    Default

    As you said it should be possible to complete this Zimlet without any JavaScript code but some things for the time being need to be written in JavaScript. In the URL Zimlet in particular we do some re-wrting of the regex match and define the detials of the linking and image hover.
    For my knowledge and to save on some headaches what needs to be in JavaScript currently for it to work? I'm assuming JavaScript is currently needed cause zimlets and Zimbra are still in beta and therefore still being coded.

  4. #4
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Quote Originally Posted by Awol
    For my knowledge and to save on some headaches what needs to be in JavaScript currently for it to work? I'm assuming JavaScript is currently needed cause zimlets and Zimbra are still in beta and therefore still being coded.
    It depends on what you want your Zimlet to do. If you just want to display some text from a static URL with a param you can do that without JavaScript. If you want to make a more complex Webservice call then that requires JavaScript. Can you give me some more informaiton about what your trying to do? This might be easier to help you with your problem than disscuss the issues in general. For the most part simple Zimlets can be built in hours/minutes.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  5. #5
    Join Date
    Jan 2006
    Posts
    15
    Rep Power
    9

    Default

    It depends on what you want your Zimlet to do.
    Oh ok the way I read your first reply made it sound like you needed to use Javascript for now to do it. Misunderstanding on my part.

    Here is what I'm trying to do. I work for a trade association and I thought it be nice to parse member numbers out in email and when you hover the number it would show the member information. To do this we would simple write a script on out webserver in which the member number could be passed. Returning the text we want to return. I have a few other ideas as well but they are all the same just different data.

  6. #6
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Ok cool. So you'll just need a regex to pick out the member numbers and then define a simple toolTipPoppedUp method to fetch and display the returned data. Your JS code would look something like:

    Code:
    Com_name_zimlet.prototype.toolTipPoppedUp =
    function(spanElement, obj, context, canvas) {
    	canvas.innerHTML = context;
    	var request = new AjxRpcRequest("zimlet");
    	var info_url = <your URL>+context;
    	var url = ZmZimletBase.PROXY + AjxStringUtil.urlEncode(info_url);
    	request.invoke(null, url, null, new AjxCallback(this, Com_name_zimlet._callback, canvas), true);
    };
    
    Com_name_zimlet._callback =
    function(canvas, result) {
    	canvas.innerHTML = result.text;
    };
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  7. #7
    tonyawbrey Guest

    Default Phone Zimlet

    Would it be possible to modify the phone zimlet to launch a SIP application (like xten) from zimbra instead of skype? If so, any tips on how to get started on this?

  8. #8
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Quote Originally Posted by tonyawbrey
    Would it be possible to modify the phone zimlet to launch a SIP application (like xten) from zimbra instead of skype? If so, any tips on how to get started on this?
    Sure. We currently use the callto: handle in the browser. If your sip application already handles browser callto: links then you should not need to make any changes.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  9. #9
    Join Date
    Jan 2006
    Posts
    15
    Rep Power
    9

    Default

    First off thanks for all the help Kevin. I only have 1 more issue and I believe its a simple one. On page 32 of your Zimlets draft it says the proxy servlet checks the URL against a list of allowed domains in the COS. How do I add domains to the allowed list?

  10. #10
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Quote Originally Posted by Awol
    First off thanks for all the help Kevin. I only have 1 more issue and I believe its a simple one. On page 32 of your Zimlets draft it says the proxy servlet checks the URL against a list of allowed domains in the COS. How do I add domains to the allowed list?
    Pretty easy. Just add a "config_template.xml" file to your zimlet zip bundle. Contents would be like:

    Code:
    <zimletConfig name="com_zimbra_ymaps" version="1.0">
      <global>
        <property name="allowedDomains">*.yahoo.com,*.yimg.com</property>
      </global>
    </zimletConfig>
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

Similar Threads

  1. Zimlets Webinar: July 24th
    By GregA in forum Webinars
    Replies: 12
    Last Post: 09-12-2007, 10:24 PM
  2. where are my zimlets ?
    By santo in forum Zimlets
    Replies: 21
    Last Post: 06-05-2007, 08:30 AM
  3. Can't Deploy Zimlets after upgrade to 4.5.5
    By ajsp in forum Installation
    Replies: 2
    Last Post: 05-17-2007, 08:17 AM
  4. Graphs and Zimlets not displaying?
    By nadia007 in forum Installation
    Replies: 13
    Last Post: 11-24-2006, 07:51 AM
  5. No zimlets displayed in 3.2 M1/M2
    By pepijn in forum Administrators
    Replies: 2
    Last Post: 07-28-2006, 07:32 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
  •