-
Notifications
You must be signed in to change notification settings - Fork 0
Java library for the Vuzit AJAX document viewer web services API
License
vuzit/vuzitjava
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
------------------------------------------------------------------------ -- VuzitJava -- Vuzit Web Services library for Java ------------------------------------------------------------------------ -------------------------------------------------- -- INTRODUCTION -------------------------------------------------- This is a library that allows developers to directly access the Vuzit Web Service API through short commands: http://vuzit.com/developer/web_service_api Below is a basic upload example: com.vuzit.Service.setPublicKey("YOUR_PUBLIC_API_KEY"); com.vuzit.Service.setPrivateKey("YOUR_PRIVATE_API_KEY"); com.vuzit.Document doc = com.vuzit.Document.upload("c:/path/to/document.pdf"); System.out.println("Document id: " + doc.getId()); To get started all you need to do is download the code, sign up for a free account (https://ssl.vuzit.com/signup) and replace the public and private keys with the keys from your account. -------------------------------------------------- -- INITIAL SETUP -------------------------------------------------- * Take the Vuzit.jar file from the build/jar directory * Add the JAR file as a reference in your project. * To check if your install was successful add the code below to your source code and if it compiles without any errors then you've succeeded. import com.vuzit; * If you want to compile the source code then you will need to install Ant (http://ant.apache.org/) and run the following command in the root directory (with the build.xml in it): ant jar * To build the VuzitCL command-line interface to the Vuzit API run this command with Ant: ant bin -------------------------------------------------- -- GETTING STARTED -------------------------------------------------- * Download the code - http://github.com/vuzit/vuzitjava/downloads * Sign up for a free Vuzit account - https://ssl.vuzit.com/signup * Code Examples - http://wiki.github.com/vuzit/vuzitjava/code_examples * Vuzit API Reference - http://wiki.github.com/vuzit/vuzitjava/api_reference * Change log - http://wiki.github.com/vuzit/vuzitjava/change_log -------------------------------------------------- -- EXAMPLES -------------------------------------------------- Find Document Example - how to load a document com.vuzit.Service.setPublicKey("YOUR_PUBLIC_API_KEY"); com.vuzit.Service.setPrivateKey("YOUR_PRIVATE_API_KEY"); com.vuzit.Document doc = com.vuzit.Document.find("DOCUMENT_ID"); System.out.println("Document id: " + doc.getId()); System.out.println("Document title: " + doc.getTitle()); Delete (destroy) Document Example com.vuzit.Service.setPublicKey("YOUR_PUBLIC_API_KEY"); com.vuzit.Service.setPrivateKey("YOUR_PRIVATE_API_KEY"); com.vuzit.Document.destroy("DOCUMENT_ID"); Upload and View with the JavaScript API Example <% // Set the public and private keys com.vuzit.Service.setPublicKey("YOUR_PUBLIC_API_KEY"); com.vuzit.Service.setPrivateKey("YOUR_PRIVATE_API_KEY"); // Substitute the code below with the Vuzit document ID. String documentId = "XXXXXXX"; java.util.Date date = new java.util.Date(); // Show document "timestamp" parameter long timestamp = com.vuzit.Service.epochTime(date); // Show document "signature" parameter string signature = com.vuzit.Service.signature("show", documentId, date); // Creates a URL-encoded signature string encodedSig = java.net.URLEncoder.encode(signature, "UTF-8"); %> <html> <head> <link href="http://vuzit.com/stylesheets/Vuzit-2.9.css" rel="Stylesheet" type="text/css" /> <script src="http://vuzit.com/javascripts/Vuzit-2.9.js" type="text/javascript"></script> <script type="text/javascript"> // Called when the page is loaded. function initialize() { vuzit.Base.apiKeySet("<%= com.vuzit.Service.getPublicKey() %>"); var options = {signature: '<%= encodedSig %>', timestamp: '<%= timestamp %>', ssl: true} var viewer = vuzit.Viewer.fromId("<%= documentId %>", options); viewer.display(document.getElementById("vuzit_viewer"), { zoom: 1 }); } </script> </head> <body onload="initialize()"> <div id="vuzit_viewer" style="width: 650px; height: 500px;"></div> </body> </html> -------------------------------------------------- -- MORE INFORMATION -------------------------------------------------- For more information, including installation visit: http://vuzit.com/developer -------------------------------------------------- -- LICENSE -------------------------------------------------- Copyright (c) 2009-2010 Brent Matzelle, Vuzit LLC Released under the MIT license: http://www.opensource.org/licenses/mit-license.php This means you can use it in proprietary products. See LICENSE file. -------------------------------------------------- -- Feature Requests and Bug Reports -------------------------------------------------- Email to support AT vuzit DOT com
About
Java library for the Vuzit AJAX document viewer web services API
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published