Skip to content

Instantly share code, notes, and snippets.

View larscwallin's full-sized avatar

Lars Wallin larscwallin

View GitHub Profile
@larscwallin
larscwallin / dia2xpdo.xsl
Created September 12, 2011 08:03
dia2xpdo
<?xml version="1.0"?>
<!--
Transform dia UML objects to a convenient structure
Copyright(c) 2002 Matthieu Sozeau <mattam@netcourrier.com>
Copyright(c) 2004 Dave Klotzbach <dklotzbach@foxvalley.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@larscwallin
larscwallin / result.js
Created September 8, 2011 09:49
XPDO to simple ExtJS 3 Stores
var SimplxStudio = {};
SimplxStudio.modx = {};
/* Creating JSON representation for modAccess */
SimplxStudio.modx.modAccess={
"class": "modAccess",
"extends":"xPDOSimpleObject",
"fields": [
"id","alias","target","principal_class","principal","authority","policy"
@larscwallin
larscwallin / simplx.http.php
Created September 7, 2011 08:40
simplx.http
<?php
interface ISimplxHTTPProxy{
public function setBaseURL($url);
public function setServiceURI($uri);
public function login($usn,$psw);
public function logout();
public function get($res,$data);
public function post($res,$data);
public function patch($res,$data);
public function put($res,$data);
@larscwallin
larscwallin / output.js
Created September 6, 2011 08:27
XPDO to ExtJs Model JSON
{"model":{
"modx":{}
,"modChunk":{
"class": "modChunk",
"extends":"modElement",
"fields": [
{
"name": "id",
"type": "int"
@larscwallin
larscwallin / simplx.controller.php
Created September 2, 2011 08:49
SIMPLX Controller from the Sodexo site
<?php
$active_processes = array();
$parse_error = false;
/*
Abstract the Request Object by assigning it to a "proxy".
Note the force_get property which may force the Resource id and Routing Table actions to
be taken from the QueryString.
*/
if($_SERVER['REQUEST_METHOD'] == 'POST' && $force_get != '1'){
@larscwallin
larscwallin / gist:1179133
Created August 29, 2011 19:04
rest without rewrite
<?php
$method = $_SERVER
['REQUEST_METHOD'];
$request = explode("/ ",
substr(@$_SERVER
['PATH_INFO'], 1));
switch ($method) {
case 'PUT':
rest_put($request );
break;
@larscwallin
larscwallin / simplx.http.php
Created August 26, 2011 15:31
SimplxRESTClient
<?php
interface ISimplxRestProxy{
public function setServiceURI($uri);
public function login($usn,$psw);
public function logout();
public function get($res,$data);
public function post($res,$data);
public function patch($res,$data);
public function put($res,$data);
public function delete($res,$data);
@larscwallin
larscwallin / result.html
Created August 25, 2011 08:24
XPDO2HTML XSLT Script
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<html>
<head/>
<body class="xPDOObject" data-package="modx">
<form class="modAccess" name="modAccess">
<input type="hidden" name="class" value="modAccess"/>
<input type="hidden" name="extends" value="xPDOSimpleObject"/>
<input type="hidden" name="id" value=""/>
<fieldset>
<legend>modAccess</legend>
@larscwallin
larscwallin / xpdo_dl.html
Created August 24, 2011 09:37
XPDO as DL
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<html>
<head/>
<body>
<dl class="xPDOObject" data-package="modx" data-="">
<dt class="modAccess" data-extends="xPDOSimpleObject">modAccess</dt>
<dd>
<dl>
<dt data-fields="fields">fields</dt>
<dd>
@larscwallin
larscwallin / gist:1161995
Created August 22, 2011 09:18
JsonRPCProxy for ExtJS
/*
Orginally by cginzel at the Sencha Forums
http://www.sencha.com/forum/member.php?20865-cginzel
I'm playing with NodeJS and Connect which has an JSONRPC provider and so I managed to coble this proxy and reader together that I was able to successfully use to retrieve data into a grid. But I'm moving onto building an Ext.Direct provider instead so it'll be easier to build out the GUI. But for posterity's sake, I thought I'd post this code here just in case anyone else might find it useful.
I don't intend to support it, so use it at your own risk!