public function cloneInstance()
    {
        if(!$this->isXmlHttpRequest()){
            throw new common_exception_BadRequest('wrong request mode');
        }

        $uri = $this->getRequestParameter('uri');

        $this->signatureValidator->checkSignature(
            $this->getRequestParameter('signature'),
            $uri
        );

        $this->validateInstanceRoot($uri);

        $clone = $this->getClassService()->cloneInstance($this->getCurrentInstance(), $this->getCurrentClass());
        if(!is_null($clone)){
            $this->returnJson(array(
                'label' => $clone->getLabel(),
                'uri'   => tao_helpers_Uri::encode($clone->getUri())
            ));
        }
    }