<?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>Syntactic sugar &#187; WPS</title>
	<atom:link href="http://syntacticsugar.nl/category/wps/feed/" rel="self" type="application/rss+xml" />
	<link>http://syntacticsugar.nl</link>
	<description>Random ramblings of another web-techy</description>
	<lastBuildDate>Sat, 09 Jan 2010 21:24:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Launched a new WPS-Demo website</title>
		<link>http://syntacticsugar.nl/2009/10/17/launched-a-new-wps-demo-website/</link>
		<comments>http://syntacticsugar.nl/2009/10/17/launched-a-new-wps-demo-website/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 16:12:05 +0000</pubDate>
		<dc:creator>buTTon</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Content Publishing]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WPS]]></category>
		<category><![CDATA[Content Management]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[Joomla]]></category>
		<category><![CDATA[Website Publication]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://syntacticsugar.nl/?p=266</guid>
		<description><![CDATA[For the dutchies , english folks check this page;
Op http://wps.i-v-o.nl/ staat sinds vandaag een vernieuwde demo-website van WPS.  Met deze demo-website kan je lezen over wat WPS is, wat het kan, hoe het werkt en je kan spelen met het systeem.
Wat is WPS
WPS staat voor Web Publishing System. Geen spannende afkorting, maar het dekt de [...]]]></description>
			<content:encoded><![CDATA[<p>For the dutchies , english folks check <a href="http://syntacticsugar.nl/wps/">this page</a>;</p>
<p>Op <a title="WPS demo website" href="http://demo.i-v-o.nl" target="_blank">http://wps.i-v-o.nl/</a> staat sinds vandaag een vernieuwde demo-website van WPS.  Met deze demo-website kan je lezen over wat WPS is, wat het kan, hoe het werkt en je kan spelen met het systeem.</p>
<h2>Wat is WPS</h2>
<p>WPS staat voor Web Publishing System. Geen spannende afkorting, maar het dekt de lading wel goed. WPS is namelijk geen klassiek Content Management Systeem (CMS) maar veel meer. Een klassiek CMS zorgt er eigenlijk alleen maar voor dat je de inhoud van je website kunt bewerken, dat doe je dan eigenlijk altijd op een aparte website (ook wel backend genoemd). Zo&#8217;n CMS is harstikke mooi, maar er moet ook een &#8216;voorkant&#8217;, je website, geprogrammeerd worden, en dat kan best een tijdrovende klus worden. WPS is een <em>publicatiesysteem</em> en zorgt dus niet alleen voor de CMS functie, maar ook voor het publiceren; de voorkant van je website.</p>
<p><span id="more-266"></span></p>
<h2>Publicatie-systeem</h2>
<p>Er zijn gerust wel andere publicatie-systemen, bijvoorbeeld Joomla of Wordpress, maar toch heeft I-V-O de keuze gemaakt om een heel nieuw systeem te ontwikkelen. Waarom? <strong>Flexibiliteit</strong>.<br />
De meeste andere systemen zijn nogal rigide in functionaliteit of opmaak, en dan nog maar niet te spreken over veiligheid. WPS is extreem flexibel door het gebruik van XML. Alle gegevens die in WPS rondgaan worden omgezet in XML en komen in 1 groot document samen; het WPSDoc. XML is een speciale manier van gegevens opmaak die zich uitermate goed leent tot &#8216;translaties&#8217;. Stel je voor dat je een tekst hebt ingevoerd en je wilt daar een deel van dikgedrukt maken; normaliter wordt dat in html aangegeven met de b-tag. In WPS wordt dit de bold-tag, niet &#8220;b&#8221;, en bij het publiceren van de pagina kan de programmeur dit transleren/vertalen naar de standaard &#8220;b&#8221;-tag, maar ook naar iets heel anders, bijvoorbeeld &#8220;strong&#8221; of &#8220;h1&#8243;.<br />
De taal die gebruikt wordt voor dit vertalen heet XSL-t, een soort HTML, maar dan met logica; je kan als programmeur o.a if-then-else, loops, en variabelen gebruiken. Hierdoor wordt de XML een stuk slimmer, en je site dus ook!</p>
<h2>Bewerken en beheren</h2>
<p>Wat WPS nog meer bijzonder maakt is de manier waarop je de teksten in je website kunt beheren; dit doe je namelijk gewoon <em>in</em> je site en niet op een aparte website of backend. Hierdoor zie je veel beter wat en waar je wat doet. Dit is veel gebruiksvriendelijker dan de standaard CMS&#8217;en en geeft veel beter weer wat de cohesie is tussen website en content.</p>
<h2>Plugins</h2>
<p>Een standaard WPS-site kan al heel veel;</p>
<ul>
<li>Pagina&#8217;s aanmaken, teksten maken en aanpassen</li>
<li>Meta-tags (voor zoekmachines) beheren</li>
<li>Linkjes in je teksten controleren of ze nog goed zijn</li>
<li>Bestanden (pdf&#8217;s, Word-documenten, plaatjes) uploaden</li>
<li>Een site in meerdere talen publiceren (en dat doet WPS heel slim want als je een pagina in het nederlands naar bijvoorbeeld het engels hebt vertaald dan weet WPS welke pagina&#8217;s bij elkaar horen, als een engels-sprekende op een nederlandse pagina komt kan hij/zij met 1 klik naar de engelse versie zonder de pagina opnieuw te moeten zoeken)</li>
<li>Rechten instellen per pagina</li>
</ul>
<p>Verder zijn er heel veel extra functies gemaakt in de vorm van &#8216;plugins&#8217;, een greep uit de collectie;</p>
<ul>
<li>Nieuws-plugin: zorgt voor het beheer en publicatie van nieuws-berichten (ook naar RSS!)</li>
<li>Poll-plugin: maak zelf een poll en zorg dat je bezoekers kunnen stemmen</li>
<li>Search-plugin : zorgt ervoor dat bezoekers kunnen zoeken in je website</li>
<li>Shop-plugin: volledige webwinkel, met betalingsmodule voor IDEAL en Mollie (micropayments)</li>
<li>Enquete-plugin: zeer uitgebreide plugin voor het maken van grote enquetes, compleet met uitnodigings-email-functie, toegangscodes en export-functies.</li>
<li>Catalogus/Portofolio-plugin: laat je bezoekers zien wat je verkoopt of wat je hebt gemaakt.</li>
<li>Download-beveiliging voor Audio: als je bijvoorbeeld muziek wilt laten horen vanaf je website via een zg. FlashPlayer dan zorgt WPS ervoor dat bezoekers niet stiekem de bestanden kunnen downloaden.</li>
<li>Google-Maps-plugin: zorgt ervoor dat je bezoekers op een kaartje kunnen zien waar je bedrijf is gevestigd</li>
<li>Reactie-plugin: geeft je bezoekers de mogelijkheid om korte reacties op je website te plaatsen (en ze kunnen ook op elkaar reageren)</li>
<li>PDF-output; maakt automatisch PDF-bestanden van de tekst op een pagina die bezoekers kunnen downloaden</li>
<li>Blog-Plugin: samenvoeging van de nieuws-plugin en de reactie-plugin</li>
<li>Gallery-plugin: maakt automatisch een mooie foto-gallery van foto&#8217;s</li>
<li>En in ontwikkeling; Google WAVE-integratie; een mogelijkheid om bezoekers via Google Wave te laten reageren op nieuws-berichten.</li>
</ul>
<p>Verder maakt WPS gebruik van slimme caching; je site zal altijd rete-snel blijven omdat alle veel gebruikte informatie in het geheugen van de webserver bewaard blijven, zodat ze snel weer voor handen zijn als het nodig is.</p>
<p>Voor meer informatie over WPS, <a title="WPS demo website" href="http://wps.i-v-o.nl" target="_blank">klikkerdeklik!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://syntacticsugar.nl/2009/10/17/launched-a-new-wps-demo-website/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AJP : Authenticated JSON Proxy</title>
		<link>http://syntacticsugar.nl/2009/03/20/ajp-authenticated-json-proxy/</link>
		<comments>http://syntacticsugar.nl/2009/03/20/ajp-authenticated-json-proxy/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 16:01:14 +0000</pubDate>
		<dc:creator>buTTon</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WPS]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Cross-domain]]></category>
		<category><![CDATA[Prototype.js]]></category>
		<category><![CDATA[SOP]]></category>

		<guid isPermaLink="false">http://syntacticsugar.nl/?p=100</guid>
		<description><![CDATA[Authenticated what?
The first hurdle most developers have to take when introduced to AJAX is S.O.P.
S.O.P stands for Same Origin Policy and basically means that you can only do AJAX-requests to the (sub)-domain the client is currently on.  First thing I thought when I read about AJAX couple of years ago; &#8216;wow! cool!  I [...]]]></description>
			<content:encoded><![CDATA[<p><em>Authenticated what?</em></p>
<p>The first hurdle most developers have to take when introduced to AJAX is <a href="http://en.wikipedia.org/wiki/SOP" target="_blank">S.O.P</a>.<br />
S.O.P stands for Same Origin Policy and basically means that you can only do AJAX-requests to the (sub)-domain the client is currently on.  First thing I thought when I read about AJAX couple of years ago; &#8216;wow! cool!  I can strip content from other sites and incorporate them in my websites&#8217; .. and immediately I started hammering away on a RSS-reader which was supposed to grab news from a RSS-feed directly. My efforts failed. The RSS-feed was on another domain and S.O.P kicked in spoiling all the fun.<br />
<span id="more-100"></span><br />
There are ways to get around this, you could create a server-side script which retrieves content from another domain and proxy it to your AJAX-request. However; you will need a server that has either PHP, ASP(.net), CGI, Rails, or at least something more intelligent than a plain HTML-only environment. This is OK for most people, and proxying content from other domains to AJAX-request is used a lot. But what if you&#8217;d like to create something, like a widget, which needs to grab content from any domain, and which people can use without having a PHP/ASP/CGI or Ruby-server? You wouldn&#8217;t be able to get around S.O.P, right?<br />
How can you bypass S.O.P, while still maintain a certain level of security?</p>
<p><strong>TimeLiner</strong><br />
I ran into this problem when I created <a href="http://www.tliner.com" target="_blank">TimeLiner</a>. TimeLiner retrieves and displays messages linked to a flashmovie or mp3-file.  These messages are stored on one of my servers and TimeLiner could be running anywhere. Retrieving those messages should be done by AJAX-like requests but I didn&#8217;t want users to install all kinds of server-side scripts on their server for proxying the messages from my server to overcome SOP. I wanted TimeLiner to be able to run from HTML-only-websites, or as a widget from social networking websites. But with SOP this wouldn&#8217;t be possible.<br />
With this in mind I started experimenting. I started off by creating script-tags and insert those tags into the DOM on the fly and see if variables in the referenced js file were actually available. Expecting limitations due to security measures within browsers the results actually suprised me; the variables were globally available!  I started on designing a proof of concept and tried to take this idea to the next level. At the end of the day I got a working prototype and called it AJP; the Authenticated JSON Proxy.</p>
<p><strong>RPC, AJAX, Objects</strong><br />
First a bit of history. The past few years I&#8217;ve been busy writing WPS; a publishing system much like Joomla (only much better;). It&#8217;s written in PHP5, object orientated, follows a observer-pattern(plugins) and runs entirely on XML/XSL-translations. If you&#8217;d like a shop-plugin on your WPS-driven-website you only need to include the shop-object and you&#8217;re ready to sell your stuff.</p>
<p>Because all data within WPS is actually XML it really doesn&#8217;t matter what you want to do with with it; you could translate it to HTML by using XSL-t and write it to the browser or you can pickup this data by using AJAX-calls. <a href="http://en.wikipedia.org/wiki/KISS_principle" target="_blank">KISS</a> at work <img src='http://syntacticsugar.nl/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>WPS uses its own RPC-interface for AJAX-requests. You can create a request by defining which WPS-object you&#8217;d like to call, which method within the choosen object must be executed and the arguments that need to be passed to the method. This WPSRPC-interface consists of two parts; the server-side pickup and dispatch, and a javascript-class that simplifies the actual RPC-calls.<br />
A typical WPSRPC-request would look like this:</p>
<p>Javascript:</p>
<pre><code>var wpsRPC = new wps.rpc;
wpsRPC.createCall('shop', this.setSaved.bind(this));
wpsRPC.call('storeItemToBasket', {id:itemID, uid:someUID});</code></pre>
<p>Line 1: create a RPC-object<br />
Line 2: define the PHP-object you&#8217;d like to call (in this example; the <em>shop</em>-object) and define the callback-method (in this example; the method <em>setSaved</em> from the same object-instance, hence the <em>.bind(this)</em>-statement )<br />
Line 3 : define the method which needs to executed remotely, define the arguments that need to be passed and execute the request.</p>
<p>On the server-side (PHP) the request is handled by the WPS-controller. WPS uses <em>_autoload</em> to include the requested class, instantiates the requested object (in this case the <em>Shop</em>-object) executes the requested method (<em>storeItemToBasket</em>) and passes the arguments to that method (<em>id</em> &amp; <em>uid</em>). The output of the requested method should be XML or JSON which will be returned to the javascript-callback (<em>setSaved</em>) for further handling by the browser.<br />
This proofed to be a powerful method of remotely executing stuff; it&#8217;s clean, quick and flexible and I&#8217;ve used this structure for 5 years without any problems whatsoever.</p>
<p>Now; why this elaboration about WPS?<br />
AJP uses exactly the same structure, a Javascript object that contains methods for doing RPC-calls, and a server-side RPC-interface to handle those requests, but there is a slight difference; the calls can be done across domains!</p>
<p><strong>Back to AJP: how does it work?<br />
</strong>I&#8217;ll use the example of the WPS-shop-object and explain each step; let&#8217;s assume a user is visiting your webshop and clicks &#8220;add to basket&#8221;, what will happen?</p>
<p>By clicking an event is triggered, this event will create an AJP-object:</p>
<pre><code>var ajpObject = new ajp;
ajpObject.createCall('shop', this.setSaved.bind(this));
ajpObject.call('storeItemToBasket', {id:itemID, uid:someUID});</code></pre>
<p>Internally the AJP-object creates a random ID and prepends &#8220;jsonProxy&#8221;, let&#8217;s say this variable is called <em>jsonProxy12345</em>. This variable is used to identify the request. Next step is to create a script-tag and insert it into the head of your HTML-document. The src-attribute of the script-tag points to the URI where a RPC-interface is waiting for requests. This is not a .js file, but a .php-file; which allows you to use http-requests (<em>$_REQUEST</em> in PHP) to pass along variables.<br />
A script-tag from this example would look like this;</p>
<pre><code>&lt;script src="http://www.yourdomain.com/
rpc.php?jsonProxy=12345&amp;object=shop&amp;method=storeItemToBasket&amp;id=1&amp;uid=12" &gt;
&lt;/script&gt;</code></pre>
<p>The server-side pretty much works the same as the WPS-example above; the <em>$_REQUEST</em> is mapped to an object, a method and the arguments and is executed. There&#8217;s a small difference; the output can only be JSON, and put into a variable called <em>jsonProxy12345</em>.</p>
<p>Ok, let&#8217;s assume the RPC-call executed OK and the ID of the inserted row should be returned to javascript. How does AJP know there&#8217;s output, and how does AJP actually use the output?<br />
In &#8216;real&#8217; AJAX you can use an event to notify Javascript the RPC-call returned something, but AJP is not &#8216;real&#8217; AJAX&#8230; This is where the <em>jsonProxy12345</em> comes in: the moment the script-tag is inserted into the DOM a timer is started  which keeps checking for the variable <em>jsonProxy12345</em>. If the variable exists the value is picked up and passed to the callback-function, otherwise the timer keeps running until it encounters the variable (there&#8217;s a timeout to catch errors). This effectively mimics the events used in real AJAX, which we want.</p>
<p><strong>Now for some security</strong><br />
If you use this kind of RPC you really do not want to expose your PHP-objects to the world. If you created a populair service your server would run out of resources if anyone can do RPC-calls to it. To overcome this you need to authenticate the requests, but how?<br />
It&#8217;s really quite simple; before actually doing a request, <em>ask</em> the server if you may do a request!<br />
I&#8217;ve done this before with traditional forms; before posting a form an AJAX-call retrieves a unique ID from the server (a mysql GUID), this GUID is appended to the form in a hidden field and the form is posted. The server checks if the GUID is valid, and if that&#8217;s the case the form is handled.<br />
But how does the server know the GUID is valid? The moment the server creates the GUID it&#8217;s stored into a database, along with the originating IP-address, the browser-string and the time it&#8217;s requested. If the form is actually posted the server checks if the GUID is available, if it&#8217;s from the same IP, with the same browserstring and within 5 seconds after it&#8217;s been requested. Only if all conditions are met the form is handled and the GUID is removed from the database.</p>
<p>This principle can also be used to authenticate AJP-requests, and AJP can use itself to request a GUID by being clever in it&#8217;s design and inheritance-scheme.<br />
I realize it&#8217;s quite easy to mimic the requesting of GUID&#8217;s, but it&#8217;s a barrier, and AJP does something else to tighten up security even more; whenever AJP receives a result the script-tag will be removed immediately. It removes any evidence of requests, making it harder to find out what happened.</p>
<p>AJP is certainly not rocket-science, I&#8217;ve seen a lot of scripts using this kind of technique. I do believe the structure of AJP itself works great and allows developers to extend upon. As a bonus; this also works great on very old browsers; i&#8217;ve tested it on MSIE 4, and AJP works fine!</p>
<p>I&#8217;ve compiled a small (LGPL&#8217;ed) <a href="http://syntacticsugar.nl/upload/ajp.zip">download</a> which contains all the files for using AJP, it&#8217;s not a full implementation, but enough to get you going.</p>
]]></content:encoded>
			<wfw:commentRss>http://syntacticsugar.nl/2009/03/20/ajp-authenticated-json-proxy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upcoming WPS-release: WPS 2.7</title>
		<link>http://syntacticsugar.nl/2007/12/12/upcoming-wps-release-wps-27/</link>
		<comments>http://syntacticsugar.nl/2007/12/12/upcoming-wps-release-wps-27/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 09:03:41 +0000</pubDate>
		<dc:creator>buTTon</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Content Publishing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WPS]]></category>
		<category><![CDATA[publishing]]></category>

		<guid isPermaLink="false">http://syntacticsugar.nl/?p=15</guid>
		<description><![CDATA[I&#8217;m figuring out what new features would make WPS even better. I&#8217;m planning a new release of WPS in 2008, probably around may/june for a full fresh production-release.So I summed up a list of new features that would improve WPS, if you have anything to add, please use the reactions-widget.
Other features/wannahave&#8217;s:

More/Better Help-functions, possibly integrated into [...]]]></description>
			<content:encoded><![CDATA[<div id="newsMessage_81" class="newsItem">I&#8217;m figuring out what new features would make WPS even better. I&#8217;m planning a new release of WPS in 2008, probably around may/june for a full fresh production-release.So I summed up a list of new features that would improve WPS, if you have anything to add, please use the reactions-widget.</div>
<p>Other features/wannahave&#8217;s:</p>
<ul>
<li>More/Better Help-functions, possibly integrated into WPS itself.</li>
<li> <strong>Multi-language-support</strong>, not only for editMode, but also for the publishing modules themselves</li>
<li>Sandbox-support out of the box, no need for a specific subdomain or VirtualHost</li>
<li>New <strong>site-manager</strong>; an overview of pages/contentblocks from a grid/treeview.</li>
<li>Link-checker/mover; Checks internal links to WPS-pages or renames them when a page is renamed</li>
<li>More wizards for general functions (add page/block etc).</li>
<li> <strong>Template-editting</strong> : access and edit XSL-stylesheets that make up the layout/design of your WPS-site</li>
<li>Empty-cache-button</li>
<li>Filemanager needs to be rewritten to be MUCH faster and uses less resources</li>
<li>Custom-XML-tags-support in content-editors, more editing-facilities in content-editors</li>
<li>Install/Configuration/Security-audit &#8211; scripts</li>
<li><strong>Version-control</strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://syntacticsugar.nl/2007/12/12/upcoming-wps-release-wps-27/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
