<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Snowbound Software Imaging Technology Blog &#187; Programming Languages</title>
	<atom:link href="http://blog.snowbound.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.snowbound.com</link>
	<description>Accelerating the Document Revolution</description>
	<lastBuildDate>Thu, 09 Sep 2010 14:50:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>VirtualViewer AJAX</title>
		<link>http://blog.snowbound.com/40/virtualviewer-ajax/</link>
		<comments>http://blog.snowbound.com/40/virtualviewer-ajax/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 14:04:33 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Viewing]]></category>

		<guid isPermaLink="false">http://blog.snowbound.com/?p=40</guid>
		<description><![CDATA[I&#8217;ve been getting a lot of questions on the new VirtualViewer AJAX web viewer since its recent release, and I wanted to talk a little bit about it and hopefully answer some of those questions. Our Java Content Servlet-Applet viewer solution has been around for a long time now, and it has served its purpose [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been getting a lot of questions on the new <a href="http://www.snowbound.com/viewer_configurations/zero_footprint_option.html" rel="nofollow" title="VirtualViewer AJAX"  target="_blank">VirtualViewer AJAX</a> web viewer since its recent release, and I wanted to talk a little bit about it and hopefully answer some of those questions.</p>
<p>Our Java Content Servlet-Applet viewer solution has been around for a long time now, and it has served its purpose very well. Its main strength is its speed through our <a href="http://www.snowbound.com/viewer_benefit/highspeed_viewing.html" rel="nofollow" >Page on Demand™</a> approach, and has a rich functionality including annotation, page manipulation, bookmarking, and easy navigation. However, it still has the limitation of needing a JVM on the client in order to use the applet. While in many cases this is not a problem, companies have a need for a more streamlined approach, both for traditional internal users, and also for external users.</p>
<p>The external user presents to the technology provider the problems of both lack of control and lack of knowledge. Rather than take the chance that users have a JVM (or even the .NET Framework for that matter) and, if they don&#8217;t, hope that they would have the knowledge or inclination to get one, it is much easier to go with a solution that simply works with a web browser. If they don&#8217;t have a web browser, then they&#8217;re likely irrelevant anyway.</p>
<p>Using AJAX to build a viewer seemed to make a lot of sense. So we built a zero-footprint client to complement our Applet, using the same tested back-end Content Server, that needed only a web browser to work. This allowed us to still utilize the speed of Page On Demand, and present a similar interface that our customers were used to, but go completely independent of client platform.</p>
<p>The new VirtualViewer AJAX supports the same <a href="http://www.snowbound.com/format/format_overview.html" rel="nofollow" title="Format List"  target="_blank">formats</a> as our other solutions (PDF, Word, TIFF, etc), and allows users to annotate on those formats, including highlighting, arrows, sticky notes, and more. It creates thumbnails on-the-fly, has easy zooming and panning controls, allows you to directly jump to any page in the document, and you can print documents, or even export them to the local system.</p>
<p>The AJAX viewer has a slick, easy to use interface (at least I think so), and can easily be customized by modifying the included style sheets (.css), or by creating your own. The viewer is easily embeddable within other web applications, and any of the features can be removed if needed.</p>
<p>Currently the AJAX server is available in Java, but soon it will have a .NET version as well. That will give our customers the freedom to choose the server-side platform that best fits their environment, but both will present an identical interface on the client-side.</p>
<p>As time goes on, we will utilize the features developed for the Java applet and adapt them to an AJAX architecture, along with our unique imaging expertise, to further enhance the value of the zero-footprint solution.</p>
<p>I hope that covers many of the questions I have been getting over the last few weeks, although I know there are always more. Look for more posts concerning this topic in the future, both from a high-level and a technical perspective.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.snowbound.com/40/virtualviewer-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing Documents on the Fly with VirtualViewer AJAX</title>
		<link>http://blog.snowbound.com/28/changing-documents-on-the-fly-with-virtualviewer-ajax/</link>
		<comments>http://blog.snowbound.com/28/changing-documents-on-the-fly-with-virtualviewer-ajax/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 14:47:29 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Viewing]]></category>

		<guid isPermaLink="false">http://blog.snowbound.com/?p=28</guid>
		<description><![CDATA[Many of the customers interested in our new AJAX viewer are looking to embed a viewer in an existing web page.  In this case, the traditional mechanism of specifying the document within the page URL may not be sufficient.  In this case, we have provided an alternative mechanism for specifying the document via JavaScript. myFlexSnap.setDocumentId("insertDocumentIdHere"); [...]]]></description>
			<content:encoded><![CDATA[<p>Many of the customers interested in our new <a href="http://www.snowbound.com/viewer_configurations/zero_footprint_option.html" rel="nofollow" title="AJAX Zero Footprint Viewer" >AJAX viewer</a> are looking to embed a viewer in an existing web page.  In this case, the traditional mechanism of specifying the document within the page URL may not be sufficient.  In this case, we have provided an alternative mechanism for specifying the document via JavaScript.</p>
<p><code>myFlexSnap.setDocumentId("insertDocumentIdHere");<br />
myFlexSnap.init();</code></p>
<p>In this example, you simply replace <code>insertDocumentIdHere</code> with the <code>documentId</code> you want to load.  The call to the <code>init()</code> method will re-initialize the viewer and ensure that the image and thumbnails are reloaded.<span id="more-28"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.snowbound.com/28/changing-documents-on-the-fly-with-virtualviewer-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JDBC Content Handler for VirtualViewer</title>
		<link>http://blog.snowbound.com/9/jdbc-content-handler-for-virtualviewer/</link>
		<comments>http://blog.snowbound.com/9/jdbc-content-handler-for-virtualviewer/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 20:39:27 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Content Handler]]></category>
		<category><![CDATA[Imaging Technology]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.snowbound.com/?p=9</guid>
		<description><![CDATA[One way the VirtualViewer Java servlet can be extended is by customizing the content handler on the backend of the servlet, allowing for tighter integration into content repositories or databases. PostgreSQL is an object-relational database management system licensed under the BSD license which has a strong industry backing and a number of different APIs including [...]]]></description>
			<content:encoded><![CDATA[<p>One way the VirtualViewer Java servlet can be extended is by customizing the content handler on the backend of the servlet, allowing for tighter integration into content repositories or databases. PostgreSQL is an object-relational database management system licensed under the BSD license which has a strong industry backing and a number of different APIs including C/C++, Perl, Python, PHP, and JDBC which allow for database transactions to be written in your language of choice.</p>
<p>For this setup, I used PostgreSQL v8.3.0 with the JDBC3 PostgreSQL Driver v8.3-603 and ran the VV servlet under Apache Tomcat v6.06. Instructions for installing PostgreSQL with vary depending upon your platform of choice, but there are plenty of setup guides to be found&#8211; I personally find it easer to setup and interact with databases up under Linux Since the content handler will later be built against the JDBC PostgreSQL driver, I found it helpful to build this from source for debugging.</p>
<p>The default content handler shipped with VirtualViewer can be easily extended to save binary data into a PostgreSQL database using the saveFileBytes() and getFileBytes() methods. By default, this is where the file I/O occurs for all documents and metadata in the content handler. Instead of going to disk, we use JDBC calls to access a table in our database and retrieve the appropriate content.</p>
<p><strong>Step 0:</strong> Get PostgreSQL or your DB of choice installed and all that good stuff.</p>
<p><strong>Step 1:</strong> Create new table in the database to hold our documents and metadata. I choose to associate both with the bytea data type, so I created a table like so:</p>
<p style="padding-left: 30px;">CREATE TABLE images (imgname text, img bytea);</p>
<p><strong>Step 2:</strong> Create custom content handler. I created an insertViaJDBC() method to be called from saveFileBytes() which took in a file name and byte[] array to be inserted into the database:</p>
<p style="padding-left: 30px;">DataInputStream dis = new DataInputStream(<br />
new ByteArrayInputStream( filebytes ));<br />
PreparedStatement ps =<br />
conn.prepareStatement(&#8220;INSERT INTO images VALUES (?, ?)&#8221;);<br />
ps.setString(1, filename);<br />
ps.setBinaryStream(2, dis, filebytes.length);<br />
ps.executeUpdate();</p>
<p>Likewise, I created a fetchViaJDBC() method to be called from getFileBytes() which took in a file</p>
<p style="padding-left: 30px;">PreparedStatement ps =<br />
conn.prepareStatement(&#8220;SELECT img FROM images WHERE imgname=?&#8221;);<br />
ps.setString(1, filename);<br />
ResultSet rs = ps.executeQuery();<br />
if ( rs != null ) {<br />
while( rs.next() )<br />
filebytes = rs.getBytes(1);<br />
rs.close();<br />
}</p>
<p>This all standard JDBC code adapted from the manual pages. PostgreSQL can store binary data in two ways, with either the binary bytea data type or the large object feature. I did not implement the large object feature, but depending upon your document imaging needs, you should choose accordingly.</p>
<p><strong>Step 3:</strong> Modify the servlet web.xml to point to your content handler. This is the only change to the web.xml you must make, but I also added in parameters for the database such as username, password and hostname. These parameters can then be referenced via your content handler and used in your JDBC methods. In my case, I grabbed these parameters in my content handler init() method. I also removed parameters for filePath and overPath from the web.xml since my content handler isn&#8217;t going to disk anymore for documents.</p>
<p>If you&#8217;ve implemented the content handler this far, you&#8217;ll noticed you&#8217;ve got a few problems wit annotations when you try and use it. This is because you&#8217;ll need to devise an alternative method for handling annotation layer names that doesn&#8217;t depend on file I/O. It&#8217;s fairly straightforward, basically just moving from files to String when you’re dealing with document paths. I ended up changing the method signature on both getFileBytes() and saveFileBytes() to accept a String for a file name instead of a File object&#8211; this also made for handling JDBC calls a little more logical.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.snowbound.com/9/jdbc-content-handler-for-virtualviewer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Popular Java Imaging Technology Posts from Imaging Experts</title>
		<link>http://blog.snowbound.com/8/java-imaging-technology-posts-from-imaging-experts/</link>
		<comments>http://blog.snowbound.com/8/java-imaging-technology-posts-from-imaging-experts/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 19:58:59 +0000</pubDate>
		<dc:creator>Snowbound Software</dc:creator>
				<category><![CDATA[Imaging Technology]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming Languages]]></category>

		<guid isPermaLink="false">http://blog.snowbound.com/?p=8</guid>
		<description><![CDATA[As we work to fully integrate our blog posts and discussions on document and web imaging technology to our new Snowbound Blog, here are a select group of popular posts from Imaging Experts, which our readers may find of value. JavaScripting in Applets &#8211; Getting Out of the SandboxA discovery with regards to using JavaScript [...]]]></description>
			<content:encoded><![CDATA[<p>As we work to fully integrate our blog posts and discussions on document and web imaging technology to our new Snowbound Blog, here are a select group of popular posts from Imaging Experts, which our readers may find of value.</p>
<ul>
<li><a href="http://imagingexperts.typepad.com/imaging_experts/2006/10/javascripting_i.html" rel="nofollow" >JavaScripting in Applets &#8211; Getting Out of the Sandbox</a><br/>A discovery with regards to using JavaScript with Applets, and trying to avoid running into security problems.  There is a way to break out of the sandbox, via signing. Here is an example&#8230;</li>
<li><a href="http://imagingexperts.typepad.com/imaging_experts/2006/12/another_neat_tr.html" rel="nofollow" >Another Neat Trick with the Ant</a><br/>Even though the Ant has plenty of available tasks out of the box and a wealth of 3rd party tasks already defined, you still may wish to improve your build process by creating your own custom tasks.</li>
<li><a href="http://imagingexperts.typepad.com/imaging_experts/2006/02/using_awt_depen.html" rel="nofollow" >Using AWT Dependent Imaging Routines in SWT</a><br/>If you had code that relied heavily on its interaction with the AWT-based Java2D drawing routines, how could you port that over to a new SWT-based program?  This post illustrates one method for doing so.</li>
<li><a href="http://imagingexperts.typepad.com/imaging_experts/2006/09/serialization_a.html" rel="nofollow" >Serialization: Avoiding a NotSerializableException with the Transient Keyword</a><br/>When you are writing client-server software with Java, it&#8217;s often convenient to pass Java objects from the client to the server. Java Serialization allows classes to be converted to a string format, allowing for easy network transmission</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.snowbound.com/8/java-imaging-technology-posts-from-imaging-experts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
