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

Thread: Need guidance for developing zimlets

  1. #1
    jiggy is offline Active Member
    Join Date
    Feb 2007
    Posts
    32
    Rep Power
    8

    Default Need guidance for developing zimlets

    Hello,

    Basically i am a java developer.I have some knowledge of Javascript and no knowledge of Ajax.

    Now in my company i am being assigned the job of developing zimlets for an application.

    I gone through the preliminary draft of Zimlet's whitepaper and got some idea of what zimlets are and what they consists of.

    I looked at the sample zimlets coming by default with Zimbra server.But when i looked at the code in the zimlet definition file there was very less code and in the .js file was the full functionality.But honestly saying i didn't got anything written in the .js file.One thing I am sure of is that code is not pure javascript.

    So if some body can help me in understanding what is going on in that .js file (for e.g the com_zimbra_email example) and let me know how to initiate and what approach to take for the task of my zimlet development,i would be really grateful to the zimbra community.

    Basically i will be developing zimlet forms which will get poppedup when the user will right click a particular content in the emailbody.

    Thanks

  2. #2
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    18

    Default

    Lots of Zimlets can be built from just the .xml file. To be honest most do one or more things that you must write in JS code. So if your doing some custom popup or want special UI interactions you'll want to have a .js file loaded with your Zimlet to host that code. Can you give us some more detail or an example of the text you want to match on and exactly what the user would do.. (ie hover over, click, right-click) and then what you want to happen.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    jiggy is offline Active Member
    Join Date
    Feb 2007
    Posts
    32
    Rep Power
    8

    Default

    Hi Kevin,
    Thanks for the reply.

    As mentioned in my previous post, i have a scenario of the following kind:
    In an email message body there would be some content,right-clicking on which will pop-up a form to the user to fill up and then save that information somewhere.

    So can you please help me in making me understand how i can achieve this thing through zimlets.Also request you to provide me some references regarding coding zimlets.

    Thanks.

  4. #4
    JoshuaPrismon is offline Zimlet Guru & Moderator
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    9

    Default

    Quote Originally Posted by jiggy View Post
    Hi Kevin,
    Thanks for the reply.

    As mentioned in my previous post, i have a scenario of the following kind:
    In an email message body there would be some content,right-clicking on which will pop-up a form to the user to fill up and then save that information somewhere.

    So can you please help me in making me understand how i can achieve this thing through zimlets.Also request you to provide me some references regarding coding zimlets.

    Thanks.
    As long as you don't care if the form comes from a server, this is pretty trivial. There are two xml files in each zimlet. The config_template.xml defines global properties (such as urls) and the name of the zimlet. the "name of the zimlet".xml file contains what strings to search for.

    A config like this would automatically open a floating tooltip window over a string that matched a specific regex to add a form.

    Code:
    <zimlet name="org_technicaldetails_tasks" version="1.0" description="Tasks">
    
            <contentObject>
            <matchOn>
                <regex attrs="ig">(your regex string here)</regex>
            </matchOn>
            <toolTip>
                <actionUrl target="http://www.myserver.org/tasks/view/" >
                    <param name="id">${src.$1}</param>
                </actionUrl>
            </toolTip>
        </contentObject>
    </zimlet>
    Your regex string is how you specify where the id is. The form (in my case at www.myserver.org/) will pop up inside of a tooltip window.

    If you want a full window, instead of wraping it inside of toolTip, wrap it inside of a <canvas>. If you need a form look at <formEditor>.

    Hope this helps.

  5. #5
    jiggy is offline Active Member
    Join Date
    Feb 2007
    Posts
    32
    Rep Power
    8

    Default

    Hi lostKnight.

    Thanks for the reply.

    Already tried out the option of using formEditor.
    Request you to refer this link formEditorThread.

    I was facing problem in that approach.

    Can you please suggest me some other option to develop my form??

    Thanks.

  6. #6
    JoshuaPrismon is offline Zimlet Guru & Moderator
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    9

    Default

    Quote Originally Posted by jiggy View Post
    Hi lostKnight.

    Thanks for the reply.

    Already tried out the option of using formEditor.
    Request you to refer this link formEditorThread.

    I was facing problem in that approach.

    Can you please suggest me some other option to develop my form??

    Thanks.
    Generate it on the server just like you would any other dynamic web application. If you don't need tight integration (ie, store the results in zimbra) you might as well just use the functionality already there in zimbra without any javascript.

  7. #7
    jiggy is offline Active Member
    Join Date
    Feb 2007
    Posts
    32
    Rep Power
    8

    Default

    lostKnight,

    I have the requirement of building my form as a zimlet only.
    I didn't get your point?? Can you please elaborate on your suggestion??

    Do you mean to say that i should use Ajax??

    Sorry but not getting you..Request you to elaborate please.

    Thanks.

  8. #8
    JoshuaPrismon is offline Zimlet Guru & Moderator
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    9

    Default

    Quote Originally Posted by jiggy View Post
    lostKnight,

    I have the requirement of building my form as a zimlet only.
    I didn't get your point?? Can you please elaborate on your suggestion??

    Do you mean to say that i should use Ajax??

    Sorry but not getting you..Request you to elaborate please.

    Thanks.
    Where/how are you planning on saving data from the Zimlet? The form editor functionality is there, but it isn't 100% working from my experience. There is also some Xforms capability, DWT capability, and just plain old building a form.

    AJAX is a enabling technology. DWT is what is build on top of AJAX which Zimbra uses. If you go look around the source code there is plenty of examples of code in Javascript on how to implement forms.

  9. #9
    jiggy is offline Active Member
    Join Date
    Feb 2007
    Posts
    32
    Rep Power
    8

    Default

    Hi LostKnight.

    I saw one example using forms built using Dwt (Travel Agent application) but i was not able to find any example using XForm.If you know how to use it then please provide me some snippets.

    The formEditor element i also used but its not working correctly.

    One more thing is that in this Travel Agent application the view used is DwtTabView(a tabbed buttons page).Is there a more simple mechanism , i mean any other class which we can use to build a form..

    Please help out in resolving the above mentioned things..

    Thanks.

  10. #10
    Ericx is offline Loyal Member
    Join Date
    Jul 2006
    Location
    Virginia Beach, VA
    Posts
    97
    Rep Power
    9

    Default Zimlets as a wrapper

    Depending on who will be judging your code, if its someone that does not know any better, I would do what I wrote below. If they understand what they are asking for, you may want to find out why they want it to be 100% Zimlet. If it's just for integration and security, option 2 (see below) should work just fine and you will finish the project much faster. Use the regex patter described above to match and have it call the form page in a canvas and away you go.

    If you are just filling out a form and not interacting with the rest of zimbra, you may want to just use zimbra as a wrapper. Create your webform using .jsp, serve it up, create a canvas window and pull it in. Then when you submit the form have it talk to the server that will host the application.

    There are two possible post options also.
    1. have the browser do the post - this is the easiest
    2. have the server do the post.

    Option 2 is great if you want to have zimbra manage your security, you can keep the second server behind a firewall. In my case I have a LAMP server and my zimbra server. Option works great inside the firewall, but my LAMP server is not open to the outside internet, in this case I would use option number 2. Another developer JTroxel had a tough time getting it to work and Satishs a Zimbra Employee posted some code that will make it work.
    Here is that thread.
    Post and params

    I've roughed in some code to use rest and curl to get data from the server. My form gets some info from the email using obj.body, but to get the attachments from the server, I went with just grabbing the whole thing.

    http://wiki.zimbra.com/index.php?title=Zimbra_to_PHP


    Also, if you figure out how to do tab order in the canvas, can you let me know. Thats my next hurdle.
    Hope this helps.
    Last edited by Ericx; 02-21-2007 at 10:41 AM.
    EricX

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Order of zimlets in Zimlets panel
    By Abak in forum Zimlets
    Replies: 2
    Last Post: 01-05-2009, 02:17 PM
  2. Zimlets Webinar: July 24th
    By GregA in forum Webinars
    Replies: 12
    Last Post: 09-12-2007, 09:24 PM
  3. where are my zimlets ?
    By santo in forum Zimlets
    Replies: 21
    Last Post: 06-05-2007, 07:30 AM
  4. Can't Deploy Zimlets after upgrade to 4.5.5
    By ajsp in forum Installation
    Replies: 2
    Last Post: 05-17-2007, 07:17 AM
  5. Graphs and Zimlets not displaying?
    By nadia007 in forum Installation
    Replies: 13
    Last Post: 11-24-2006, 07:51 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
  •