public function executeJson(AgaviRequestDataHolder $rd)
 {
     if ($this->hasAttribute('categories')) {
         $categories = $this->getAttribute('categories', array());
         $json = new AppKitExtJsonDocument();
         $json->setAttribute(AppKitExtJsonDocument::ATTR_AUTODISCOVER);
         $json->setMeta(AppKitExtJsonDocument::PROPERTY_ID, 'catid');
         $json->setData($categories);
         $json->setSuccess(true);
         return $json->getJson();
     }
 }
 public function executeJson(AgaviRequestDataHolder $rd)
 {
     if ($this->hasAttribute('errors')) {
         $this->getContainer()->getResponse()->setHttpStatusCode(500);
         return json_encode(array('errorMessage' => $this->getAttribute('errors')));
     }
     if ($rd->getParameter('xaction') == 'write') {
         $return = array('success' => true, 'errors' => new stdClass());
         return json_encode($return);
     }
     if ($this->hasAttribute('cronks')) {
         $json = new AppKitExtJsonDocument();
         $json->setAttribute(AppKitExtJsonDocument::ATTR_AUTODISCOVER);
         $json->setData($this->getAttribute('cronks'));
         $json->setSuccess(true);
         return $json->getJson();
     }
 }