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 ($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 ($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) { 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(); } }
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(); }