Ignore:
Timestamp:
03/19/10 17:22:08 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Migrando instanciação das classes da engine para a factory.

Location:
sandbox/workflow/branches/609
Files:
57 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/branches/609/inc/class.JobRunner.inc.php

    r2233 r2311  
    9696Factory::getInstance('WorkflowMacro')->prepareEnvironment(); 
    9797 
    98 $jobRunner = new JobRunner($argv[1]); 
     98$jobRunner = &Factory::newInstance('JobRunner', $argv[1]); 
    9999$jobRunner->run(); 
    100100?> 
  • sandbox/workflow/branches/609/inc/class.JobScheduler.inc.php

    r2292 r2311  
    1111 
    1212require_once 'jobs/class.JobEnum.inc.php'; 
    13 require_once 'jobs/class.AbsoluteDate.inc.php'; 
    14 require_once 'jobs/class.WeekDate.inc.php'; 
    15 require_once 'jobs/class.RelativeDate.inc.php'; 
    1613 
    1714/** 
     
    7673                { 
    7774                        case DateType::ABSOLUTE_DATE: 
    78                                 $object = new AbsoluteDate($startDate, $interval); 
     75                                $object = &Factory::getInstance('AbsoluteDate', $startDate, $interval); 
    7976                                break; 
    8077 
    8178                        case DateType::WEEK_DATE: 
    82                                 $object = new WeekDate($startDate, $interval); 
     79                                $object = &Factory::getInstance('WeekDate', $startDate, $interval); 
    8380                                $object->setWeekDays($record['week_days']); 
    8481                                break; 
    8582 
    8683                        case DateType::RELATIVE_DATE: 
    87                                 $object = new RelativeDate($startDate, $interval); 
     84                                $object = &Factory::getInstance('RelativeDate', $startDate, $interval); 
    8885                                $object->setOffset($record['month_offset']); 
    8986                                break; 
  • sandbox/workflow/branches/609/inc/class.WorkflowMacro.inc.php

    r2233 r2311  
    4848                require_once PHPGW_API_INC . '/functions.inc.php'; 
    4949                require_once 'engine/class.ajax_config.inc.php'; 
    50                 require_once 'engine/class.ajax_ldap.inc.php'; 
    5150                require_once 'engine/config.ajax.inc.php'; 
    52                 $GLOBALS['ajax']->ldap = new ajax_ldap(); 
     51                $GLOBALS['ajax']->ldap = &Factory::getInstance('ajax_ldap'); 
    5352 
    5453                /* definição de algumas constantes */ 
     
    6463        public function prepareProcessEnvironment($processID) 
    6564        { 
    66                 require_once GALAXIA_LIBRARY . '/src/common/WfRuntime.php'; 
    6765                require_once PHPGW_SERVER_ROOT . '/workflow/inc/local/functions/local.functions.php'; 
    6866 
    69                 $runtime = new WfRuntime(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     67                $runtime = &Factory::getInstance('WfRuntime', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    7068                $runtime->loadProcess($processID); 
    7169 
  • sandbox/workflow/branches/609/inc/class.bo_adminaccess.inc.php

    r2233 r2311  
    1111 
    1212require_once('class.bo_ajaxinterface.inc.php'); 
    13 require_once('class.so_adminaccess.inc.php'); 
    14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'); 
    1513require_once(PHPGW_API_INC . SEP . 'common_functions.inc.php'); 
    16 require_once(PHPGW_API_INC . SEP . 'class.acl.inc.php'); 
    1714 
    1815/** 
     
    4643                        exit(serialize(array('error' => 'Você não tem permissão para executar esta operação.'))); 
    4744 
    48                 $this->so = new so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     45                $this->so = &Factory::getInstance('so_adminaccess', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    4946        } 
    5047 
     
    5754        function get_all_processes() 
    5855        { 
    59                 $proc_mng = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     56                $proc_mng = &Factory::newInstance('ProcessManager'); 
    6057                $proc_list = $proc_mng->list_processes(0,-1,'wf_name__ASC'); 
    6158 
     
    315312        { 
    316313                $GLOBALS['phpgw']->db = $GLOBALS['ajax']->db; 
    317                 $acl = new ACL(); 
     314                $acl = &Factory::getInstance('acl'); 
    318315                $output = $this->so->getUserNames($acl->get_ids_for_location('admin_workflow', 1, 'workflow')); 
    319316                unset($GLOBALS['phpgw']->db); 
     
    332329                $ids = explode('.', str_replace('g', '', str_replace('u', '', $params['user_ids']))); 
    333330                $GLOBALS['phpgw']->db = $GLOBALS['ajax']->db; 
    334                 $acl = new ACL(); 
     331                $acl = &Factory::getInstance('acl'); 
    335332                foreach ($ids as $id) 
    336333                        $acl->add_repository('workflow', 'admin_workflow', $id, 1); 
     
    350347        { 
    351348                $GLOBALS['phpgw']->db = $GLOBALS['ajax']->db; 
    352                 $acl = new ACL(); 
     349                $acl = &Factory::getInstance('acl'); 
    353350                $acl->delete_repository('workflow', 'admin_workflow', (int) $params['admin_id']); 
    354351                unset($GLOBALS['phpgw']->db); 
  • sandbox/workflow/branches/609/inc/class.bo_adminjobs.inc.php

    r2233 r2311  
    1111 
    1212require_once 'class.bo_ajaxinterface.inc.php'; 
    13 require_once 'class.so_adminjobs.inc.php'; 
    1413require_once 'nano/JSON.php'; 
    1514 
     
    3635        { 
    3736                parent::bo_ajaxinterface(); 
    38                 $this->so = new so_adminjobs(); 
     37                $this->so = &Factory::getInstance('so_adminjobs'); 
    3938        } 
    4039 
  • sandbox/workflow/branches/609/inc/class.bo_adminsource.inc.php

    r2233 r2311  
    1212require_once('class.bo_ajaxinterface.inc.php'); 
    1313 
    14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'); 
    15 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'RoleManager.php'); 
    16 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 
    1714require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'API' . SEP . 'Process.php'); 
    1815 
     
    103100        { 
    104101 
    105                 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     102                $process_manager = &Factory::newInstance('ProcessManager'); 
    106103                $proc_info       = $process_manager->get_process($p['proc_id']); 
    107104 
     
    228225        function get_php_files($p) 
    229226        { 
    230                 $process_manager    = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     227                $process_manager    = &Factory::newInstance('ProcessManager'); 
    231228                $proc_info          = $process_manager->get_process($p['proc_id']); 
    232                 $activity_manager   = new ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     229                $activity_manager   = &Factory::newInstance('ActivityManager'); 
    233230                $process_activities = $activity_manager->list_activities($p['proc_id'], 0, -1, 'wf_name__asc', '','',false); 
    234231                $path = GALAXIA_PROCESSES . SEP . $proc_info['wf_normalized_name'] . SEP . 'code' . SEP .'activities' . SEP; 
     
    293290                if ((strpos($p['file_name'],'/') !== false) || (strpos($p['file_name'],'/') !== false)) 
    294291                        return 'Não foi possível executar a operação solicitada'; 
    295                 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     292                $process_manager = &Factory::newInstance('ProcessManager'); 
    296293                $proc_info = $process_manager->get_process($p['proc_id']); 
    297294                $file_name = $p['file_name']; 
     
    351348        function create_file($p) 
    352349        { 
    353                 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     350                $process_manager = &Factory::newInstance('ProcessManager'); 
    354351                $proc_info = $process_manager->get_process($p['proc_id']); 
    355352                $file_name = $p['file_name']; 
     
    432429        function get_include_files($p) 
    433430        { 
    434                 $process_manager    = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     431                $process_manager    = &Factory::newInstance('ProcessManager'); 
    435432                $proc_info          = $process_manager->get_process($p['proc_id']); 
    436433                $path = GALAXIA_PROCESSES . SEP . $proc_info['wf_normalized_name'] . SEP . 'code'; 
     
    494491        function get_template_files($p) 
    495492        { 
    496                 $process_manager    = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     493                $process_manager    = &Factory::newInstance('ProcessManager'); 
    497494                $proc_info          = $process_manager->get_process($p['proc_id']); 
    498495                $path = GALAXIA_PROCESSES . SEP . $proc_info['wf_normalized_name'] . SEP . 'code' . SEP .'templates'; 
     
    555552        function upload_resource($p) 
    556553        { 
    557                 $process_manager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     554                $process_manager = &Factory::newInstance('ProcessManager'); 
    558555                $proc_info = $process_manager->get_process($p['proc_id']); 
    559556                $file_name = basename($_FILES['resource_file']['name']); 
     
    587584                if (strpos($_REQUEST['file_name'],'/') !== false) 
    588585                        return 'Não foi possível executar a operação solicitada'; 
    589                 $process_manager    = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     586                $process_manager    = &Factory::newInstance('ProcessManager'); 
    590587                $proc_info          = $process_manager->get_process($_REQUEST['proc_id']); 
    591588 
     
    630627        function get_resource_files($p) 
    631628        { 
    632                 $process_manager    = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     629                $process_manager    = &Factory::newInstance('ProcessManager'); 
    633630                $proc_info          = $process_manager->get_process($p['proc_id']); 
    634631 
  • sandbox/workflow/branches/609/inc/class.bo_ajaxinterface.inc.php

    r2233 r2311  
    3737require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'common.inc.php'); 
    3838require_once(PHPGW_API_INC . SEP . 'class.db.inc.php'); 
    39 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'class.ajax_ldap.inc.php'); 
    4039require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'class.ajax_config.inc.php'); 
    4140require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'engine' . SEP . 'config.ajax.inc.php'); 
    42 require_once(PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'class.so_adminaccess.inc.php'); 
    4341 
    4442/** 
     
    6664                if (isset($_SESSION['phpgw_info']['workflow']['account_id'])) 
    6765                { 
    68                         $GLOBALS['ajax']->ldap = new ajax_ldap(); 
     66                        $GLOBALS['ajax']->ldap = &Factory::getInstance('ajax_ldap'); 
    6967                        $GLOBALS['ajax']->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso(); 
    7068                        $GLOBALS['ajax']->db->Halt_On_Error = 'no'; 
     
    7472 
    7573                        $GLOBALS['phpgw']->ADOdb = &$GLOBALS['ajax']->db->Link_ID; 
    76                         $GLOBALS['ajax']->acl = new so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     74                        $GLOBALS['ajax']->acl = &Factory::getInstance('so_adminaccess', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    7775                } 
    7876                else 
  • sandbox/workflow/branches/609/inc/class.bo_editor.inc.php

    r795 r2311  
    1111 
    1212require_once('class.bo_ajaxinterface.inc.php'); 
    13 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 
    1413require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'); 
    1514/** 
     
    234233                if ($p['tipo_codigo'] != 'include') 
    235234                { 
    236                         $activity_manager   = new ActivityManager($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     235                        $activity_manager   = &Factory::newInstance('ActivityManager'); 
    237236 
    238237                        if ($this->check_process($p['proc_id'], &$activity_manager, &$error_str) == 'n') 
  • sandbox/workflow/branches/609/inc/class.bo_external_applications.inc.php

    r795 r2311  
    1111\**************************************************************************/ 
    1212 
    13 require_once('class.so_external_applications.inc.php'); 
    1413require_once('class.bo_ajaxinterface.inc.php'); 
    1514/** 
     
    3433        { 
    3534                parent::bo_ajaxinterface(); 
    36                 $this->so = new so_external_applications(); 
     35                $this->so = &Factory::getInstance('so_external_applications'); 
    3736        } 
    3837 
  • sandbox/workflow/branches/609/inc/class.bo_monitors.inc.php

    r2264 r2311  
    1212require_once('class.bo_ajaxinterface.inc.php'); 
    1313 
    14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php'); 
    15 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'); 
    16 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 
    17 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'InstanceManager.php'); 
    18 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'RoleManager.php'); 
    19 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessMonitor' . SEP . 'ProcessMonitor.php'); 
    20 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'API' . SEP . 'Instance.php'); 
    21 require_once('class.workflow_acl.inc.php'); 
     14require_once('class.workflow_acl.inc.php'); /* can we remove this? */ 
    2215require_once('class.bo_adminaccess.inc.php'); 
    2316require_once('class.powergraphic.inc.php'); 
     
    134127        { 
    135128                parent::bo_ajaxinterface(); 
    136                 $GLOBALS['ajax']->gui   = new GUI(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     129                $GLOBALS['ajax']->gui   = &Factory::newInstance('GUI'); 
    137130                $this->userID                   = $_SESSION['phpgw_info']['workflow']['account_id']; 
    138131                $this->isWorkflowAdmin  = $GLOBALS['ajax']->acl->checkWorkflowAdmin($this->userID); 
    139                 $this->processManager   = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    140                 $this->activityManager  = new ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    141                 $this->instanceManager  = new InstanceManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    142                 $this->roleManager              = new RoleManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    143                 $this->processMonitor   = new ProcessMonitor(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     132                $this->processManager   = &Factory::newInstance('ProcessManager'); 
     133                $this->activityManager  = &Factory::newInstance('ActivityManager'); 
     134                $this->instanceManager  = &Factory::newInstance('InstanceManager'); 
     135                $this->roleManager              = &Factory::newInstance('RoleManager'); 
     136                $this->processMonitor   = &Factory::newInstance('ProcessMonitor'); 
    144137        } 
    145138 
     
    169162        private function convertFiltersToSQL($filters) 
    170163        { 
    171                 require_once 'nano/JSON.php'; 
    172164 
    173165                /* desserializa os dados */ 
    174                 $JSON = new Services_JSON(); 
     166                $JSON = &Factory::newInstance('Services_JSON'); 
    175167                /* desserializa a array principal, depois desserializa cada elemento desta array e, por fim, converte os elementos (que estão em forma de objeto) para array associativa */ 
    176168                $filters = array_map('get_object_vars', array_map(array($JSON, 'decode'), $JSON->decode($filters))); 
     
    648640                if ($params['ns'] == 'aborted') 
    649641                { 
    650                         $realInstance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     642                        $realInstance = &Factory::newInstance('Instance'); 
    651643                        $realInstance->getInstance($params['iid']); 
    652644                        if (!empty($realInstance->instanceId)) 
     
    684676 
    685677                /* use next user or * for the new instance */ 
    686                 $realInstance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     678                $realInstance = &Factory::newInstance('Instance'); 
    687679                $realInstance->getInstance($params['iid'], false, false); 
    688680                $user = $realInstance->getNextUser($params['aid']); 
     
    751743 
    752744                $maximumDisplaySize = 100; 
    753                 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     745                $instance = &Factory::newInstance('Instance'); 
    754746                $instance->getInstance($params['iid']); 
    755747 
     
    783775                        return "Você não tem permissão para executar este procedimento!"; 
    784776 
    785                 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     777                $instance = &Factory::newInstance('Instance'); 
    786778                $instance->getInstance($params['iid']); 
    787779                $output = $params; 
     
    804796                $maximumDisplaySize = 100; 
    805797 
    806                 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     798                $instance = &Factory::newInstance('Instance'); 
    807799                $instance->getInstance($params['iid']); 
    808800                $instance->set($params['name'], $params['value']); 
     
    835827                        return "Você não tem permissão para executar este procedimento!"; 
    836828 
    837                 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     829                $instance = &Factory::newInstance('Instance'); 
    838830                $instance->getInstance($params['iid']); 
    839831                $instance->clear($params['name']); 
     
    858850                $output = array(); 
    859851                $urlPrefix = 'workflow/inc/class.powergraphic.inc.php?'; 
    860                 $powergraphic = new powergraphic; 
     852                $powergraphic = &Factory::getInstance('powergraphic'); 
    861853                $powergraphic->graphic_1 = $params['pid']; 
    862854                $powergraphic->skin = 1; 
  • sandbox/workflow/branches/609/inc/class.bo_move_instances.inc.php

    r795 r2311  
    1212 
    1313require_once('class.bo_ajaxinterface.inc.php'); 
    14 require_once('class.so_move_instances.inc.php'); 
    15 require_once('nano/JSON.php'); 
    1614 
    1715 
     
    3937        { 
    4038                parent::bo_ajaxinterface(); 
    41                 $this->so = new so_move_instances(); 
     39                $this->so = &Factory::getInstance('so_move_instances'); 
    4240        } 
    4341 
     
    7977        function moveInstances($params) 
    8078        { 
    81                 $JSON = new Services_JSON(); 
     79                $JSON = &Factory::newInstance('Services_JSON'); 
    8280 
    8381                /* convert the mappgin element to array */ 
  • sandbox/workflow/branches/609/inc/class.bo_orgchart.inc.php

    r2042 r2311  
    1010\**************************************************************************/ 
    1111 
    12 require_once('class.so_orgchart.inc.php'); 
    1312require_once('class.bo_ajaxinterface.inc.php'); 
    1413/** 
     
    4746        { 
    4847                parent::bo_ajaxinterface(); 
    49                 $this->so = new so_orgchart(); 
     48                $this->so = &Factory:::getInstance('so_orgchart'); 
    5049        } 
    5150 
  • sandbox/workflow/branches/609/inc/class.bo_userinterface.inc.php

    r2292 r2311  
    1010\**************************************************************************/ 
    1111 
    12 require_once('class.so_userinterface.inc.php'); 
    1312require_once('class.bo_ajaxinterface.inc.php'); 
    1413 
    15 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php'); 
    16 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 
    1714/** 
    1815 * @package Workflow 
     
    4340        { 
    4441                parent::bo_ajaxinterface(); 
    45                 $this->so = new so_userinterface(); 
    46                 $GLOBALS['ajax']->gui = new GUI(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     42                $this->so = &Factory::getInstance('so_userinterface'); 
     43                $GLOBALS['ajax']->gui = &Factory::newInstance('GUI'); 
    4744        } 
    4845 
     
    120117                $result = array(); 
    121118 
    122                 $process = new Process(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     119                $process = &Factory::newInstance('Process'); 
    123120                $process->getProcess($pid); 
    124121                $result['wf_procname'] = $process->name; 
     
    126123                $result['wf_description'] = $process->description; 
    127124 
    128                 $activ_manager = new ActivityManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     125                $activ_manager = &Factory::newInstance('ActivityManager'); 
    129126                $result['wf_activities'] = $activ_manager->get_process_activities($pid); 
    130127 
     
    494491                } 
    495492 
    496                 $instance = new Instance(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     493                $instance = &Factory::newInstance('Instance'); 
    497494                $instance->getInstance($instanceID); 
    498495 
    499                 $process = new Process(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     496                $process = &Factory::newInstance('Process'); 
    500497                $process->getProcess($instance->pId); 
    501498 
  • sandbox/workflow/branches/609/inc/class.bo_utils.inc.php

    r2233 r2311  
    8888                        $ret_name = empty($params['name']) ? 'cn' : $params['name']; 
    8989 
    90                         $ajaxConfig = new ajax_config('contactcenter'); 
     90                        $ajaxConfig = &Factory::getInstance('ajax_config', 'contactcenter'); 
    9191                        $config = $ajaxConfig->read_repository(); 
    9292 
  • sandbox/workflow/branches/609/inc/class.external_bridge.inc.php

    r2233 r2311  
    1313require_once 'common.inc.php'; 
    1414require_once 'engine/config.egw.inc.php'; 
    15 require_once 'class.so_adminaccess.inc.php'; 
    1615 
    1716/** 
     
    5352        { 
    5453                $this->db = Factory::getInstance('WorkflowObjects')->getDBGalaxia(); 
    55                 $this->acl = new so_adminaccess(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     54                $this->acl = &Factory::getInstance('so_adminaccess', Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
    5655        } 
    5756        /** 
  • sandbox/workflow/branches/609/inc/class.powergraphic.inc.php

    r795 r2311  
    141141 
    142142 
    143 $PowerGraphic = new powergraphic; 
     143$PowerGraphic = &Factory::newInstance('powergraphic'); 
    144144 
    145145$PowerGraphic->start(); 
  • sandbox/workflow/branches/609/inc/class.run_activity.inc.php

    r2264 r2311  
    1414        require_once(dirname(__FILE__) . SEP . 'class.basecontroller.inc.php' ); /* module controller            */ 
    1515        require_once(dirname(__FILE__) . SEP . 'class.basemodel.inc.php'      ); /* module logic                 */ 
    16         require_once(dirname(__FILE__) . SEP . 'class.utils.security.php'     ); /* sanitizes input data         */ 
    1716 
    1817        /** 
     
    438437                        $env['instance']      =& $instance;                        //process manager instance 
    439438                        $env['activity']      =& $activity;                        //activity manager instance 
    440                         $security             =& new SecurityUtils();              //input sanitizer class 
     439                        $security             =& Factory::newInstance('SecurityUtils');              //input sanitizer class 
    441440                        $env['request']       =& $security->process($_REQUEST);    //sanitizes input data from client 
    442441                        //$env['factory']       =& new ProcessFactory();             //instantiation controller class 
     
    710709                        $env['instance']      =& $instance;                        //process manager instance 
    711710                        $env['activity']      =& $activity;                        //activity manager instance 
    712                         $security             =& new SecurityUtils();              //input sanitizer class 
     711                        $security             =& Factory::newInstance('SecurityUtils'); //input sanitizer class 
    713712                        $env['request']       =& $security->process($_REQUEST); //sanitizes input data from client 
    714713                        //$env['factory']       =& new ProcessFactory();                           //instantiation controller class 
     
    738737 
    739738                        $GLOBALS['workflow_env'] = &$env; 
    740                         $nc = new NanoController(); 
     739                        $nc = &Factory::newInstance('NanoController'); 
    741740                        $nc->setClassPath(GALAXIA_PROCESSES . SEP . $this->process->getNormalizedName(). SEP . 'code'); 
    742741                        $nc->iterateOverVirtualRequests(); 
  • sandbox/workflow/branches/609/inc/class.so_adminjobs.inc.php

    r2233 r2311  
    1111 
    1212require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'; 
    13 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'JobManager.php'; 
    1413require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'; 
    1514 
     
    9796                $this->acl = &$GLOBALS['ajax']->acl; 
    9897                $this->db = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 
    99                 $this->jobManager = new JobManager(&$this->db); 
     98                $this->jobManager = &Factory::newInstance('JobManager'); 
    10099        } 
    101100 
  • sandbox/workflow/branches/609/inc/class.so_move_instances.inc.php

    r2233 r2311  
    1111\**************************************************************************/ 
    1212 
    13 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'); 
    14 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 
    1513 
    1614/** 
     
    113111                                $where[] = 'wf_p_id IS NULL'; 
    114112                } 
    115                 $processManager = new ProcessManager($this->db); 
     113                $processManager = &Factory::getInstance('ProcessManager', $this->db); 
    116114 
    117115                /* workaround to sort the result using two columns */ 
     
    137135                $this->_checkAccess($processID); 
    138136 
    139                 $activityManager = new ActivityManager($this->db); 
     137                $activityManager = &Factory::newInstance('ActivityManager'); 
    140138                $activities = $activityManager->list_activities($processID, 0, -1, 'wf_name__ASC', '', 'wf_type <> \'standalone\' AND wf_type <> \'view\''); 
    141139                $output = array(); 
  • sandbox/workflow/branches/609/inc/class.so_userinterface.inc.php

    r2233 r2311  
    11<?php 
    2 require_once($_SESSION['phpgw_info']['workflow']['phpgw_api_inc'] . '/class.config.inc.php'); 
    32 
    43/** 
     
    6160                $oldDB = $GLOBALS['phpgw']->db; 
    6261                $GLOBALS['phpgw']->db = $GLOBALS['ajax']->db; 
    63                 $config = new config('workflow'); 
     62                $config = &Factory::getInstance('config', 'workflow'); 
    6463                $configValues = $config->read_repository(); 
    6564                $submasksString = $configValues['intranet_subnetworks']; 
     
    596595                require_once dirname(__FILE__) . '/class.so_orgchart.inc.php'; 
    597596 
    598                 $SOOrgchart = new so_orgchart(); 
     597                $SOOrgchart = &Factory::getInstance('so_orgchart'); 
    599598                $SOOrgchart->setExternalCalls(true); 
    600599                $output = $SOOrgchart->getEmployeeInfo($employeeID, $organizationID); 
     
    616615                require_once dirname(__FILE__) . '/class.so_orgchart.inc.php'; 
    617616 
    618                 $SOOrgchart = new so_orgchart(); 
     617                $SOOrgchart = &Factory::getInstance('so_orgchart'); 
    619618                $SOOrgchart->setExternalCalls(true); 
    620619                $output = $SOOrgchart->getAreaInfo($areaID, $organizationID); 
  • sandbox/workflow/branches/609/inc/class.ui_adminactivities.inc.php

    r2253 r2311  
    22 
    33require_once dirname(__FILE__) . SEP . 'class.WorkflowUtils.inc.php'; 
    4 require_once dirname(__FILE__) . SEP . 'class.fsutils.inc.php'; /* toolkit for filesystem handling */ 
    54require_once 'engine' . SEP . 'config.egw.inc.php'; 
    65/** 
     
    109108                $this->activity_manager = Factory::getInstance('workflow_activitymanager'); 
    110109                $this->role_manager     = Factory::getInstance('workflow_rolemanager'); 
    111                 $this->fs = new FsUtils(); /* gets instance */ 
     110                $this->fs = &Factory::newInstance('FsUtils'); /* gets instance */ 
    112111 
    113112        } 
  • sandbox/workflow/branches/609/inc/class.ui_orgchart.inc.php

    r2264 r2311  
    103103                else 
    104104                        die(); 
    105  
    106                 require_once(dirname(__FILE__) . SEP . 'engine' . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'GraphViz.php'); 
    107105 
    108106                $config_values = Factory::getInstance('config', 'workflow'); 
     
    122120                $attributes['ranksep'] = '1.5 equally'; 
    123121                $attributes['rankdir'] = 'LR'; 
    124                 $graph = new Process_GraphViz(true, $attributes); 
     122                $graph = &Factory::getInstance('Process_GraphViz', true, $attributes); 
    125123 
    126124 
  • sandbox/workflow/branches/609/inc/class.ui_phpeditor.inc.php

    r2253 r2311  
    1111 
    1212require_once dirname(__FILE__) . SEP . 'engine' . SEP . 'config.ajax.inc.php'; 
    13 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ProcessManager.php'; 
    1413require_once dirname(__FILE__) . SEP . 'class.ui_ajaxinterface.inc.php'; 
    1514/** 
     
    6362        { 
    6463                $smarty = Factory::getInstance('workflow_smarty', false); 
    65                 $processManager = new ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     64                $processManager = &Factory::newInstance('ProcessManager'); 
    6665                $proccessInfo = $processManager->get_process($_GET['proc_id']); 
    6766 
  • sandbox/workflow/branches/609/inc/class.ui_userinterface.inc.php

    r2253 r2311  
    129129 
    130130                /* create some objects */ 
    131                 require_once 'class.so_userinterface.inc.php'; 
    132                 $so = new so_userinterface(); 
    133                 $smarty = Factory::getInstance('workflow_smarty'); 
     131                $so = &Factory::getInstance('so_userinterface'); 
     132                $smarty = &Factory::getInstance('workflow_smarty'); 
    134133 
    135134                /* get the user's organization */ 
  • sandbox/workflow/branches/609/inc/class.workflow_processmanager.inc.php

    r2253 r2311  
    3434                function workflow_processmanager() 
    3535                { 
    36                         parent::ProcessManager(Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID); 
     36                        parent::ProcessManager(); 
    3737                        $this->workflow_acl = Factory::getInstace('workflow_acl'); 
    3838 
     
    6262                function import_process(&$data) 
    6363                { 
    64                         if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     64                        if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    6565 
    6666                        if (parent::import_process($data)) 
     
    121121                function serialize_process($pId) 
    122122                { 
    123                         if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     123                        if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    124124                        if (!isset($this->jobManager)) 
    125                                 $this->jobManager = new JobManager($this->db); 
     125                                $this->jobManager = &Factory::newInstance('JobManager'); 
    126126                 
    127127                        //if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
  • sandbox/workflow/branches/609/inc/engine/config.ajax.inc.php

    r2233 r2311  
    256256        function galaxia_get_config_values($parameters=array()) 
    257257        { 
    258                         $config = new ajax_config(); 
     258                        $config = &Factory::getInstance('ajax_config'); 
    259259                        $config->read_repository(); 
    260260 
  • sandbox/workflow/branches/609/inc/engine/src/API/BaseActivity.php

    r795 r2311  
    9797   * @access public 
    9898   */ 
    99   function BaseActivity(&$db) 
     99  function BaseActivity() 
    100100  { 
    101101    $this->type='base'; 
    102102    $this->child_name = 'BaseActivity'; 
    103     parent::Base($db); 
     103    parent::Base(); 
    104104  } 
    105105 
     
    122122    if(!$result || !$result->numRows() ) return false; 
    123123    $res = $result->fetchRow(); 
     124 
    124125    switch($res['wf_type']) { 
    125126      case 'start': 
    126         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Start.php'); 
    127         $act = new Start($this->db);   
    128         break; 
     127        $act = &Factory::newInstance('Start'); 
     128        break; 
     129 
    129130      case 'end': 
    130         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'End.php'); 
    131         $act = new End($this->db); 
    132         break; 
     131        $act = &Factory::newInstance('End'); 
     132        break; 
     133 
    133134      case 'join': 
    134         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Join.php'); 
    135         $act = new Join($this->db); 
    136         break; 
     135        $act = &Factory::newInstance('Join'); 
     136        break; 
     137 
    137138      case 'split': 
    138         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Split.php'); 
    139         $act = new Split($this->db); 
    140         break; 
     139        $act = &Factory::newInstance('Split'); 
     140        break; 
     141 
    141142      case 'standalone': 
    142         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Standalone.php'); 
    143         $act = new Standalone($this->db); 
    144         break; 
     143        $act = &Factory::newInstance('Standalone'); 
     144        break; 
     145 
    145146      case 'view': 
    146         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'View.php'); 
    147         $act = new View($this->db); 
    148         break; 
     147        $act = &Factory::newInstance('View'); 
     148        break; 
     149 
    149150      case 'switch': 
    150         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'SwitchActivity.php'); 
    151         $act = new SwitchActivity($this->db); 
    152         break; 
     151        $act = &Factory::newInstance('SwitchActivity'); 
     152        break; 
     153 
    153154      case 'activity': 
    154         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'activities'.SEP.'Activity.php'); 
    155         $act = new Activity($this->db); 
    156         break; 
     155        $act = &Factory::newInstance('Activity'); 
     156        break; 
     157 
    157158      default: 
    158159        trigger_error('Unknown activity type:'.$res['wf_type'],E_USER_WARNING); 
    159160    } 
    160      
     161 
    161162    $act->setName($res['wf_name']); 
    162163    $act->setProcessId($res['wf_p_id']); 
  • sandbox/workflow/branches/609/inc/engine/src/API/Instance.php

    r795 r2311  
    11<?php 
    22require_once (GALAXIA_LIBRARY.SEP.'src'.SEP.'common'.SEP.'Base.php'); 
    3 require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'common' . SEP . 'WfSecurity.php'); 
    43require_once(GALAXIA_LIBRARY . SEP . 'src' . SEP . 'ProcessManager' . SEP . 'ActivityManager.php'); 
    54 
     
    141140 
    142141  var $activityID = null; 
    143   function Instance($db)  
     142  function Instance()  
    144143  { 
    145144    $this->child_name = 'Instance'; 
    146     parent::Base($db); 
     145    parent::Base(); 
    147146  } 
    148147 
     
    11711170     
    11721171    //lock rows and ensure access is granted 
    1173     if (!(isset($this->security))) $this->security =& new WfSecurity($this->db);  
     1172    if (!(isset($this->security))) $this->security = &Factory::getInstance('WfSecurity', $this->db); 
    11741173    if (!($this->security->checkUserAction($activityId,$this->instanceId,'complete'))) 
    11751174    { 
     
    15511550    { 
    15521551      //we check rights for this user on the next activity 
    1553       if (!(isset($this->security))) $this->security =& new WfSecurity($this->db);  
     1552      if (!(isset($this->security))) $this->security = &Factory::getInstance('WfSecurity'); 
    15541553      if ($this->security->checkUserAccess($the_next_user,$activityId)) 
    15551554      { 
     
    15601559    { 
    15611560      // then check to see if there is a default user 
    1562       $activity_manager =& new ActivityManager($this->db); 
     1561      $activity_manager = &Factory::newInstance('ActivityManager'); 
    15631562      //get_default_user will give us '*' if there is no default_user or if the default user has no role 
    15641563      //mapped anymore 
  • sandbox/workflow/branches/609/inc/engine/src/API/Process.php

    r795 r2311  
    4848         * @access public 
    4949         */ 
    50         function Process(&$db)  
     50        function Process()  
    5151        { 
    5252                $this->child_name = 'Process'; 
    53                 parent::Base($db); 
     53                parent::Base(); 
    5454        } 
    5555 
  • sandbox/workflow/branches/609/inc/engine/src/API/activities/Activity.php

    r795 r2311  
    1616         * @access public 
    1717         */ 
    18         function Activity(&$db) 
     18        function Activity() 
    1919        { 
    20                 parent::Base($db); 
     20                parent::Base(); 
    2121                $this->child_name = 'Activity'; 
    2222        } 
  • sandbox/workflow/branches/609/inc/engine/src/API/activities/End.php

    r795 r2311  
    1515         * @access public 
    1616         */ 
    17         function End(&$db) 
     17        function End() 
    1818        { 
    19                 parent::Base($db); 
     19                parent::Base(); 
    2020                $this->child_name = 'End'; 
    2121        } 
  • sandbox/workflow/branches/609/inc/engine/src/API/activities/Join.php

    r795 r2311  
    1515         * @access public 
    1616         */ 
    17         function Join(&$db) 
     17        function Join() 
    1818        { 
    19                 parent::Base($db); 
     19                parent::Base(); 
    2020                $this->child_name = 'Join'; 
    2121        } 
  • sandbox/workflow/branches/609/inc/engine/src/API/activities/Split.php

    r795 r2311  
    1515         * @access public 
    1616         */ 
    17         function Split(&$db) 
     17        function Split() 
    1818        { 
    19                 parent::Base($db); 
     19                parent::Base(); 
    2020                $this->child_name = 'Split'; 
    2121        } 
  • sandbox/workflow/branches/609/inc/engine/src/API/activities/Standalone.php

    r795 r2311  
    1515         * @access public 
    1616         */ 
    17         function Standalone(&$db) 
     17        function Standalone() 
    1818        { 
    19                 parent::Base($db); 
     19                parent::Base(); 
    2020                $this->child_name = 'Standalone'; 
    2121        } 
  • sandbox/workflow/branches/609/inc/engine/src/API/activities/Start.php

    r795 r2311  
    1515         * @access public 
    1616         */ 
    17         function Start(&$db) 
     17        function Start() 
    1818        { 
    19                 parent::Base($db); 
     19                parent::Base(); 
    2020                $this->child_name = 'Start'; 
    2121        } 
  • sandbox/workflow/branches/609/inc/engine/src/API/activities/SwitchActivity.php

    r795 r2311  
    1616         * @access public 
    1717         */ 
    18         function SwitchActivity(&$db) 
     18        function SwitchActivity() 
    1919        { 
    20            parent::Base($db); 
     20           parent::Base(); 
    2121           $this->child_name = 'Switch'; 
    2222        } 
  • sandbox/workflow/branches/609/inc/engine/src/API/activities/View.php

    r795 r2311  
    1616         * @access public 
    1717         */      
    18         function View(&$db) 
     18        function View() 
    1919        { 
    20                 parent::Base($db); 
     20                parent::Base(); 
    2121                $this->child_name = 'View'; 
    2222        } 
  • sandbox/workflow/branches/609/inc/engine/src/GUI/GUI.php

    r795 r2311  
    3232   * @access public 
    3333   */ 
    34   function GUI(&$db)  
     34  function GUI() 
    3535  { 
    3636    $this->child_name = 'GUI'; 
    37     parent::Base($db); 
    38     require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'common'.SEP.'WfSecurity.php'); 
    39     $this->wf_security =& new WfSecurity($this->db);  
     37    parent::Base(); 
     38    $this->wf_security = &Factory::getInstance('WfSecurity'); 
    4039  } 
    4140 
     
    703702      if (!(isset($this->pm))) 
    704703      { 
    705         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'ProcessManager.php'); 
    706         $this->pm =& new ProcessManager($this->db); 
     704        $this->pm = &Factory::newInstance('ProcessManager'); 
    707705      } 
    708706      $this->process_cache[$pId]['view'] = $this->pm->get_process_view_activity($pId); 
     
    871869    { 
    872870      //the security object said everything was fine 
    873       $instance = new Instance($this->db); 
     871      $instance = &Factory::newInstance('Instance'); 
    874872      $instance->getInstance($instanceId); 
    875873      if (!empty($instance->instanceId))  
     
    975973    { 
    976974      //the security object said everything was fine 
    977       $instance =& new Instance($this->db); 
     975      $instance = &Factory::newInstance('Instance'); 
    978976      $instance->getInstance($instanceId); 
    979977      // we force the execution of the activity 
     
    10121010    { 
    10131011      //the security object said everything was fine 
    1014       $instance =& new Instance($this->db); 
     1012      $instance = &Factory::newInstance('Instance'); 
    10151013      $instance->getInstance($instanceId); 
    10161014      // we force the continuation of the flow 
  • sandbox/workflow/branches/609/inc/engine/src/ProcessManager/ActivityManager.php

    r795 r2311  
    2626   * @access public 
    2727   */ 
    28   function ActivityManager(&$db) 
    29   { 
    30     parent::BaseManager($db); 
     28  function ActivityManager() 
     29  { 
     30    parent::BaseManager(); 
    3131    $this->child_name = 'ActivityManager'; 
    3232    require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager' .SEP . 'ProcessManager.php'); 
     
    370370  function build_process_graph($pId) 
    371371  { 
    372     if (!(isset($this->process_manager))) $this->process_manager = new ProcessManager($this->db); 
     372    if (!(isset($this->process_manager))) $this->process_manager = &Factory::newInstance('ProcessManager'); 
    373373    $attributes = Array( 
    374374     
    375375    ); 
    376     $graph = new Process_GraphViz(true,$attributes); 
     376    $graph = &Factory::newInstance('Process_GraphViz', true, $attributes); 
    377377    $name = $this->process_manager->_get_normalized_name($pId); 
    378378    $graph->set_pid($name); 
     
    747747  { 
    748748    require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP . 'BaseActivity.php'); 
    749     $act = new BaseActivity($this->db); 
     749    $act = &Factory::newInstance('BaseActivity'); 
    750750    //Warning, we now use the BaseActivity object for it, interactivity and autorouting is now true/fales, not y/n 
    751751    return ($act->getActivity($activityId,false,true, true)); 
     
    825825  function remove_activity($pId, $activityId, $transaction = true) 
    826826  { 
    827     if (!(isset($this->process_manager))) $this->process_manager = new ProcessManager($this->db); 
     827    if (!(isset($this->process_manager))) $this->process_manager = &Factory::newInstance('ProcessManager'); 
    828828    $proc_info = $this->process_manager->get_process($pId); 
    829829    $actname = $this->_get_normalized_name($activityId); 
     
    888888  function replace_activity($pId, $activityId, $vars, $create_files=true) 
    889889  { 
    890     if (!(isset($this->process_manager))) $this->process_manager = new ProcessManager($this->db); 
     890    if (!(isset($this->process_manager))) $this->process_manager = &Factory::newInstance('ProcessManager'); 
    891891    $TABLE_NAME = GALAXIA_TABLE_PREFIX.'activities'; 
    892892    $now = date("U"); 
     
    11951195    elseif ( (!($result=='*')) && $performAccessCheck) 
    11961196    { 
    1197       $wf_security = new WfSecurity($this->db); 
     1197      $wf_security = &Factory::getInstance('WfSecurity', $this->db); 
    11981198      // perform the check 
    11991199      if (!($wf_security->checkUserAccess($result,$activityId))) 
  • sandbox/workflow/branches/609/inc/engine/src/ProcessManager/BaseManager.php

    r2165 r2311  
    1818   * @access public 
    1919   */ 
    20   function BaseManager(&$db) 
     20  function BaseManager() 
    2121  { 
    2222    $this->child_name = 'BaseManager'; 
    23     parent::Base($db); 
     23    parent::Base(); 
    2424  } 
    2525 
  • sandbox/workflow/branches/609/inc/engine/src/ProcessManager/InstanceManager.php

    r795 r2311  
    1616   * @access public 
    1717   */ 
    18   function InstanceManager(&$db)  
    19   { 
    20     parent::BaseManager($db); 
     18  function InstanceManager()  
     19  { 
     20    parent::BaseManager(); 
    2121    $this->child_name = 'InstanceManager'; 
    2222  } 
  • sandbox/workflow/branches/609/inc/engine/src/ProcessManager/JobManager.php

    r795 r2311  
    7676         * @access public 
    7777         */ 
    78         public function JobManager(&$db) 
    79         { 
    80                 parent::BaseManager($db); 
     78        public function JobManager() 
     79        { 
     80                parent::BaseManager(); 
    8181                $this->child_name = 'JobManager'; 
    8282 
    8383                $this->jobTable = GALAXIA_TABLE_PREFIX . 'jobs'; 
    8484                $this->logTable = GALAXIA_TABLE_PREFIX . 'job_logs'; 
    85                 $this->processManager = new ProcessManager($this->db); 
     85                $this->processManager = &Factory::newInstance('ProcessManager'); 
    8686        } 
    8787 
  • sandbox/workflow/branches/609/inc/engine/src/ProcessManager/ProcessManager.php

    r2165 r2311  
    6666         * @access public 
    6767         */ 
    68         function ProcessManager(&$db) 
    69         { 
    70                 parent::BaseManager($db); 
     68        function ProcessManager() 
     69        { 
     70                parent::BaseManager(); 
    7171                $this->child_name = 'ProcessManager'; 
    7272                require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'ActivityManager.php'); 
     
    131131        function serialize_process($pId) 
    132132        { 
    133                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     133                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    134134                // <process> 
    135135                $out = '<process>'."\n"; 
     
    459459        { 
    460460                //Now the show begins 
    461                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
    462                 if (!(isset($this->role_manager))) $this->role_manager = new RoleManager($this->db); 
     461                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
     462                if (!(isset($this->role_manager))) $this->role_manager = &Factory::newInstance('RoleManager'); 
    463463                if (!isset($this->jobManager)) 
    464                         $this->jobManager = new JobManager($this->db); 
     464                        $this->jobManager = &Factory::newInstance('JobManager'); 
    465465 
    466466                // First create the process. Always inactive and inactive first. 
     
    620620        function new_process_version($pId, $minor=true) 
    621621        { 
    622                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     622                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    623623                $oldpid = $pId; 
    624624                //retrieve process info with config rows 
     
    671671                } 
    672672                // create roles 
    673                 if (!(isset($this->role_manager))) $this->role_manager = new RoleManager($this->db); 
     673                if (!(isset($this->role_manager))) $this->role_manager = &Factory::newInstance('RoleManager'); 
    674674                $query = 'select * from '.GALAXIA_TABLE_PREFIX.'roles where wf_p_id=?'; 
    675675                $result = $this->query($query, array($oldpid)); 
     
    853853        function remove_process($pId) 
    854854        { 
    855                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     855                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    856856                if (!isset($this->jobManager)) 
    857                         $this->jobManager = new JobManager($this->db); 
     857                        $this->jobManager = &Factory::newInstance('JobManager'); 
    858858                $this->deactivate_process($pId); 
    859859                $name = $this->_get_normalized_name($pId); 
     
    919919        function replace_process($pId, &$vars, $create = true) 
    920920        { 
    921                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     921                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    922922                $TABLE_NAME = GALAXIA_TABLE_PREFIX.'processes'; 
    923923                $now = date("U"); 
     
    12961296                { 
    12971297                        //Warning: this means you have to include the Process.php from the API 
    1298                         $this->Process = new Process($this->db); 
     1298                        $this->Process = &Factory::newInstance('Process'); 
    12991299                        $this->Process->getProcess($pId); 
    13001300                        $result_array = $this->Process->getConfigValues($config_array); 
     
    13161316        { 
    13171317                //Warning: this means you have to include the Process.php from the API 
    1318                 $this->Process = new Process($this->db); 
     1318                $this->Process = &Factory::newInstance('Process'); 
    13191319                $this->Process->getProcess($pId); 
    13201320                $this->Process->setConfigValues($config_array); 
  • sandbox/workflow/branches/609/inc/engine/src/ProcessManager/RoleManager.php

    r2233 r2311  
    1919   * @access public 
    2020   */ 
    21   function RoleManager(&$db)  
    22   { 
    23     parent::Base($db); 
     21  function RoleManager()  
     22  { 
     23    parent::Base(); 
    2424    $this->child_name = 'RoleManager'; 
    2525  } 
  • sandbox/workflow/branches/609/inc/engine/src/ProcessMonitor/ProcessMonitor.php

    r795 r2311  
    1818   * @access public 
    1919   */ 
    20   function ProcessMonitor(&$db) 
     20  function ProcessMonitor() 
    2121  { 
    2222    $this->child_name = 'ProcessMonitor'; 
    23     parent::Base($db); 
     23    parent::Base(); 
    2424    // check the the actual user can really do this 
    2525    if ( !(galaxia_user_can_monitor())) 
  • sandbox/workflow/branches/609/inc/engine/src/common/Base.php

    r2165 r2311  
    3939        var $child_name = 'Base'; 
    4040 
     41        /** 
     42         * @var object $db_shared_obj The database abstraction object shared between 
     43         *                                                    all instances of this class. 
     44         * @acess private 
     45         * @static 
     46         */ 
     47        private static $db_shared_obj = null; 
     48 
    4149  /** 
    4250   * Constructor receiving a database abstraction object 
     
    4654   * @access public 
    4755   */ 
    48   function Base(&$db) 
     56  function Base() 
    4957  { 
    50     if(!$db) { 
     58        /** 
     59         * New Stuff! 
     60         * We decided to get here the database object. In a recent past, 
     61         * all the classes that specialize this one passed a db object. 
     62         * Now, to simplify and save memory, we store the database object 
     63         * into a single and static atribute shared among each instance 
     64         * of this class. 
     65         * 
     66         * To prevent to modify all sub-classes to use "self::$db" instead 
     67         * of "this->db", we made a very tiny workaround here. In the first 
     68         * instantiation of this class, we instantiate the database object 
     69         * and store it into 'self::$db_shared_obj'. Any subsequent 
     70         * instantiations will just point to the static one. 
     71         */ 
     72        if (!self::$db_shared_obj) 
     73                self::$db_shared_obj = &Factory::getInstance('WorkflowObjects')->getDBGalaxia()->Link_ID; 
     74 
     75        $this->db = &self::$db_shared_obj; 
     76 
     77 
     78    if(!$this->db) { 
    5179      die('Invalid db object passed to '.$this->child_name.' constructor'); 
    5280    } 
    5381    //Force transactionnal mysql (Innodb) -> mysqlt 
    54     if ($db->databaseType=='mysql') 
     82    if ($this->db->databaseType=='mysql') 
    5583    { 
    5684        $GLOBALS['phpgw']->db->disconnect(); 
    57         $db = $GLOBALS['phpgw']->db->connect( 
     85        $this->db = $GLOBALS['phpgw']->db->connect( 
    5886                        $GLOBALS['phpgw_info']['server']['db_name'], 
    5987                        $GLOBALS['phpgw_info']['server']['db_host'], 
     
    6492                ); 
    6593    } 
    66     $this->db = &$db; 
    6794  } 
    6895 
  • sandbox/workflow/branches/609/inc/engine/src/common/WfRuntime.php

    r2253 r2311  
    8686   * @access public 
    8787   */ 
    88   function WfRuntime(&$db)  
     88  function WfRuntime()  
    8989  { 
    9090    $this->child_name = 'WfRuntime'; 
    91     parent::Base($db); 
    92     require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'BaseActivity.php'); 
    93     require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Process.php'); 
    94     require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Instance.php'); 
    95     require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'common'.SEP.'WfSecurity.php'); 
    96      
     91    parent::Base(); 
     92 
    9793    //first the activity is not set 
    9894    $this->activity = null; 
    99     $this->instance = new Instance($this->db); 
    100     $this->process = new Process($this->db); 
    101     $this->security = new WfSecurity($this->db);  
     95    $this->instance = &Factory::newInstance('Instance'); 
     96    $this->process = &Factory::newInstance('Process'); 
     97    $this->security = &Factory::getInstance('WfSecurity'); 
    10298  } 
    10399 
     
    276272      return false; 
    277273    } 
    278     $base_activity = new BaseActivity($this->db); 
     274    $base_activity = &Factory::getInstance('BaseActivity', $this->db); 
    279275    $this->activity =& $base_activity->getActivity($activity_id, $with_roles, $with_agents); 
    280276    if (!$this->activity) 
  • sandbox/workflow/branches/609/inc/engine/src/common/WfSecurity.php

    r795 r2311  
    2323   * @access public 
    2424   */ 
    25   function WfSecurity(&$db)  
     25  function WfSecurity()  
    2626  { 
    2727    $this->child_name = 'WfSecurity'; 
    28     parent::Base($db); 
    29     require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Instance.php'); 
    30     require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Process.php'); 
    31     require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'BaseActivity.php'); 
     28    parent::Base(); 
     29 
     30        /* I'm not really sure if we can strip it out. */ 
     31 
     32    //require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Instance.php'); 
     33    //require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'Process.php'); 
     34    //require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP.'BaseActivity.php'); 
    3235  } 
    3336 
     
    5861      ); 
    5962      //check theses values for this process and store the result for this object life duration 
    60       $myProcess = new Process($this->db); 
     63      $myProcess = &Factory::newInstance('Process'); 
    6164      $myProcess->getProcess($pId); 
    6265      $this->processesConfig[$pId] = $myProcess->getConfigValues($arrayConf); 
     
    577580      if (!(isset($this->pm))) 
    578581      { 
    579         require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'ProcessManager.php'); 
    580         $this->pm = new ProcessManager($this->db); 
     582        $this->pm = &Factory::newInstance('ProcessManager'); 
    581583      } 
    582584      //$this->error[] = 'DEBUG: checking to see if there is no view activities on process :'.$pId.':'.$this->pm->get_process_view_activity($pId); 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_engine.php

    r2292 r2311  
    191191        function getChildInstances($instanceID = null, $activityID = null) 
    192192        { 
    193                 $WFInstance = Factory::getInstance('wf_instance'); 
     193                $WFInstance = &Factory::getInstance('wf_instance'); 
    194194                $preOutput = $WFInstance->getChildren($instanceID, $activityID); 
    195195                $output = array(); 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_instance.php

    r2292 r2311  
    423423 
    424424                /* load the required instance (for the required user) */ 
    425                 require_once GALAXIA_LIBRARY . SEP . 'src' . SEP . 'GUI' . SEP . 'GUI.php'; 
    426                 $GUI = new GUI($GLOBALS['workflow']['workflowObjects']->getDBGalaxia()->Link_ID); 
     425                $GUI = &Factory::newInstance('GUI'); 
    427426                $userInstance = $GUI->gui_list_user_instances($userID, 0, -1, '', '', "(ga.wf_is_interactive = 'y') AND (gia.wf_activity_id = {$activityID}) AND (gia.wf_instance_id = {$instanceID})", false, $this->processID, true, false, true, false, false, false); 
    428427                $userInstance = $userInstance['data']; 
  • sandbox/workflow/branches/609/inc/local/classes/class.wf_ldap.php

    r2249 r2311  
    11<?php 
    2 require_once PHPGW_SERVER_ROOT . SEP . 'workflow' . SEP . 'inc' . SEP . 'local' . SEP . 'classes' . SEP . 'class.wf_cached_ldap.php'; 
    32 
    43/** 
     
    4746                $this->ds = &$GLOBALS['workflow']['workflowObjects']->getLDAP(); 
    4847 
    49                 $this->cachedLDAP = new wf_cached_ldap(); 
     48                $this->cachedLDAP = &Factory::getInstance('wf_cached_ldap'); 
    5049                $this->cachedLDAP->setOperationMode($this->cachedLDAP->OPERATION_MODE_LDAP); 
    5150        } 
  • sandbox/workflow/branches/609/inc/nano/NanoController.class.php

    r795 r2311  
    5959    function __construct() 
    6060    { 
    61         $this->_mObjJsonConverter = new NanoJsonConverter(); 
    62         $this->_mObjJson          = new Services_JSON(); 
     61        $this->_mObjJsonConverter = &Factory::newInstance('NanoJsonConverter'); 
     62        $this->_mObjJson          = &Factory::newInstance('Services_JSON'); 
    6363    } 
    6464 
     
    130130    public function iterateOverVirtualRequests() 
    131131    { 
    132         $this->_mObjNanoRequest = new NanoRequest( $this->_mStrClassPath, $this->_mStrClassSuffix, $this->_mStrClassPreffix ); 
     132        $this->_mObjNanoRequest = &Factory::newInstance('NanoRequest', $this->_mStrClassPath, $this->_mStrClassSuffix, $this->_mStrClassPreffix ); 
    133133        $return_data            = array(); 
    134134 
  • sandbox/workflow/branches/609/inc/nano/NanoGuardian.class.php

    r795 r2311  
    3232    public function __construct() 
    3333    { 
    34         $this->_mObjNanoSanitizer = new NanoSanitizer(new DummyLogger); 
     34        $this->_mObjNanoSanitizer = &Factory::newInstance('NanoSanitizer', new DummyLogger); 
    3535    } 
    3636 
  • sandbox/workflow/branches/609/inc/nano/NanoJsonConverter.class.php

    r795 r2311  
    118118        // initialize JSON object 
    119119        $this->_mObjJson = ( strtolower($return_type) != 'object' ) 
    120                                 ? new Services_JSON( SERVICES_JSON_LOOSE_TYPE ) 
    121                                 : new Services_JSON(); 
     120                                ? Factory::getInstance('Services_JSON', SERVICES_JSON_LOOSE_TYPE ) 
     121                                : Factory::getInstance('Services_JSON'); 
    122122    } 
    123123 
  • sandbox/workflow/branches/609/index.php

    r2193 r2311  
    2222                        require_once dirname(__FILE__) . '/inc/nano/NanoJsonConverter.class.php'; 
    2323                        require_once dirname(__FILE__) . '/inc/nano/NanoController.class.php'; 
    24                         $nanoController = new NanoController(); 
     24                        $nanoController = &Factory::newInstance('NanoController'); 
    2525                        $nanoController->throwErrorOnAllVirtualRequests('__NANOAJAX_SESSION_EXPIRED__'); 
    2626                        exit; 
  • sandbox/workflow/branches/609/lib/factory/ProcessFactory.php

    r2249 r2311  
    5050                $this->registerFileInfo('wf_orgchart', 'class.wf_orgchart.php', 'inc/local/classes'); 
    5151                $this->registerFileInfo('wf_ldap', 'class.wf_ldap.php', 'inc/local/classes'); 
     52                $this->registerFileInfo('wf_cached_ldap', 'class.wf_cached_ldap.php', 'inc/local/classes'); 
    5253                $this->registerFileInfo('wf_engine', 'class.wf_engine.php', 'inc/local/classes'); 
    5354                $this->registerFileInfo('wf_role', 'class.wf_role.php', 'inc/local/classes'); 
  • sandbox/workflow/branches/609/lib/factory/WorkflowFactory.php

    r2291 r2311  
    5454                $this->registerFileInfo('WorkflowMacro', 'class.WorkflowMacro.inc.php', 'inc'); 
    5555                $this->registerFileInfo('WorkflowJobManager', 'class.WorkflowJobManager.inc.php', 'inc'); 
     56                $this->registerFileInfo('SecurityUtils', 'class.utils.security.php', 'inc'); 
    5657                $this->registerFileInfo('ResourcesRedirector', 'class.ResourcesRedirector.inc.php', 'inc'); 
    5758                $this->registerFileInfo('TemplateServer', 'class.TemplateServer.inc.php', 'inc'); 
     
    5960                $this->registerFileInfo('BrowserInfo', 'class.BrowserInfo.inc.php', 'inc'); 
    6061                $this->registerFileInfo('JobScheduler', 'class.JobScheduler.inc.php', 'inc'); 
     62                $this->registerFileInfo('JobRunner', 'class.JobRunner.inc.php', 'inc'); 
    6163                $this->registerFileInfo('Thread', 'class.Thread.inc.php', 'inc'); 
    6264                $this->registerFileInfo('Paging', 'class.Paging.inc.php', 'inc'); 
     65                $this->registerFileInfo('FsUtils', 'class.fsutils.inc.php', 'inc'); 
    6366                $this->registerFileInfo('UserPictureProvider', 'class.UserPictureProvider.inc.php', 'inc'); 
     67                $this->registerFileInfo('powergraphic', 'class.powergraphic.inc.php', 'inc'); 
    6468 
    6569                $this->registerFileInfo('run_activity', 'class.run_activity.inc.php', 'inc'); 
     
    8286 
    8387                $this->registerFileInfo('so_agent_mail_smtp', 'class.so_agent_mail_smtp.inc.php', 'inc'); 
     88                $this->registerFileInfo('so_external_applications', 'class.so_external_applications.inc.php', 'inc'); 
     89                $this->registerFileInfo('so_adminaccess', 'class.so_adminaccess.inc.php', 'inc'); 
     90                $this->registerFileInfo('so_orgchart', 'class.so_orgchart.inc.php', 'inc'); 
     91                $this->registerFileInfo('so_userinterface', 'class.so_userinterface.inc.php', 'inc'); 
     92                $this->registerFileInfo('so_adminjobs', 'class.so_adminjobs.inc.php', 'inc'); 
     93                $this->registerFileInfo('so_move_instances', 'class.so_move_instances.inc.php', 'inc'); 
     94 
     95                /* job classes */ 
     96                $this->registerFileInfo('AbsoluteDate', 'class.AbsoluteDate.inc.php', 'inc/jobs'); 
     97                $this->registerFileInfo('RelativeDate', 'class.RelativeDate.inc.php', 'inc/jobs'); 
     98                $this->registerFileInfo('WeekDate', 'class.WeekDate.inc.php', 'inc/jobs'); 
     99 
     100                /* galaxia engine classes */ 
     101                $this->registerFileInfo('GUI', 'GUI.php', 'inc/engine/src/GUI'); 
     102                $this->registerFileInfo('ProcessManager', 'ProcessManager.php', 'inc/engine/src/ProcessManager'); 
     103                $this->registerFileInfo('ActivityManager', 'ActivityManager.php', 'inc/engine/src/ProcessManager'); 
     104                $this->registerFileInfo('InstanceManager', 'InstanceManager.php', 'inc/engine/src/ProcessManager'); 
     105                $this->registerFileInfo('RoleManager', 'RoleManager.php', 'inc/engine/src/ProcessManager'); 
     106                $this->registerFileInfo('JobManager', 'JobManager.php', 'inc/engine/src/ProcessManager'); 
     107                $this->registerFileInfo('Process_GraphViz', 'GraphViz.php', 'inc/engine/src/ProcessManager'); 
     108                $this->registerFileInfo('ProcessMonitor', 'ProcessMonitor.php', 'inc/engine/src/ProcessMonitor'); 
     109                $this->registerFileInfo('Process', 'Process.php', 'inc/engine/src/API'); 
     110                $this->registerFileInfo('Instance', 'Instance.php', 'inc/engine/src/API'); 
     111                $this->registerFileInfo('Start', 'Start.php', 'inc/engine/src/API/activities'); 
     112                $this->registerFileInfo('End', 'End.php', 'inc/engine/src/API/activities'); 
     113                $this->registerFileInfo('Join', 'Join.php', 'inc/engine/src/API/activities'); 
     114                $this->registerFileInfo('Split', 'Split.php', 'inc/engine/src/API/activities'); 
     115                $this->registerFileInfo('Standalone', 'Standalone.php', 'inc/engine/src/API/activities'); 
     116                $this->registerFileInfo('View', 'View.php', 'inc/engine/src/API/activities'); 
     117                $this->registerFileInfo('SwitchActivity', 'SwitchActivity.php', 'inc/engine/src/API/activities'); 
     118                $this->registerFileInfo('Activity', 'Activity.php', 'inc/engine/src/API/activities'); 
     119                $this->registerFileInfo('BaseActivity', 'BaseActivity.php', 'inc/engine/src/API'); 
     120 
     121                $this->registerFileInfo('ajax_ldap', 'class.ajax_ldap.inc.php', 'inc/engine'); 
     122                $this->registerFileInfo('ajax_config', 'class.ajax_config.inc.php', 'inc/engine'); 
     123                $this->registerFileInfo('WfRuntime', 'WfRuntime.php', 'inc/engine/src/common'); 
     124                $this->registerFileInfo('WfSecurity', 'WfSecurity.php', 'inc/engine/src/common'); 
     125 
     126                /* nano classes */ 
     127                $this->registerFileInfo('Services_JSON', 'JSON.php', 'inc/nano'); 
     128                $this->registerFileInfo('NanoRequest', 'NanoRequest.class.php', 'inc/nano'); 
     129                $this->registerFileInfo('NanoController', 'NanoController.class.php', 'inc/nano'); 
     130                $this->registerFileInfo('NanoJsonConverter', 'NanoJsonConverter.class.php', 'inc/nano'); 
     131                $this->registerFileInfo('NanoSanitizer', 'NanoSanitizer.class.php', 'inc/nano'); 
    84132 
    85133                /* registering egw external classes */ 
Note: See TracChangeset for help on using the changeset viewer.