Zimbra connector - java

I just discovered Zimbra and have a connector in Java to write. I have been looking on the web to find some documentation or experience from other people but could not find anything. Is there any good documentation of the API somewhere so I can get started and check what is possible to do with it?
Thanks

REST API:
Here
There's a SOAP API, but it's..... very odd.... let me put that genorously. It is
here
Why is it "odd".It's WSDL-less, which is an interesting....choice.

Your best bet would be to look in the docs folder of your Zimbra installation (usually /opt/www/docs if you are on linux) and have a look at soap.txt, soap-admin.txt and rest.txt depending on what you want to achieve.
The rest APIs are generally great for downloading a user's mailbox and other content such as contact and calendar entries as an archive, in case you want to back them up.
The admin apis are useful for managing the server and its users, checking the status, flushing the mail queue, etc.
If you want to implement client(user) functions, have a look at the source code for the Zimbra desktop client.
There is a post here which provides a (partial) Java compliant WSDL file for the Admin SOAP api, and also a jar containing ready-to-use client proxies generated from them with CXF.

Related

Connecting external Java program with Apache via module

Last time I think how can I connect my Java external program to Apache webserver.
I wanna send HTTP requests to process and then send output back as HTML file.
I thought about JNI but with multi-thread structure, it doesn't look good for me.
I think with help of Sockets it could be nice but I want to hear Your ideas.
Last but very important: should I use "normal" Apache or Tomcat for that?
For the level of integration you are looking for, JNI is way too low-level and involved.
Instead, take a look at:
FastCGI: on the Apache side use mod_fastcgi and jfastCGI on the Java side.
small HTTP servers: mod_proxy on the Apache side, which reverse proxies to a small HTTP server on the Java side such as Netty or Undertow.

how to build Spring BulkEmailer web application

I am new to spring.I had a doubt regarding sending mails.How can i send a bulk of mails from spring based web application in which i have a requirement in my project.
I have no idea on this please suggest me something which is helpful
Thanks in advance
you can send bulkemails using spring and it also offers scheduling a mails to multiple reciepts refer this example
refererence
You can also go through some of the real sites which are already exists and using for marketing with bulkmails check this
so that you can get an idea to work on your requirements
I usually offer some code but in this case I would just copy-paste from this tutorial.
Spring has very little in terms of mailing support (which is found in the context-support module), which itself is just a wrapper over the javax.mail package.
I would use a service like Amazon SES, which helps keep your email messages out of spam boxes.
Install an MTA (like Postfix) in Satellite Mode on your local machine. This will relay emails to Amazon SES.
Use JavaMail to send email messages to localhost, and they will go to your MTA queue, and get sent to Amazon.
Make sure you are complying with anti-spam legislation: http://www.business.ftc.gov/documents/bus61-can-spam-act-compliance-guide-business

how can I talk to a blazeds endpoint without flash

i would like to reuse my existing blazeds/java/spring apps to write some html 5 clients. Is anyone aware of a pure js (no swf bridge allowed) client that has pub/sub capability
so far my googling has found 2 projects - jsasmf (which uses a tiny swf) and amf.js which is missing pub/sub, but no other projects besides these 2
any ideas (crazy is fine) on how to do this appreciated
cheers
Why not annotate your blazeds service object implementation with jersey annotations to expose it as a rest service. It should be possible to expose the same service through blazeds and rest at the same time. You could use Atmosphere to implement pub/sub
This may be possible with another server. You would consume the service with flash on that server and expose its api with web sockets (for example) to other clients. Your clients would not need flash installed.
Extending on Erik Martino's answer... you could try compiling a Java AMF client to JavaScript yourself using GWT.
Late to the party but is seems Adobe has a JS Client too. I you download the trail of Dataservices ES 4.6 its in the resource folder. A tutorial can be found here

Java Client-Server communication to register a product

I'm looking for some advice on the simplest way to create some product registration communication. I have a Java desktop application that needs to be re-newed every year. When a user downloads and install this app (through JNLP) they get a limited demo-version. There is code in place on the client to "register" the product and unlock all of the features.
My next step is to build the server-side components. There will be a database with customer ID numbers and other information about the customer. When the user clicks register, some contact information will be sent to the server as well as some product registration ID. The server will check this against the database and then either give the client the o.k. to unlock the features or the user will be informed that the registration id was not valid. This seems like a very standard thing. So what is the standard way to do it?
I have my own VPS and I'm running Tomcat, so I'm really free to implement this any way I choose. I was planning on building some web service, but I have never used REST before.
Use REST; REST is nothing more than using plain HTTP 'better'. Since you are already using HTTP, somehow you are already doing REST like calls and moving these calls to full fledged REST will be easy.
Implementing REST calls is easy. You have two approaches:
Low end: using URLConnection objects on the client, servlets on the server and following some REST conventions on using HTTP methods and 'clean' URLs (see here). Advantage is that you need no 3rd party library and minimize the footprint. Maintenance and evolutions are harder though.
High-end: a framework and specifications like JAX-RS. Using Restlet you can be up in running with a REST server in a couple of hours without having to deploy a servlet container.
Don't use SOAP. The only reason you would want to use SOAP is that you want to contractualise using a WSDL what you are exposing (you can do the same with REST btw, see the Amazon documentation for instance). Trust me, SOAP is way too heavy and confusing for what you are trying to do.

Functionality of a web application to handle user's request to download files from SFTP Server

In our Java web application, customer wants to upload some large files to a SFTP server and download directly from there. The customers do not want to use any third party tool rather they want this functionality in the application itself.
The file upload part has been taken care of by the JFileUpload applet component & libraries. Once the file gets uploaded I could figure out the exact location of the stored file. And that uploaded file will be shown to the users as a link which they will click to download (like an HTTP or FTP file link).
So I've to decide the strategy for downloading the file from the SFTP servers.
One option is to parse the request, then connect with the SFTP server and stream the file via HTTP server. But here the file will be downloaded over HTTP rather SFTP and moreover it will not serve the purpose of using SFTP.
Another option which I could think of is via an applet, again like upload. As soon as the request for the SFTP file comes to the HTTP server, it will launch a page containing an applet having a directory browser for users to decide the save path. Once the user selects the save location, the file will automatically start downloading to that location from the SFTP server. In this way the connection will be completely SFTP.
I want to know how much feasible the second approach is and if there are any important things I'll have to take care of. Which SFTP libraries are the best to use for this type of operations?
Moreover, please let me know if there are other better options to do mentioned activity.
Edit
It seems this post looks like a request for suggestion on ways to download from SFTP server (may be from the heading but I could not think of any other heading!!). Thank you for the suggestions on the APIs to do that but the more important issue for us is to figure out a way where a user's request to download a file from SFTP server is done over secure SSH rather than over HTTP. Now using the mentioned APIs we could very well download the files from the SFTP server to the HTTP server's filesystem but after that if we have to redirect the same file to the user's machine we have to use HTTP and that is what we want to avoid.
Our second thought approach of using a page with an applet which will initiate a SFTP session between user's client and SFTP server is to address the above concern.
How difficult will it be to implement and what should be our approach in this regard?
And if there is any other better & easier way to do the same task then please suggest.
I favor Commons-VFS for this kind of thing. It abstracts out the actual file system type and lets you work with a standard interface regardless of the underlying implementation. It in turn depends on other libraries for the actual systems, in particular JScsh for SFTP.
I recommend using JSch, Java Secure Channel. It is a pure Java implementation of SSH2. It has good examples for doing SFTP in addition to pretty much every other SSH2 option (XForwarding, port forwarding, etc.). We use it in a number of our projects, and have not had any issues. I have even tied it's GSS-API (Kerberos) support into a native Kerberos implementation and it worked well. It is BSD licensed, so commercial or not, you shouldn't have much issues with licensing.
I see building an applet using JSch to be pretty simple. Biggest issue will be to make sure your applet is signed and has permissions to write/read local files and connect to the SSH servers in question.
The customer is always right, so while the requirement screams bad architecture to me, I'll just extend my sympathy on that and try to help you with the problem.
The applet approach is OK, but seems kind of clunky for a web app. There are javascript sftp libraries out there. This one supports sftp and will give a much more natural feel to a web application than poping up an applet just for the sake of providing a file transfer. It isn't free, but it isn't that pricy either. It still uses an applet under the hood to effect the file transfer, it just doesn't present a java screen to the user.
Did you mean SFTP or FTPS (FTP over SSL)?
If you realy ment SFTP, have a look here: http://www.spindriftpages.net/blog/dave/2007/11/27/sshtools-j2ssh-java-sshsftp-library/comment-page-1/

Categories

Resources