示例#1
0
 public function markCompleted($code = 0, $message = false)
 {
     $obj = parent::markCompleted($code, $message);
     $q = $this->getQueueObject();
     if (!$this->didFail()) {
         $q->deleteQueue();
     }
     return $obj;
 }
示例#2
0
 public function install()
 {
     $pkg = parent::install();
     //BlockType::installBlockTypeFromPackage('Mailer', $pkg);
     Job::installByPackage('process_xmailer', $pkg);
     SinglePage::add('/dashboard/xmailer', $pkg);
     SinglePage::add('/dashboard/xmailer/mailboxes', $pkg);
     SinglePage::add('/dashboard/xmailer/mailboxes/user', $pkg);
     SinglePage::add('/dashboard/xmailer/mailboxes/group', $pkg);
     SinglePage::add('/dashboard/xmailer/settings', $pkg);
 }
示例#3
0
 public function getResults(Request $request)
 {
     $list = \Concrete\Core\Job\Job::getList();
     $items = array();
     foreach ($list as $j) {
         $item = new \PortlandLabs\Concrete5\MigrationTool\Entity\Export\Job();
         $item->setItemId($j->getJobID());
         $items[] = $item;
     }
     return $items;
 }
 public function import(\SimpleXMLElement $sx)
 {
     if (isset($sx->jobs)) {
         foreach ($sx->jobs->job as $jx) {
             $pkg = static::getPackageObject($jx['package']);
             $job = Job::getByHandle($jx['handle']);
             if (!is_object($job)) {
                 if (is_object($pkg)) {
                     Job::installByPackage($jx['handle'], $pkg);
                 } else {
                     Job::installByHandle($jx['handle']);
                 }
             }
         }
     }
 }
 public function execute(Batch $batch)
 {
     $jobs = $batch->getObjectCollection('job');
     if (!$jobs) {
         return;
     }
     foreach ($jobs->getJobs() as $job) {
         if (!$job->getPublisherValidator()->skipItem()) {
             $pkg = null;
             if ($job->getPackage()) {
                 $pkg = \Package::getByHandle($job->getPackage());
             }
             if (is_object($pkg)) {
                 Job::installByPackage($job->getHandle(), $pkg);
             } else {
                 Job::installByHandle($job->getHandle());
             }
         }
     }
 }
 public function import(\SimpleXMLElement $sx)
 {
     if (isset($sx->jobsets)) {
         foreach ($sx->jobsets->jobset as $js) {
             $jso = Set::getByName((string) $js['name']);
             if (!is_object($jso)) {
                 $pkg = static::getPackageObject($js['package']);
                 if (is_object($pkg)) {
                     $jso = Set::add((string) $js['name'], $pkg);
                 } else {
                     $jso = Set::add((string) $js['name']);
                 }
             }
             foreach ($js->children() as $jsk) {
                 $j = Job::getByHandle((string) $jsk['handle']);
                 if (is_object($j)) {
                     $jso->addJob($j);
                 }
             }
         }
     }
 }
 public function execute(Batch $batch)
 {
     $sets = $batch->getObjectCollection('job_set');
     if (!$sets) {
         return;
     }
     foreach ($sets->getSets() as $set) {
         if (!$set->getPublisherValidator()->skipItem()) {
             $pkg = null;
             if ($set->getPackage()) {
                 $pkg = \Package::getByHandle($set->getPackage());
             }
             $set = \Concrete\Core\Job\Set::add($set->getName(), $pkg);
             $jobs = $set->getJobs();
             foreach ($jobs as $handle) {
                 $j = Job::getByHandle($handle);
                 if (is_object($j)) {
                     $set->addJob($j);
                 }
             }
         }
     }
 }
示例#8
0
 public function getPackageItems(Package $package)
 {
     return \Concrete\Core\Job\Job::getListByPackage($package);
 }
 public function skipItem()
 {
     $job = Job::getByHandle($this->object->getHandle());
     return is_object($job);
 }
示例#10
0
 public function removeJob(Job $j)
 {
     $db = Loader::db();
     $db->Execute('delete from JobSetJobs where jsID = ? and jID = ?', array($this->getJobSetID(), $j->getJobID()));
 }
示例#11
0
 public function setPropertiesFromArray($arr)
 {
     return parent::setPropertiesFromArray($arr);
 }