Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-09-2007, 03:22 AM
Active Member
 
Posts: 32
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
Reply With Quote
  #2 (permalink)  
Old 02-10-2007, 08:31 PM
Zimbra Employee
 
Posts: 4,784
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.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #3 (permalink)  
Old 02-11-2007, 10:14 PM
Active Member
 
Posts: 32
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.
Reply With Quote
  #4 (permalink)  
Old 02-13-2007, 09:14 AM
Zimlet Guru & Moderator
 
Posts: 431
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.
Reply With Quote
  #5 (permalink)  
Old 02-14-2007, 10:33 PM
Active Member
 
Posts: 32
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.
Reply With Quote
  #6 (permalink)  
Old 02-14-2007, 10:59 PM
Zimlet Guru & Moderator
 
Posts: 431
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.
Reply With Quote
  #7 (permalink)  
Old 02-14-2007, 11:38 PM
Active Member
 
Posts: 32
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.
Reply With Quote
  #8 (permalink)  
Old 02-16-2007, 10:48 PM
Zimlet Guru & Moderator
 
Posts: 431
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.
Reply With Quote
  #9 (permalink)  
Old 02-18-2007, 10:48 PM
Active Member
 
Posts: 32
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.
Reply With Quote
  #10 (permalink)  
Old 02-21-2007, 10:38 AM
Loyal Member
 
Posts: 97
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.
__________________
EricX

Last edited by Ericx : 02-21-2007 at 10:41 AM.
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0