<?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>Encryptec Limited</title>
	<atom:link href="http://encryptec.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://encryptec.net</link>
	<description>Secure Internet solutions and business services</description>
	<lastBuildDate>Wed, 14 Sep 2011 14:30:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>New Office</title>
		<link>http://encryptec.net/2010/09/new-office/</link>
		<comments>http://encryptec.net/2010/09/new-office/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 16:00:47 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=6632</guid>
		<description><![CDATA[We now have a new location in Cheltenham! It&#8217;s all on the same switchboard so there are no new numbers, but it does mean we&#8217;re very conveniently situated with regards to hosting services and anything needing lots of cost-effective bandwidth. (And it means you can come and see us without entering Wales!)]]></description>
			<content:encoded><![CDATA[<p>We now have a new location in Cheltenham! It&#8217;s all on the same switchboard so there are no new numbers, but it does mean we&#8217;re very conveniently situated with regards to hosting services and anything needing lots of cost-effective bandwidth. (And it means you can come and see us without entering Wales!)</p>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/09/new-office/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Encryptec Office Solutions</title>
		<link>http://encryptec.net/2010/09/encryptec-office-solutions/</link>
		<comments>http://encryptec.net/2010/09/encryptec-office-solutions/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 16:26:11 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[Announcments]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=6572</guid>
		<description><![CDATA[For many years Encryptec have offered and been providing Open Source based office solutions on a relatively small scale. After seeing the stability of these systems in the workplace we&#8217;re now making these services available to a wider audience. Please check out our PDF spec sheet, available for download here.]]></description>
			<content:encoded><![CDATA[<p>For many years Encryptec have offered and been providing Open Source based office solutions on a relatively small scale. After seeing the stability of these systems in the workplace we&#8217;re now making these services available to a wider audience.</p>
<p><span id="more-6572"></span>Please check out our PDF spec sheet, available for <a href="/wp-content/uploads/2010/09/BrochureNew.pdf">download here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/09/encryptec-office-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encryptec Broadband</title>
		<link>http://encryptec.net/2010/09/encryptec-broadband/</link>
		<comments>http://encryptec.net/2010/09/encryptec-broadband/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 16:40:54 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[Announcments]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=6492</guid>
		<description><![CDATA[It&#8217;s finally arrived! We can now provide ADSL connections &#8216;through&#8217; our own racks in Cheltenham. It&#8217;s not the cheapest connection in the World bit it is at 24Mbps and we can do discounts for existing customers.﻿﻿ Details here]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s finally arrived! We can now provide ADSL connections &#8216;through&#8217; our own racks in Cheltenham. It&#8217;s not the cheapest connection in the World bit it is at 24Mbps and we can do discounts for existing customers.﻿﻿</p>
<p><span id="more-6492"></span></p>
<p><a href="http://encryptec.net/services/business-broadband/">Details here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/09/encryptec-broadband/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Products</title>
		<link>http://encryptec.net/2010/08/new-products/</link>
		<comments>http://encryptec.net/2010/08/new-products/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 16:26:18 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=6102</guid>
		<description><![CDATA[We&#8217;ve just added hardware to our portfolio with the introduction of our very own 2U Linux server. This is based on the servers we started building and using ourselves 8 months ago and is designed to outperform machines with 4 times it&#8217;s price tag.  Details here &#8230;]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just added <em>hardware</em> to our portfolio with the introduction of our very own 2U Linux server. This is based on the servers we started building and using ourselves 8 months ago and is designed to outperform machines with 4 times it&#8217;s price tag.  <span id="more-6102"></span><a href="http://encryptec.net/services/hardware/">Details here &#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/08/new-products/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UK Network Outage</title>
		<link>http://encryptec.net/2010/07/uk-network-outage/</link>
		<comments>http://encryptec.net/2010/07/uk-network-outage/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 21:04:30 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[network outage]]></category>
		<category><![CDATA[traffic graphs]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=5092</guid>
		<description><![CDATA[For anyone wondering what happened yesterday &#8211; it wasn&#8217;t us! This was for around 20 minutes and hit most parts of the Internet in the UK, whereas you might&#8217;ve been able to get some International sites like Google, pretty much everything UK based would have been inaccessible. Details available on The Register. You can see [...]]]></description>
			<content:encoded><![CDATA[<p>For anyone wondering what happened yesterday &#8211; it wasn&#8217;t us! This was for around 20 minutes and hit most parts of the Internet in the UK, whereas you might&#8217;ve been able to get some International sites like Google, pretty much everything UK based would have been inaccessible.</p>
<p>Details available on <a href="http://www.theregister.co.uk/2010/07/22/linx_downtime/">The Register</a>.</p>
<p>You can see the effect of t he outage on LINX&#8217;s traffic graphs for the period &#8230;</p>
<p><a href="http://encryptec.net/wp-content/uploads/2010/07/day.gif"><img class="alignleft size-full wp-image-5102" title="day" src="http://encryptec.net/wp-content/uploads/2010/07/day.gif" alt="" width="533" height="192" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/07/uk-network-outage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load Balancing Phase II</title>
		<link>http://encryptec.net/2010/07/load-balancing-phase-ii/</link>
		<comments>http://encryptec.net/2010/07/load-balancing-phase-ii/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 13:35:58 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[benchmarks]]></category>
		<category><![CDATA[load balancing]]></category>
		<category><![CDATA[page delivery]]></category>
		<category><![CDATA[speed increase]]></category>
		<category><![CDATA[web pages]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=4982</guid>
		<description><![CDATA[We&#8217;re now starting to move services onto our new load-balanced platform. In particular, for WordPress sites using SuperCache you can expect to see a x10 speed increase in terms of page delivery. (although you won&#8217;t see this directly as your bandwidth / browser will be unable to keep up) Benchmarks are showing that the new [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>We&#8217;re now starting to move services onto our new load-balanced platform. In particular, for WordPress sites using SuperCache you can expect to see a x10 speed increase in terms of page delivery. (although you won&#8217;t see this directly as your bandwidth / browser will be unable to keep up)</p>
<p>Benchmarks are showing that the new system can deliver WordPress based web pages at a rate of 20M bytes / second.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/07/load-balancing-phase-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bandwidth failover &#8230;</title>
		<link>http://encryptec.net/2010/06/bandwidth-failover/</link>
		<comments>http://encryptec.net/2010/06/bandwidth-failover/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 14:16:33 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=4922</guid>
		<description><![CDATA[The DataCenter just experienced a connectivity failure, yet another well-done and many thanks to our friends at British Telecom. This time backups / fail-over&#8217;s cut in so the interruption in service was literally only a couple of minutes, maybe now BT are making a healthy profit, some of that money will get pumped back into [...]]]></description>
			<content:encoded><![CDATA[<p>The DataCenter just experienced a connectivity failure, yet another well-done and many thanks to our friends at British Telecom. This time backups / fail-over&#8217;s cut in so the interruption in service was literally only a couple of minutes, maybe now BT are making a healthy profit, some of that money will get pumped back into their infrastructure (!)</p>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/06/bandwidth-failover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>And again &#8230;</title>
		<link>http://encryptec.net/2010/05/and-again/</link>
		<comments>http://encryptec.net/2010/05/and-again/#comments</comments>
		<pubDate>Wed, 19 May 2010 18:37:27 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=4882</guid>
		<description><![CDATA[Another problem yesterday (18th May) took parts of the service off-line again. This time the power went off when an engineer fell off a ladder onto the UPS unit providing power to the suite in which our kit resides. Although power was restored relatively quickly as were some services, disk / file-system corruption hampered reboots [...]]]></description>
			<content:encoded><![CDATA[<p>Another problem yesterday (18th May) took parts of the service off-line again. This time the power went off when an engineer fell off a ladder onto the UPS unit providing power to the suite in which our kit resides. Although power was restored relatively quickly as were some services, disk / file-system corruption hampered reboots on other machines. That said pretty much everything was back on-line within around 70 minutes so generally the outage would have been noticed between 12 noon and ~1pm. Hopefully we&#8217;ve now filled our quota of bad luck for this decade &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/05/and-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Center Outage &#8230;</title>
		<link>http://encryptec.net/2010/04/data-center-outage/</link>
		<comments>http://encryptec.net/2010/04/data-center-outage/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 22:05:36 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=4532</guid>
		<description><![CDATA[We suffered major outage today at our Data Center, or rather our Data Center suffered an outage which resulted in all our kit not being accessible from the outside world. As far as we can tell the core router supplying the data center blew all of it&#8217;s redundant power supplies simultaneously, knocking all connectivity off-line. [...]]]></description>
			<content:encoded><![CDATA[<p>We suffered major outage today at our Data Center, or rather our Data Center suffered an outage which resulted in all our kit not being accessible from the outside world. As far as we can tell the core router supplying the data center blew all of it&#8217;s redundant power supplies simultaneously, knocking all connectivity off-line. The problem was compounded by a number of associated communications systems (PBAX&#8217;s etc) also being taken off-line, thus limiting on-site communications.</p>
<p>Here&#8217;s the feedback from the Engineers;﻿</p>
<blockquote><p>Around 11:16pm our primary power supply failed in our Cisco core, and shortly after it’s second PSU also blew, taking out the breaker on the comms cabinet in room one. We tried to repair the PSU at circuit level but alas, were unsuccessful and declared it a lost cause at approx 1am. We tried to introduce our foundry router to the THN links but a fault light was on the BT Openreach WES box, so we called the BT NOC at around 1:45am to report a fault on the circuits. We were replied to at around 2:15am with “no fault found” , “customer equipment faulty” – Following this we spent the next few hours attempting a workaround with three different switches, LH/LX optics etc. – All with the same result.</p>
<p>At 8am, Hardware.com despatched two replacement PSU’s by dedicated delivery driver, these only arrived just after 11am. The switch was up and running, and as logs show, customer racks were reconnected at around 11:15am, but our main fibre and redundant pair were both*still* showing faults on the NTE unit. BT Openreach were called again at around 12 noon, and we demanded site presence. The engineer arrived onsite first at 3pm, then 4pm, having completed “end to end loopback” tests on both fibre pairs – No fault found.  I then took it upon myself to close the front gate and take hostage the BT Openreach engineer, who was determined he was finishing his shift, and would return the following day – Naturally, this wasn’t going to happen. After quizzing him repeatedly regarding whether his colleague at Star in Barnwood, had ruled out the line card or done a reboot, I finally convinced him to pull the card at the remote end for a cold reboot.</p>
<p>At around 5:30pm the first fibre pair became active, green lights, and we began exchanging packets of data with Telehouse North once again.</p></blockquote>
<p>Many thanks to the guys at the Data Center who stuck with the fault from 11:16pm last night until 5:45pm today when BT managed to get the circuits back on-line. Time for a well-earned rest. Following on, this is the work currently underway to mitigate the effects any such future problems;</p>
<blockquote><p>We have placed on order, two Cisco 6509-E chassis, two Sup 720 3B cards, and a plethora of Cisco line cards, with spare optics etc. Shortly we&#8217;ll have a pair of fully redundant cores, powered from a pair of separate Riello UPS systems, A + B fed power supplies in each unit. Our Gas Turbines and new 11Kv feed are already onsite and ready for commissioning at the beginning of next month, and we’ll be posting various photographs of the hardware, power circuitry, and our new suite.</p></blockquote>
<p>The Date Center&#8217;s website (Saxon Data) can be <a href="http://www.saxondata.co.uk" target="_blank">found here</a>.</p>
<h3>Post Mortem from the Data Center Team (May 7)</h3>
<p>Saxon Data Incident Report<br />
Date of Incident           :       2010-04-19<br />
Incident Type              :       Communications Loss</p>
<h4>What happened</h4>
<p>At 23:30 (BST) on Monday, 19th April 2010, we experienced a multiple power supply failure to our Cisco 6509 router directly impacting connectivity to Saxon House. Replacement PSU’s were immediately sourced from our hardware vendor but were unavailable until the following morning.</p>
<p>At 10:24, the replacement PSU’s arrived and were fitted by on-site engineers. The router booted successfully but failed to establish a layer 1 connection to our Telehouse router located in London, Docklands. Upon further investigation, the BT’s remote NTE which carries the first leg of layer 1 fibre connectivity to London, had appeared to reset during the outage.</p>
<p>A BT engineer was dispatched to the local Barnwood exchange to diagnose and correct the outstanding fault. At 17:30, full connectivity was restored and services resumed.</p>
<h4>What we learned</h4>
<ol>
<li>Redundant power supplies are not always enough to ensure that a router stays up.</li>
<li>Our fallback procedure doesn’t allow us to communicate with all of our customers in a timely manner.</li>
<li>Multiple, coincidental failures are more common than we appreciate.</li>
</ol>
<h4>What we are doing to improve</h4>
<p>Obviously, our customers cannot tolerate this length of outage and we must make sure that we minimalise the risk of anything similar happening again. To that end, we are bringing forward the acquisition of another Cisco router which should be installed by the time this weekend is out. For the technical people out there, we will be running our new cores on the following rig:</p>
<p><span style="text-decoration: underline;"><strong>Router 1</strong></span><br />
Cisco 6509 Chassis<br />
2 x 2500W Power Suplies<br />
1 x High speed fan tray (plus 1 spare for each router)<br />
1 x WS-SUP720-3B-GR3 – Supervisor fabric (handling main inbound dual fibre feeds)<br />
1 x WS-X6748-GE-TX-GR3 – 48 port Gigabit line cards for customer racks<br />
1 x WS-X6724-SFP-GR3 – 24 Port SFP fibre card for customer racks</p>
<p><strong><span style="text-decoration: underline;">Router 2</span></strong><br />
Cisco 6509 Chassis<br />
2 x 1300W Power supplies<br />
1 x High speed fan tray (plus 1 spare for each router)<br />
1 x WS-SUP720-GR3<br />
1 x 16 port classic fibre card<br />
1 x 48 port Ethernet card</p>
<p>We’ll be running dual OSPF sessions (1 per router) to the KCN rack in Telehouse North, over the existing BT NTE equipment and also the second, redundant fibre. This will mean if any part of a router fails, we have a spare onsite and if a complete catastrophic failure occurs, it’s a matter of several minutes work by hands to swap everyone over to the spare box.</p>
<p>We’re currently holding over 150 pieces of spare SFP optics – SX and LH/LX, so a trivial failure of one single port is catered for also.</p>
<p>Each router will be power from independent N+1 UPS feeds, and this will also be an available option to rack customers at some time real soon.</p>
<p>In addition, we have a 2 hour service contract arranged with Hardware.com who are based in Cirencester – 20 minutes from us.</p>
<p>We’re also bringing forward investment in our Power generation and UPS infrastructure to maintain a high degree of redundancy. As an example, we have taken delivery of three Riello master plus units to be run in parallel, and have another one on the way, which will bring us up to a total 400kva 2N.</p>
<p>All units have output transformers, and input rectifiers, 8 minutes battery autonomy at full load. We have arranged to light the second fibre in the BT OpenReach blowpipe, and to have it bypass the NTE equipment at both ends of the circuit, ensuring that a failing NTE can no longer cause failure of the data path.</p>
<p>We are working to ensure that an off-site copy of the ticketing system will be available in the future in the event that the data centre suffers a communications outage.</p>
<p>As we expand we will install a second, diverse fibre feed to avoid further downtime due to events such as fibre damage during civil engineering work. We have meetings with two major communications providers in the next month, both of whom are eager to discuss POPing our building with their own Dark Fibre feeds. Naturally, this would be a massive advantage to both the facility and its customers, so we’ll keep you all updated.</p>
<h4>Timescale / router upgrade plans</h4>
<p>On Thursday 6th we are looking to receive the last of the parts for the new router and will have fresh Multimode cable into each rack. The new router will at first be placed in line with the old one and all customer VLANs will continue to be fed from the old system. Customers will be notified of the exact time of this emergency changeover. As settings will be done beforehand, this should result in an outage of less than 10 seconds, whilst the fibres are swapped over.</p>
<p>We’ll let everyone know once this phase is complete and invite service tickets, where you will get the chance to specify the exact time of day we switch you over to the new core. We plan on leaving the old fibres into each rack for extra redundancy and to save time should a cabling fault ever affect you.</p>
<p>Once everyone is over to the new router, we’ll be looking to pull the old 6509 chassis and replace with the new spare unit / Sup card / PSU’s etc. And setup the second fibre link.</p>
<p>Naturally, we’ll keep everyone informed throughout the whole process by email and if anyone has any questions, please feel free to call / email.</p>
<p>Please accept our most sincere and deepest apologies and feel free to copy this document to any of your clients who may be asking questions of you. You can all rest assured that the process of upgrading connectivity, power and UPS / generation is completely underway and will result in a highly resilient DC infrastructure in a very short while.</p>
<p>Thanks<br />
Saxon Data technical support team.</p>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/04/data-center-outage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming 2.0</title>
		<link>http://encryptec.net/2010/04/programming-2-0/</link>
		<comments>http://encryptec.net/2010/04/programming-2-0/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 12:37:47 +0000</pubDate>
		<dc:creator>Gareth Bult</dc:creator>
				<category><![CDATA[Coding Examples]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://encryptec.net/?p=3942</guid>
		<description><![CDATA[If you've familiar with HTML and have ever looked at new Web 2.0 applications and thought 'wow, that looks difficult', don't be fooled, what you're seeing is typically far easier to achieve that using traditional programming techniques.
Just to prove it, here's a quick tutorial ...]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve familiar with HTML and have ever looked at new Web 2.0 applications and thought &#8216;wow, that looks difficult&#8217;, don&#8217;t be fooled, what you&#8217;re seeing is typically far easier to achieve than using traditional programming techniques.</p>
<p>Here&#8217;s a quick-start guide to Web programming with <a href="http://extjs.com" target="_blank">ExtJS</a>, one of the many options out there if you want to write modern online applications. (For a taster of what can be achieved, please take a look at the <a href="http://www.extjs.com/deploy/dev/examples/" target="_blank">ExtJS demos</a>)</p>
<h3>What you will need</h3>
<p>First you&#8217;ll want a web server with PHP installed, typically using your local desktop machine will be quite sufficient and indeed all the components required are included in most standard Linux distributions. Also, I&#8217;m going to show you how to extract information from an SQL database, so you&#8217;ll want to install a copy of MySQL and the PHP/MySQL interface.</p>
<h3>Setting up</h3>
<p>Next you&#8217;ll want a copy of <a href="http://www.extjs.com/products/js/download.php?dl=extjs32&amp;ref=extjsgreenbutton" target="_blank">ExtJS</a>, so down load either version&#8217;s 3.1 or 3.2 from ExtJS.com and unpack them into the root folder of your webserver, on Linux this is usually <strong>/var/www</strong>.  For convenience, copy the contents (including sub-folders) of <strong>extjs/examples/direct/php</strong> into <strong>/var/www/remote, </strong>this folder contains the files you&#8217;ll need to allow your browser based application to talk to your server.</p>
<h3>Now for some html</h3>
<p>Create a file in <strong>/var/www</strong> called <strong>index.html</strong> and paste in the following;</p>
<pre>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;EXTJS Example&lt;/title&gt;
&lt;link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" /&gt;
&lt;script type="text/javascript" src="extjs/adapter/ext/ext-base.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="extjs/ext-all-debug.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="remote/api.php"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="example.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>A bit of JavaScript</h3>
<p>Next we&#8217;re going to load some javascript into <strong>example.js</strong>, this should also sit in <strong>/var/www</strong> and is referenced by the html file above. The &#8216;viewport&#8217; will render to the page or document <strong>body</strong> which was defined in the html file above as being empty.</p>
<pre>Ext.Direct.addProvider(Ext.app.REMOTING_API);

Ext.onReady(function(){
   var panel = new Ext.Viewport({
      layout   : 'fit',
        defaults : {
         border     : true,
         frame      : true
      },
      items : [grid]
   });
});</pre>
<p>Note that we&#8217;ve not yet defined <strong>grid</strong>, so this code needs also to come inside of the <strong>onReady</strong> function, but before the definition of the <strong>panel</strong> variable.</p>
<pre>var grid = new Ext.grid.GridPanel({
   store: store,
   columns: [
      { width: 100,   header: 'IP Address', dataIndex: 'ip'     },
      { width: 100,   header: 'Host Name',  dataIndex: 'name'   },
      { width: 100,   header: 'Status',     dataIndex: 'status' }
   ]
});</pre>
<p>As a little explanation; <strong>store</strong> is something else we&#8217;ve not yet defined. The the remainder of the code defines a table with columns &#8220;IP Address&#8221;, &#8220;Host Name&#8221; and &#8220;Status&#8221;. Next we need to define <strong>store</strong> which is the client side interface to the appropriate MySQL table, or to be more specific, MySQL query.</p>
<pre>store = function()
{
   return new Ext.data.DirectStore({
      directFn : direct.hostList,
      autoLoad : true,
      fields   : [
         { name: 'ip'     , type: 'string' },
         { name: 'name'   , type: 'string' },
         { name: 'status' , type: 'number' }
      ]
   });
}</pre>
<p>As far as code that&#8217;s going to run &#8216;in&#8217; your browser is concerned, we should be about done for the moment and the next snippets are code for the server side of the equation. First we start by editing <strong>config.php</strong> in your <strong>remote</strong> folder (this is the folder you created / copied above). You need to make it look like this;</p>
<pre>&lt;?php
$API = array(
   'direct'=&gt;array(
      'methods'=&gt;array(
         'hostList'=&gt;array( 'len'=&gt;1 )
      )
   )
);</pre>
<p>This is telling the ExtJS code how to locate the correct methods to call when your store components asks for it&#8217;s table to be populated with data. Next comes the scary PHP code, note that when you get to grips with this it&#8217;s really is pretty trivial.</p>
<p>The following needs to be called <strong>direct.php</strong> and goes into the <strong>direct/classes</strong> folder.</p>
<pre>&lt;?php

function report($code,$text) {
   return array( array('status'=&gt;$code,'text'=&gt;$text));
}

define('DB_NAME'      , '&lt;database&gt;');
define('DB_USER'      , '&lt;user&gt;');
define('DB_PASSWORD'  , '&lt;password&gt;');
define('DB_HOST'      , '&lt;host&gt;');

class direct {

   function hostList($data)
   {
      $db = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD,true);
      if(!db) return report(0,mysql_error());
      if(!mysql_select_db(DB_NAME)) return report(0,'Unable to select database');
      $sql = 'SELECT * FROM hosts';
      $results = mysql_query($sql,$db);
      if(!$results) return report(0,mysql_error());
      $out = array();
      while( $row = mysql_fetch_assoc($results) )
      {
         array_push($out,array('ip'=&gt;$row['ip'],'name'=&gt;$row['hostname'],'status'=&gt;$row['response']);
      }
      return $out;
   }
}</pre>
<p>For this to work you will obviously need to have a database with matching name and login credentials as specified in the four <strong>define</strong> lines. If you want to re-create this MySQL table, you will need something like;</p>
<pre>CREATE TABLE `hosts` (
   `id` smallint(6) NOT NULL AUTO_INCREMENT,
   `ip` varchar(15) DEFAULT NULL,
   `hostname` varchar(32) DEFAULT NULL,
   `response` varchar(15) DEFAULT NULL,
   PRIMARY KEY (`id`)
) ENGINE=MyISAM;</pre>
<h3>What does it look like</h3>
<p><img style="float: right; padding-left: 1em;" src="http://encryptec.net/wp-content/uploads/2010/04/Screenshot-1.png" alt="" width="322" height="172" />It may not be much to look at, but if you consider what you&#8217;re doing in the context of the framework, you already have something which can form the basis of a fairly complex application.</p>
<p>To see a &#8216;complete&#8217; online version in action, together with an &#8216;assembled&#8217; version of example.js, please <a href="http://encryptec.net/example.html"><strong><span style="color: #3366ff;">visit this link</span></strong></a>.</p>
<h3>Where to go from here?</h3>
<p>First you should add some error trapping, the roots of which are already inserted into <strong>direct.php</strong>, then you could try looking at passing parameters through to the store for filtered loads, and calling &#8216;Ext.direct&#8217; &#8216;directly&#8217; without going through a store (which is very useful for obtaining small amount of information or simply performing updates).</p>
<p>Expect to see some &#8216;complete&#8217; projects appear here over coming months .. <img title="Cool" src="http://encryptec.net/wp-content/plugins/editor-extender/plugins/emotions/img/smiley-cool.gif" border="0" alt="Cool" /></p>
]]></content:encoded>
			<wfw:commentRss>http://encryptec.net/2010/04/programming-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

