public function executeJson(AgaviRequestDataHolder $rd)
 {
     $data = $this->getAttribute('values', array());
     $doc = new AppKitExtJsonDocument();
     $doc->hasField('key');
     $doc->hasField('value');
     $doc->setData($data);
     $doc->setSuccess(true);
     return $doc->getJson();
 }
 public function executeJson(AgaviRequestDataHolder $rd)
 {
     if ($rd->getParameter('extjs')) {
         $json = new AppKitExtJsonDocument();
         $json->hasField('definition');
         $json->hasField('type');
         $json->hasField('isSimple');
         $json->hasField('iconCls');
         $json->hasField('label');
         $json->setData($this->commands);
         $json->setSuccess(true);
         return $json->getJson();
     } else {
         return json_encode(array('success' => true, 'results' => $this->commands));
     }
 }
 public function executeJson(AgaviRequestDataHolder $rd)
 {
     $factory = $this->getContext()->getModel('JasperSoapFactory', 'Reporting', array('jasperconfig' => $rd->getParameter('jasperconfig')));
     $client = $factory->getSoapClientForWSDL(Reporting_JasperSoapFactoryModel::SERVICE_SCHEDULER);
     $scheduler = $this->getContext()->getModel('JasperScheduler', 'Reporting', array('client' => $client, 'jasperconfig' => $rd->getParameter('jasperconfig'), 'uri' => $rd->getParameter('uri')));
     $data = $scheduler->getScheduledJobs();
     $response = new AppKitExtJsonDocument();
     $response->hasField('id');
     $response->hasField('version');
     $response->hasField('reportUnitURI');
     $response->hasField('username');
     $response->hasField('label');
     $response->hasField('state');
     $response->hasField('previousFireTime');
     $response->hasField('nextFireTime');
     $response->setData($data);
     $response->setSuccess();
     return $response->getJson();
 }
 public function getJson()
 {
     $json = new AppKitExtJsonDocument();
     if (!$this->programStatus->isApplicable() || $this->programStatus->config_dump_in_progress === '1') {
         $data = $this->retrieveData();
         $json->addMiscData('fromCache', true);
     } else {
         $data = array($this->getData(), $this->getDataForInstance());
         $this->writeData($data);
         $json->addMiscData('fromCache', false);
     }
     foreach (array_keys($data[0][0]) as $f) {
         $json->hasField($f);
     }
     $json->setSuccess(true);
     $json->setData($data[0]);
     $json->setSortinfo('type');
     $json->addMiscData('rowsInstanceStatus', $data[1]);
     return $json;
 }