<?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>Christophe Coenraets &#187; LCDS</title>
	<atom:link href="http://coenraets.org/blog/tag/lcds/feed/" rel="self" type="application/rss+xml" />
	<link>http://coenraets.org/blog</link>
	<description>Rich Internet Applications, Flex, AIR, Java, Android</description>
	<lastBuildDate>Fri, 23 Jul 2010 14:45:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>InSync: Automatic Offline Data Synchronization in AIR using LCDS 2.6</title>
		<link>http://coenraets.org/blog/2008/05/insync-automatic-offline-data-synchronization-in-air-using-lcds-26/</link>
		<comments>http://coenraets.org/blog/2008/05/insync-automatic-offline-data-synchronization-in-air-using-lcds-26/#comments</comments>
		<pubDate>Tue, 20 May 2008 03:31:15 +0000</pubDate>
		<dc:creator>Christophe Coenraets</dc:creator>
				<category><![CDATA[Air]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[LCDS]]></category>
		<category><![CDATA[SQLite]]></category>
		<category><![CDATA[Offline]]></category>

		<guid isPermaLink="false">http://coenraets.org/blog/?p=80</guid>
		<description><![CDATA[LCDS 2.6 allows you to build AIR applications with automatic offline data synchronization. This feature leverages the SQLite relational database system embedded in the AIR runtime, but the advantage is that the data synchronization process is entirely automatic: you don’t have to write SQL statements or synchronization logic to keep your local database in sync [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://coenraets.org/apps/insync/insync1.png" alt="" /></p>
<p><img src="http://coenraets.org/apps/insync/insync2.png" alt="" /></p>
<p>LCDS 2.6 allows you to build AIR applications with automatic offline data synchronization. This feature leverages the SQLite relational database system embedded in the AIR runtime, but the advantage is that the data synchronization process is entirely automatic: you don’t have to write SQL statements or synchronization logic to keep your local database in sync with your central database.</p>
<p>I have been getting a number of questions related to this feature, so I decided to build a sample application that demonstrates how it works.<br />
<span id="more-80"></span><br />
In this application the synchronization process is implicit. When you are online, the cache (a SQLite database) is automatically updated along with the server database to make sure the user can go offline with the latest data without explicitly triggering a synchronization process. When you are offline, the changes are saved in the local cache. If the network becomes available while working in the application, the application will detect the network status change and automatically synchronize data (send your offline changes to the server, and get changes made by other users while you were offline).</p>
<h3>Installation Instructions</h3>
<ol>
<li>If you haven&#8217;t already done so, <a href="http://labs.adobe.com/technologies/livecycle_dataservices2_6/">install LCDS 2.6</a>.</li>
<li>Unzip <a href="http://coenraets.org/apps/insync/insync.zip">insync.zip</a></li>
<li>Copy the content of the sampledb folder in the sampledb folder of your existing LCDS directory</li>
<li>Copy the content of the tomcat folder in the tomcat folder of your existing LCDS directory</li>
<li>Add the following destination to data-management-config.xml
<p><pre class="brush: xml;">
&lt;destination id=&quot;insync&quot;&gt;
    &lt;adapter ref=&quot;java-dao&quot; /&gt;
    &lt;properties&gt;
        &lt;source&gt;lcds.samples.contact.ContactAssembler&lt;/source&gt;
        &lt;scope&gt;application&lt;/scope&gt;
        &lt;metadata&gt;
            &lt;identity property=&quot;contactId&quot; undefined-value=&quot;0&quot;/&gt;
        &lt;/metadata&gt;
    &lt;/properties&gt;
&lt;/destination&gt;
</pre>
</p>
</li>
<li>Restart the sample database: run sampledb.bat (Windows) or sampledb.sh (Unix) in the sampledb directory</li>
<li>Restart your application server</li>
</ol>
<h3>Quick Tour</h3>
<ol>
<li>Install and run the AIR application. Notice the green light in the status bar indicating that the application is in online mode.
<p><div id="flashcontent6465" style="width:215px; height:180px;"><strong>Please upgrade your Flash Player</strong> This is the content that would be shown if the user does not have Flash Player 9.0.115 or higher installed.</div><script type="text/javascript">
<!-- // <![CDATA[
var so = new SWFObject("http://coenraets.org/blog/wp-content/plugins/air-badge/AIRInstallBadge.swf", "Badge", "215", "180", "9.0.115", "#FFFFFF");
so.useExpressInstall("http://coenraets.org/blog/wp-content/plugins/air-badge/expressinstall.swf");
so.addVariable("airversion", "1.0");
so.addVariable("appname", "sqliteadmin");
so.addVariable("appurl", "http://coenraets.org/apps/insync/insync.air");
so.addVariable("appid", "sqliteadmin");
so.addVariable("pubid", "");
so.addVariable("appversion", "v1.0");
so.addVariable("imageurl", "http://coenraets.org/apps/insync/insync1.png");
so.addVariable("appinstallarg", "installed from web");
so.addVariable("applauncharg", "launched from web");
so.addVariable("helpurl", "help.html");
so.addVariable("hidehelp", "true");
so.addVariable("skiptransition", "false");
so.addVariable("titlecolor", "#00AAFF");
so.addVariable("buttonlabelcolor", "#00AAFF");
so.addVariable("appnamecolor", "#00AAFF");
so.addVariable("str_err_airswf", "<u>Running locally?</u><br/><br/>The AIR proxy swf won't load properly when this is run from the local file system.");
so.write("flashcontent6465");
// ]]&gt; -->
</script>

</p>
</li>
<li>Double click a contact to view the contact details.</li>
<li>Modify the data in a few fields and click Save. Your server console indicates that the contact has been updated.</li>
<li>Click the + button in the application title bar. Enter a first name, last name, etc and click Save. Your server console indicates that the contact has been updated.</li>
<li>Shut down the server</li>
<li>Notice that the green light turns grey to indicate that the application is now working in offline mode.</li>
<li>Repeat steps 2 to 4 above: changes are saved locally. Notice that the offline status (not modified, created, or updated is displayed in the contact form (bottom left corner)</li>
<li>Restart the server.</li>
<li>The green light appears in that status bar as soon as the server is up and running. Notice that LCDS automatically detects the offline changes and sends them to the server.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://coenraets.org/blog/2008/05/insync-automatic-offline-data-synchronization-in-air-using-lcds-26/feed/</wfw:commentRss>
		<slash:comments>60</slash:comments>
		</item>
	</channel>
</rss>
