/**
  * Apply changes made in representation editor to representation media
  *
  */
 public function ProcessMedia()
 {
     list($vn_object_id, $t_object) = $this->_initView();
     $pn_representation_id = $this->request->getParameter('representation_id', pInteger);
     $ps_op = $this->request->getParameter('op', pString);
     $pn_angle = $this->request->getParameter('angle', pInteger);
     $pb_revert = (bool) $this->request->getParameter('revert', pInteger);
     $t_rep = new ca_object_representations($pn_representation_id);
     if (!$t_rep->getPrimaryKey()) {
         $va_response = array('action' => 'process', 'status' => 20, 'message' => _t('Invalid representation_id'));
     } else {
         if ($t_rep->applyMediaTransformation('media', $ps_op, array('angle' => $pn_angle), array('revert' => $pb_revert))) {
             $va_response = array('action' => 'process', 'status' => 0, 'message' => 'OK', 'op' => $ps_op, 'angle' => $pn_angle);
         } else {
             $va_response = array('action' => 'process', 'status' => 10, 'message' => _t('Transformation failed'));
         }
     }
     $this->view->setVar('response', $va_response);
     $this->render('object_representation_process_media_json.php');
 }