/**
  * Add a subclass to the currently selected class
  * @throws Exception
  */
 public function addSubClass()
 {
     if (!tao_helpers_Request::isAjax()) {
         throw new Exception("wrong request mode");
     }
     $parent = new core_kernel_classes_Class($this->getRequestParameter('id'));
     $clazz = $this->service->createSubClass($parent);
     if (!is_null($clazz) && $clazz instanceof core_kernel_classes_Class) {
         echo json_encode(array('label' => $clazz->getLabel(), 'uri' => tao_helpers_Uri::encode($clazz->getUri())));
     }
 }