public function sample_page($id)
 {
     $session = $this->Session->read();
     $this->MorphChartProblem->setEncryptionKey($session['cryptkey']);
     $this->MorphChartSolution->setEncryptionKey($session['cryptkey']);
     // retrieve the user session and set it to a variable accessible in the view
     $UserSession = $this->UserSession->findById($id);
     parent::log_entry($UserSession['UserSession']['id'], "Loaded sample page");
     $this->set(compact('UserSession'));
     // this is for JSON and XML requests.
     $this->set('_serialize', array('UserSession'));
 }
 public function delete($id)
 {
     // find the partial ordering
     $po = $this->PartialOrdering->findById($id);
     // extract information for log output
     $pid = $po['PartialOrdering']['id'];
     $pmap_id = $po['PartialOrdering']['problem_map_id'];
     $eid = $po['PartialOrdering']['entity_id'];
     $type = $po['PartialOrdering']['type'];
     $oeid = $po['PartialOrdering']['other_entity_id'];
     // check if deleted successfully
     if ($this->PartialOrdering->delete($id)) {
         $message = 'Deleted';
         // write output to log file
         parent::log_entry($pmap_id, "Added partial_ordering(" . $pid . ", " . $eid . ", " . $type . ", " . $oeid . ")");
     } else {
         $message = 'Error';
     }
     // set view variable
     $this->set(compact("message"));
     // set output for JSON and XML
     $this->set('_serialize', array('message'));
 }