/**
  * Duplicate the current instance
  * render a JSON response
  * @return void
  */
 public function cloneInstance()
 {
     if (!tao_helpers_Request::isAjax()) {
         throw new Exception("wrong request mode");
     }
     $clone = $this->service->cloneInstance($this->getCurrentInstance(), $this->getCurrentClass());
     if (!is_null($clone)) {
         echo json_encode(array('label' => $clone->getLabel(), 'uri' => tao_helpers_Uri::encode($clone->getUri())));
     }
 }