/**
  * 
  */
 public function deleteAnnotation()
 {
     $vn_annotation_id = $this->request->getParameter('annotation_id', pInteger);
     $va_response = array('code' => 0, 'id' => $vn_annotation_id, errors => array());
     $t_annotation = new ca_representation_annotations();
     if ($t_annotation->load($vn_annotation_id)) {
         $t_annotation->setMode(ACCESS_WRITE);
         $t_annotation->delete(true);
         if ($t_annotation->numErrors()) {
             $va_response = array('code' => 10, 'id' => $vn_annotation_id, 'errors' => $t_annotation->getErrors());
         }
     } else {
         $va_response = array('code' => 10, 'errors' => array(_t('Invalid annotation_id')));
     }
     $this->view->setVar('response', $va_response);
     return $this->render('ajax_representation_annotation_delete_json.php');
 }
 /**
  *
  */
 public function removeAnnotation($pn_annotation_id)
 {
     if (!($vn_representation_id = $this->getPrimaryKey())) {
         return null;
     }
     $t_annotation = new ca_representation_annotations($pn_annotation_id);
     if ($t_annotation->get('representation_id') == $vn_representation_id) {
         $t_annotation->setMode(ACCESS_WRITE);
         $t_annotation->delete(true);
         if ($t_annotation->numErrors()) {
             $this->errors = $t_annotation->errors;
             return false;
         }
         return true;
     }
     return false;
 }