Index: Dev/trunk/classes/ApplicationConnector.php
===================================================================
--- Dev/trunk/classes/ApplicationConnector.php	(revision 142)
+++ Dev/trunk/classes/ApplicationConnector.php	(revision 144)
@@ -11,6 +11,6 @@
  * @author jkraaijeveld
  */
-class ApplicationConnector implements IConnector{
-    
+class ApplicationConnector implements IConnector {
+
     protected $model;
     protected $fileName = 'data/applications/applications.rdf';
@@ -19,11 +19,11 @@
      * Constructor for ApplicationConnector.
      */
-    public function __construct()
-    {
+    public function __construct() {
         //Ensure the required folder for this connector exists
-        if (!is_dir('data/applications/'))
-            mkdir('data/applications/');	
+        if (!is_dir('data/applications/')) {
+            mkdir('data/applications/', null, true);
+        }
     }
-    
+
     /**
      * function load()
@@ -33,10 +33,10 @@
         //Get the Memory Model from the ModelFactory
         $this->model = ModelFactory::getDefaultModel();
-        
+
         //Ensure the required file exists before loading
-        if(file_exists($this->fileName))
+        if (file_exists($this->fileName))
             $this->model->load($this->fileName);
     }
-    
+
     /**
      * function save()
@@ -44,7 +44,7 @@
      */
     public function save() {
-        $this->model->saveAs($this->fileName,'rdf'); 
+        $this->model->saveAs($this->fileName, 'rdf');
     }
-    
+
     /**
      * function get($arguments)
@@ -58,14 +58,17 @@
         $keys = array_keys($arguments);
         //Set default values for arguments
-        $uid = "?uid"; $title = "?title"; $description = "?description"; $style = "?style";
+        $uid = "?uid";
+        $title = "?title";
+        $description = "?description";
+        $style = "?style";
         //Set the arguments if they are supplied
-        if(in_array("uid", $keys))
-            $uid = "\"".$arguments["uid"]."\"";
-        if(in_array("title", $keys))
-            $title = '\''.$arguments["title"].'\'';
-        if(in_array("description", $keys))
-            $description = "\"".$arguments["description"]."\"";
-        if(in_array("style", $keys))
-            $style = "\"".$arguments["style"]."\"";    
+        if (in_array("uid", $keys))
+            $uid = "\"" . $arguments["uid"] . "\"";
+        if (in_array("title", $keys))
+            $title = '\'' . $arguments["title"] . '\'';
+        if (in_array("description", $keys))
+            $description = "\"" . $arguments["description"] . "\"";
+        if (in_array("style", $keys))
+            $style = "\"" . $arguments["style"] . "\"";
 
         //Create the querystring 
@@ -90,15 +93,13 @@
         $results = $this->model->sparqlQuery($querystring);
         $applications = array();
-        if(!empty($results))
-        {
+        if (!empty($results)) {
             //Run over all results and create appropriate Application objets
-            foreach($results as $result)
-            { 
-                    $applications[] = new Application($result['?uid']->label, $result['?title']->label, $result['?description']->label, $result['?style']->label);
+            foreach ($results as $result) {
+                $applications[] = new Application($result['?uid']->label, $result['?title']->label, $result['?description']->label, $result['?style']->label);
             }
         }
         return $applications;
     }
-    
+
     /**
      * function set()
@@ -107,8 +108,7 @@
      * @param type $rToolObject: The ResearchToolObject to be saved. 
      */
-    public function set($rToolObject)
-    {
+    public function set($rToolObject) {
         $this->load();
-        $resourceApplication = new Resource(APPLICATION.'/'.$rToolObject->uid);
+        $resourceApplication = new Resource(APPLICATION . '/' . $rToolObject->uid);
         //Remove the old value stored with the given id
         $this->model->subtract($this->model->find($resourceApplication, null, null));
@@ -117,24 +117,25 @@
         $resourceApplicationType = new Resource(APPLICATION);
         $predicateRType = new Resource(RTYPE);
-        $this->model->add(new Statement($resourceApplication,$predicateRType,$resourceApplicationType));
-		
+        $this->model->add(new Statement($resourceApplication, $predicateRType, $resourceApplicationType));
+
         $literalApplicationID = new Literal($rToolObject->uid);
         $predicateUniqueID = new Resource(UID);
-        $this->model->add(new Statement($resourceApplication,$predicateUniqueID,$literalApplicationID));
+        $this->model->add(new Statement($resourceApplication, $predicateUniqueID, $literalApplicationID));
 
         $applicationTitle = new Literal($rToolObject->title);
-        $predicateTitle = new Resource(TITLE);	
-        $this->model->add(new Statement($resourceApplication,$predicateTitle,$applicationTitle));
+        $predicateTitle = new Resource(TITLE);
+        $this->model->add(new Statement($resourceApplication, $predicateTitle, $applicationTitle));
 
         $applicationDescription = new Literal($rToolObject->description);
         $predicateDescription = new Resource(DESCRIPTION);
-        $this->model->add(new Statement($resourceApplication,$predicateDescription,$applicationDescription));
+        $this->model->add(new Statement($resourceApplication, $predicateDescription, $applicationDescription));
 
         $applicationStyle = new Literal($rToolObject->style);
         $predicateStyle = new Resource(STYLE);
-        $this->model->add(new Statement($resourceApplication,$predicateStyle,$applicationStyle));
-		
-	$this->save();
+        $this->model->add(new Statement($resourceApplication, $predicateStyle, $applicationStyle));
+
+        $this->save();
     }
+
 }
 
Index: Dev/trunk/classes/DisplayStep.php
===================================================================
--- Dev/trunk/classes/DisplayStep.php	(revision 142)
+++ Dev/trunk/classes/DisplayStep.php	(revision 144)
@@ -18,24 +18,23 @@
     public $imageURL;
     public $selected = false;
-    public $name;
+    public $caption;
+    public $id;
 
-    public function __construct($t, $ref=null, $n) {
-        
+    public function __construct($t, $ref=null, $c, $id) {
+
         $this->type = $t;
         $this->reference = $ref;
-        $this->name = $n;
-        
+        $this->caption = $c;
+        $this->id = $id;
+
         switch ($this->type) {
             case "Questionnaire":
-                $this->imageURL = "images/icons/questionnaire2.png";
+                $this->imageURL = "images/icons/questionnaire.png";
                 break;
             case "Dashboard":
-                $this->imageURL = "images/icons/dashboard2.png";
+                $this->imageURL = "images/icons/dashboard.png";
                 break;
             case "Application":
-                $this->imageURL = "images/icons/application2.png";
-                break;
-            case "Notice":
-                $this->imageURL = "images/icons/notice2.png";
+                $this->imageURL = "images/icons/application.png";
                 break;
             default:
@@ -43,10 +42,8 @@
                 break;
         }
-        
+
         //output a display object
-        echo '<div class="displayStep" style="background-image: url(\'';
-        echo $this->imageURL;
-        echo '\');" ><p>'.$this->name.'</p></div>'."\n";
-        
+        //echo '<div class="displayStep"><div class="displayStepIcon" style="background-image: url('.$this->imageURL.');"></div>'.$this->caption.'</div>'."\n";
+        echo '<div class="displayStep"><div class="displayStepIcon"><img src="' . $this->imageURL . '" /></div>' . $this->caption . '</div>';
     }
 
Index: Dev/trunk/classes/Step.php
===================================================================
--- Dev/trunk/classes/Step.php	(revision 144)
+++ Dev/trunk/classes/Step.php	(revision 144)
@@ -0,0 +1,34 @@
+<?php
+
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Placeholder class, for testing of pipelineEditor.php only.
+ * Will eventually be replaced by functioning Questionnaire, Notice, Dashboard and Application objects in array steps[].
+ *
+ * @author Thijs Schipper
+ */
+class Step {
+
+    public $type;
+    public $name;
+    public $id;
+
+    public function __construct($t, $n, $i) {
+
+        if (strtolower($t) == "application" || strtolower($t) == "dashboard" || strtolower($t) == "questionnaire") {
+            $this->name = $n;
+            $this->type = $t;
+            $this->id = $i;
+        }
+        else {
+            die("Invalid type given: ".$t."\n $n $i");
+        }
+    }
+
+}
+
+?>
Index: Dev/trunk/classes/Toolbox.php
===================================================================
--- Dev/trunk/classes/Toolbox.php	(revision 144)
+++ Dev/trunk/classes/Toolbox.php	(revision 144)
@@ -0,0 +1,33 @@
+<?php
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of ToolBox
+ *
+ * @author HP
+ */
+class Toolbox {
+
+    public function __construct() {
+        ?>
+
+        <br />
+        <form name="toolbox" action="pipelineEditor.php" method="POST">
+            <fieldset id="toolbox">
+                <div class="title">Toolbox</div>
+                <p>Add new: </p>
+                <div class="creationButton" onClick="document.toolbox.objectToCreate.value = 'Questionnaire'; SubmitToolbox();"><img src="images/icons/questionnaire.png" class="buttonIcon"/><p>Questionnaire</p></div>
+                <div class="creationButton" onClick="document.toolbox.objectToCreate.value = 'Application'; SubmitToolbox();"><img src="images/icons/application.png" class="buttonIcon"/><p>Application</p></div>
+                <div class="creationButton" onClick="document.toolbox.objectToCreate.value = 'Dashboard'; SubmitToolbox();"><img src="images/icons/dashboard.png" class="buttonIcon"/><p>Dashboard</p></div>
+                <input type="hidden" name="objectToCreate" />
+
+            </fieldset>
+        </form>
+        <?php
+    }
+
+}
+?>
Index: Dev/trunk/classes/pipelineSequencer.php
===================================================================
--- Dev/trunk/classes/pipelineSequencer.php	(revision 144)
+++ Dev/trunk/classes/pipelineSequencer.php	(revision 144)
@@ -0,0 +1,113 @@
+<?php
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of Sequencer
+ *
+ * @author HP
+ */
+class pipelineSequencer {
+
+    // properties
+    private $steps;
+    private $title = "testSequencer";
+    private $id = 1;
+    private $numStepsInArray = 0;
+    private $maxNumStepsInArray = 8;
+    private $selectedStep;
+
+    public function __construct($steps) {
+        $this->steps = $steps;
+        $this->selectedStep = $this->steps[2];
+
+        $this->moveStep(1);
+
+//        echo '<br /><fieldset id="sequencer">'."\n\n";
+//        echo '<div class="title">Name: '.$this->title.'</div>';
+//        echo '<div class="seqContent">'."\n\n";
+//        echo '';
+//        echo '</div>';
+//        echo '</fieldset>';
+        ?>
+        <br /><form name="sequencer" action="pipelineEditor.php" method="post"><fieldset id="sequencer">
+                <div class="title">Name: <?php echo $this->title; ?> </div>
+
+                <div class="seqContent">
+                    <?php $this->drawSteps(); ?>          
+                </div>
+
+                <div id="controls">
+                    <input type="submit" name="moveSelectedLeft" value="< Move" class="surveyButton" />
+                    <input type="submit" name="moveSelectedRight" value="Move >" class="surveyButton" />
+                    <input type="submit" name="editSelected" value="Edit step" class="surveyButton" />
+                    <input type="submit" name="deleteSelected" value="Delete step" class="surveyButton" />
+                    <input type="submit" name="clearPipeline" value="Clear pipeline" class="" disabled="true" />
+                    <input type="checkbox" name="confirmClear" />Really clear?
+                    <input type="hidden" name="selectedStep" />
+                </div>
+            </fieldset>
+        </form>
+        <?php
+    }
+
+    public function AddStep($step) {
+        $this->steps[] = $step;
+        ?>
+        <script type="text/javascript">
+            document.refresh();
+        </script>
+        <?php
+    }
+
+    public function RemoveStep($targetStep) {
+
+        $tempArray;
+        foreach ($this->steps as $step) {
+            if ($step != targetStep) {
+                $tempArray[] = $step;
+            }
+        }
+        $this->steps = $tempArray;
+    }
+
+    public function GetSteps() {
+        return $this->steps;
+    }
+
+    public function drawSteps() {
+        //draw the actual icons in the container div.
+        foreach ($this->steps as $step) {
+            if ($this->numStepsInArray < $this->maxNumStepsInArray) {
+                new DisplayStep($step->type, null, $step->name, $step->id);
+                $this->numStepsInArray++;
+                if ($this->numStepsInArray < $this->maxNumStepsInArray && $this->numStepsInArray < count($this->steps)) {
+                    echo "<div class='divider'></div>";
+                }
+            }
+        }
+    }
+
+    public function moveStep($direction) {
+        $key = array_search($this->selectedStep, $this->steps);
+        echo $key;
+    }
+
+    private function moveEntry(&$array, $key, $dir) {
+        if ($dir == -1) {   // move up
+            if ($key > 0) {
+                $reverseArray = array_reverse(array_slice($array, $key - 1, 2, true));   // make a reversed array of the two entries, preserving keys
+                array_splice($array, $key - 1, 2, $reverseArray);    // replace the given range in the oldArray with the reversed Array
+            }
+        } else if ($dir == 1) {   // move down
+            if ($key < count($array) - 1) {
+                $reverseArray = array_reverse(array_slice($array, $key, 2, true));   // make a reversed array of the two entries, preserving keys
+                array_splice($array, $key, 2, $reverseArray);    // replace the given range in the oldArray with the reversed Array
+            }
+        }
+    }
+
+}
+?>
