| 4 | 
  * $Id$ | 
  * $Id$ | 
| 5 | 
  * | 
  * | 
| 6 | 
  * $Log$ | 
  * $Log$ | 
| 7 | 
  | 
  * Revision 1.13  2003/04/18 15:30:24  joko | 
| 8 | 
  | 
  * NEW: parameter 'ecom_data_filter' - used for 'items' | 
| 9 | 
  | 
  *   (introduced to filter xml-payload at backend side via xpath queries) | 
| 10 | 
  | 
  * documented global state parameters | 
| 11 | 
  | 
  * some comments | 
| 12 | 
  | 
  * | 
| 13 | 
  | 
  * Revision 1.12  2003/04/18 13:40:54  jonen | 
| 14 | 
  | 
  * + added 'topic' to requested vars which will currently be merged with the 'ap' var | 
| 15 | 
  | 
  * | 
| 16 | 
  * Revision 1.11  2003/04/11 00:51:10  joko | 
  * Revision 1.11  2003/04/11 00:51:10  joko | 
| 17 | 
  * minor update: just testing stuff... | 
  * minor update: just testing stuff... | 
| 18 | 
  * | 
  * | 
| 105 | 
     $this->add_model( array( | 
     $this->add_model( array( | 
| 106 | 
       //args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), | 
       //args => array( 'classname', 'guid', 'action', 'data_locator_key', 'block' ), | 
| 107 | 
       request_args => array(  | 
       request_args => array(  | 
| 108 | 
  | 
         // ApplicationTopic | 
| 109 | 
  | 
         'topic', | 
| 110 | 
         // ApplicationPage | 
         // ApplicationPage | 
| 111 | 
         'ap', | 
         'ap', | 
| 112 | 
         // important/required parameters for valid ecom-components | 
         // important/required parameters for valid ecom-components | 
| 117 | 
         'ecom_data_meta',  | 
         'ecom_data_meta',  | 
| 118 | 
         'ecom_data_action_edit', 'ecom_data_action_cancel', 'ecom_data_action_delete',  | 
         'ecom_data_action_edit', 'ecom_data_action_cancel', 'ecom_data_action_delete',  | 
| 119 | 
         'ecom_data_form_checkbox', 'ecom_data_form_action', | 
         'ecom_data_form_checkbox', 'ecom_data_form_action', | 
| 120 | 
         'ecom_data_source_key' | 
         'ecom_data_source_key', | 
| 121 | 
  | 
         'ecom_data_filter', | 
| 122 | 
       ), | 
       ), | 
| 123 | 
       request_arg => array( | 
       request_arg => array( | 
| 124 | 
         'ap' => array( query_arg => 'ap' ), | 
          | 
| 125 | 
         'ecom_label' => array( query_arg => 'ecl' ), | 
         // a key identifying the current topic | 
| 126 | 
         'ecom_type' => array( query_arg => 'ect' ), | 
           'topic' => array( query_arg => 't' ), | 
| 127 | 
         'ecom_abstract_type' => array( query_arg => 'ecat' ), | 
  | 
| 128 | 
         'ecom_mode' => array( query_arg => 'ecmod' ), | 
         // a key identifying the current page | 
| 129 | 
         'ecom_data_locator_key' => array( query_arg => 'ecdlk' ), | 
           'ap' => array( query_arg => 'ap' ), | 
| 130 | 
         'ecom_data_ident' => array( query_arg => 'ecdid' ), | 
          | 
| 131 | 
         'ecom_data_meta' => array( query_arg => 'ecdm' ), | 
         // ecom, ecom, ecom | 
| 132 | 
         'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), | 
            | 
| 133 | 
         'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), | 
           // component specific arguments (important for the main dispatcher, etc.) | 
| 134 | 
         'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), | 
           // a label identifying a component | 
| 135 | 
         'ecom_data_form_action' => array( query_arg => 'ecdfa' ), | 
           'ecom_label' => array( query_arg => 'ecl' ), | 
| 136 | 
         'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), | 
           // data or schema | 
| 137 | 
         'ecom_data_source_key' => array( query_arg => 'ecds' ), | 
           'ecom_type' => array( query_arg => 'ect' ), | 
| 138 | 
  | 
           // item, list or tree | 
| 139 | 
  | 
           'ecom_abstract_type' => array( query_arg => 'ecat' ), | 
| 140 | 
  | 
  | 
| 141 | 
  | 
  | 
| 142 | 
  | 
         // data, data, data | 
| 143 | 
  | 
            | 
| 144 | 
  | 
           // e.g. view, edit | 
| 145 | 
  | 
           'ecom_mode' => array( query_arg => 'ecmod' ), | 
| 146 | 
  | 
           // This should be renamed to 'ecom_data_transport_key'. | 
| 147 | 
  | 
           'ecom_data_locator_key' => array( query_arg => 'ecdlk' ), | 
| 148 | 
  | 
            | 
| 149 | 
  | 
           // This should be enough to identify data Xyz. | 
| 150 | 
  | 
           // e.g. an OID, a GUID, a filename or similar stuff | 
| 151 | 
  | 
           'ecom_data_ident' => array( query_arg => 'ecdid' ), | 
| 152 | 
  | 
           // e.g. a classname or a filename | 
| 153 | 
  | 
           'ecom_data_meta' => array( query_arg => 'ecdm' ), | 
| 154 | 
  | 
           // filter the data: e.g.  | 
| 155 | 
  | 
           //    - an xpath-query (xpq),  | 
| 156 | 
  | 
           //    - an abstract/custom filter string or | 
| 157 | 
  | 
           //    - a parent node identifier (maybe revamp as 'ecdpnid')? | 
| 158 | 
  | 
           'ecom_data_filter' => array( query_arg => 'ecdf' ), | 
| 159 | 
  | 
            | 
| 160 | 
  | 
           // Some actions ... | 
| 161 | 
  | 
           // ... required for data items. | 
| 162 | 
  | 
           'ecom_data_action_edit' => array( query_arg => 'ecdfe' ), | 
| 163 | 
  | 
           'ecom_data_action_cancel' => array( query_arg => 'ecdfc' ), | 
| 164 | 
  | 
           'ecom_data_action_delete' => array( query_arg => 'ecdfd' ), | 
| 165 | 
  | 
           // ... required for data lists. | 
| 166 | 
  | 
           'ecom_data_form_action' => array( query_arg => 'ecdfa' ), | 
| 167 | 
  | 
           'ecom_data_form_checkbox' => array( query_arg => 'checkbox' ), | 
| 168 | 
  | 
            | 
| 169 | 
  | 
           // Special argument (should become a non-data-action). | 
| 170 | 
  | 
           // Triggers 'selectSource' at backend api (remote api) which causes a database handle switch. | 
| 171 | 
  | 
           'ecom_data_source_key' => array( query_arg => 'ecds' ), | 
| 172 | 
  | 
  | 
| 173 | 
       ), | 
       ), | 
| 174 | 
  | 
  | 
| 175 | 
 /* | 
 /* | 
| 176 | 
     // block model (what is used for each block) | 
     // block model (what is used for each block) | 
| 177 | 
  | 
     // is this deprecated??? | 
| 178 | 
       block => array( | 
       block => array( | 
| 179 | 
         'ident' => array( query_arg => 'ident' ), | 
         'ident' => array( query_arg => 'ident' ), | 
| 180 | 
         'meta' => array( query_arg => 'meta' ), | 
         'meta' => array( query_arg => 'meta' ), | 
| 187 | 
  | 
  | 
| 188 | 
     )); | 
     )); | 
| 189 | 
  | 
  | 
| 190 | 
  | 
      | 
| 191 | 
  | 
     // TODO: activate MVC-Views!!! | 
| 192 | 
  | 
     // - Here: Picture a ecom-component as a MVC-View. | 
| 193 | 
  | 
     // - Assign a GUID to each ecom-component! | 
| 194 | 
  | 
     // - Build WebExplorer-Introspection-Module to show stuff like this...    (->WebExplorer::Designer) | 
| 195 | 
  | 
      | 
| 196 | 
  | 
      | 
| 197 | 
     //$this->setup_views( &$this->_registry ); | 
     //$this->setup_views( &$this->_registry ); | 
| 198 | 
  | 
  | 
| 199 | 
     // associate behaviour with "View"-components | 
     // associate behaviour with "View"-components | 
| 243 | 
           $page_state = $requestTracker->getPointer(); | 
           $page_state = $requestTracker->getPointer(); | 
| 244 | 
           $pre_out = $page_state[options]; | 
           $pre_out = $page_state[options]; | 
| 245 | 
           //print Dumper($pre_out); | 
           //print Dumper($pre_out); | 
| 246 | 
  | 
            | 
| 247 | 
           // clean-up unwanted variables | 
           // clean-up unwanted variables | 
| 248 | 
           $label = $_in[ecom_label]; | 
           $label = $_in[ecom_label]; | 
| 249 | 
           switch ($_in[ecom_abstract_type]) { | 
           switch ($_in[ecom_abstract_type]) { | 
| 250 | 
             case "list": | 
             case "list": | 
| 251 | 
               if($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } | 
               if ($pre_out[options][ecoms][$label][ecom_data_meta]) { unset($pre_out[options][ecoms][$label][ecom_data_meta]); } | 
| 252 | 
  | 
               break; | 
| 253 | 
  | 
             // 2003-04-16: required for xmltree-to-item transition | 
| 254 | 
  | 
             // if we dont do this the "dotted" filter expression would persist across views | 
| 255 | 
  | 
             case "item": | 
| 256 | 
  | 
               if ($pre_out[options][ecoms][$label][ecom_data_filter]) { unset($pre_out[options][ecoms][$label][ecom_data_filter]); } | 
| 257 | 
               break; | 
               break; | 
| 258 | 
           } | 
           } | 
| 259 | 
           $_out = $pre_out; | 
           $_out = $pre_out; | 
| 264 | 
             // HACK!!! | 
             // HACK!!! | 
| 265 | 
             // FIXME: review and implement in a more clean way? | 
             // FIXME: review and implement in a more clean way? | 
| 266 | 
             //print "RESET!<br/>"; | 
             //print "RESET!<br/>"; | 
 | 
              | 
  | 
| 267 | 
             $_out[options][ecoms][phase_startup] = "RESET"; | 
             $_out[options][ecoms][phase_startup] = "RESET"; | 
| 268 | 
         '), | 
         '), | 
| 269 | 
  | 
  | 
| 270 | 
         // rewrite idents | 
         // rewrite idents | 
| 271 | 
         create_function('&$_in, &$_out', ' | 
         create_function('&$_in, &$_out', ' | 
| 272 | 
  | 
            // map Topic to Page if exists | 
| 273 | 
  | 
            if($_in[topic]) { | 
| 274 | 
  | 
             $_in[ap] = $_in[topic]; | 
| 275 | 
  | 
           } | 
| 276 | 
           $idents = array ( ap, ); | 
           $idents = array ( ap, ); | 
| 277 | 
           foreach($idents as $key) { | 
           foreach($idents as $key) { | 
| 278 | 
             $_out[options][idents][$key] = $_in[$key]; | 
             $_out[options][idents][$key] = $_in[$key]; | 
| 280 | 
         '), | 
         '), | 
| 281 | 
          | 
          | 
| 282 | 
         // check right $_GET[ap] | 
         // check right $_GET[ap] | 
| 283 | 
         create_function('&$_in, &$_out', 'return ($_in[ap] != "explorer") ? print "Wrong application value: $_in[ap], sure this is right here?<br>" : null;'), | 
         create_function('&$_in, &$_out', 'return ($_in[ap] != "explorer") ? print "Wrong application value [ap]: $_in[ap], sure this is right here?<br>" : null;'), | 
| 284 | 
  | 
  | 
| 285 | 
         // write components variables to out | 
         // write components variables to out | 
| 286 | 
         create_function('&$_in, &$_out', ' | 
         create_function('&$_in, &$_out', ' | 
| 287 | 
           $vars = array(  | 
           $vars = array(  | 
| 288 | 
             ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, ecom_data_ident, ecom_data_meta | 
             ecom_type, ecom_abstract_type, ecom_mode, ecom_data_locator_key, | 
| 289 | 
  | 
             ecom_data_ident, ecom_data_meta, ecom_data_filter | 
| 290 | 
           ); | 
           ); | 
| 291 | 
           //  ecom_call_method, ecom_call_args | 
           //  ecom_call_method, ecom_call_args | 
| 292 | 
           if($_in[ecom_label]) { | 
           if($_in[ecom_label]) { |