]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - service/v3_1/registry.php
Release 6.5.0
[Github/sugarcrm.git] / service / v3_1 / registry.php
1 <?php
2 if(!defined('sugarEntry'))define('sugarEntry', true);
3 /*********************************************************************************
4  * SugarCRM Community Edition is a customer relationship management program developed by
5  * SugarCRM, Inc. Copyright (C) 2004-2012 SugarCRM Inc.
6  * 
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU Affero General Public License version 3 as published by the
9  * Free Software Foundation with the addition of the following permission added
10  * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
11  * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
12  * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
13  * 
14  * This program is distributed in the hope that it will be useful, but WITHOUT
15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
17  * details.
18  * 
19  * You should have received a copy of the GNU Affero General Public License along with
20  * this program; if not, see http://www.gnu.org/licenses or write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22  * 02110-1301 USA.
23  * 
24  * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
25  * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
26  * 
27  * The interactive user interfaces in modified source and object code versions
28  * of this program must display Appropriate Legal Notices, as required under
29  * Section 5 of the GNU Affero General Public License version 3.
30  * 
31  * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
32  * these Appropriate Legal Notices must retain the display of the "Powered by
33  * SugarCRM" logo. If the display of the logo is not reasonably feasible for
34  * technical reasons, the Appropriate Legal Notices must display the words
35  * "Powered by SugarCRM".
36  ********************************************************************************/
37
38
39 require_once('service/v3/registry.php');
40
41 class registry_v3_1 extends registry_v3 {
42         
43         /**
44          * This method registers all the functions on the service class
45          *
46          */
47         protected function registerFunction() 
48         {
49                 $GLOBALS['log']->info('Begin: registry->registerFunction');
50                 parent::registerFunction();
51
52                 $this->serviceClass->registerFunction(
53                     'get_entry',
54                     array('session'=>'xsd:string', 'module_name'=>'xsd:string', 'id'=>'xsd:string', 'select_fields'=>'tns:select_fields','link_name_to_fields_array'=>'tns:link_names_to_fields_array','track_view'=>'xsd:boolean'),
55                     array('return'=>'tns:get_entry_result_version2'));
56                     
57                 $this->serviceClass->registerFunction(
58                     'get_entries',
59                     array('session'=>'xsd:string', 'module_name'=>'xsd:string', 'ids'=>'tns:select_fields', 'select_fields'=>'tns:select_fields', 'link_name_to_fields_array'=>'tns:link_names_to_fields_array','track_view'=>'xsd:boolean'),
60                     array('return'=>'tns:get_entry_result_version2'));
61
62            $this->serviceClass->registerFunction(
63                     'get_entry_list',
64                     array('session'=>'xsd:string', 'module_name'=>'xsd:string', 'query'=>'xsd:string', 'order_by'=>'xsd:string','offset'=>'xsd:int', 'select_fields'=>'tns:select_fields', 'link_name_to_fields_array'=>'tns:link_names_to_fields_array', 'max_results'=>'xsd:int', 'deleted'=>'xsd:int', 'favorites'=>'xsd:boolean'),
65                     array('return'=>'tns:get_entry_list_result_version2'));
66                     
67                 $this->serviceClass->registerFunction(
68                     'search_by_module',
69                 array('session'=>'xsd:string','search_string'=>'xsd:string', 'modules'=>'tns:select_fields', 'offset'=>'xsd:int', 'max_results'=>'xsd:int','unified_search_only'=>'xsd:boolean'),
70                 array('return'=>'tns:return_search_result'));
71                    
72            $this->serviceClass->registerFunction(
73                     'get_available_modules',
74                 array('session'=>'xsd:string','filter'=>'xsd:string'),
75                 array('return'=>'tns:module_list'));
76                 
77            $this->serviceClass->registerFunction(
78                     'get_module_fields_md5',
79                     array('session'=>'xsd:string', 'module_names'=>'tns:select_fields'),
80                     array('return'=>'tns:md5_results')); 
81         }
82         
83         /**
84          * This method registers all the complex types
85          *
86          */
87         protected function registerTypes() 
88         {
89             parent::registerTypes();
90             
91             $this->serviceClass->registerType(
92                          'md5_results',
93                          'complexType',
94             'array',
95             '',
96             'SOAP-ENC:Array',
97             array(),
98             array(
99                array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType'=>'xsd:string[]')
100             ),
101             'xsd:string'
102                 );
103                 
104                 
105             $this->serviceClass->registerType(
106                     'module_list',
107                         'complexType',
108                          'struct',
109                          'all',
110                           '',
111                                 array(
112                                         'modules'=>array('name'=>'modules', 'type'=>'tns:module_list_array'),
113                                 )
114                 );
115                 
116             $this->serviceClass->registerType(
117                     'module_list_array',
118                         'complexType',
119                          'array',
120                          '',
121                           'SOAP-ENC:Array',
122                         array(),
123                     array(
124                         array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType'=>'tns:module_list_entry[]')
125                     ),
126                         'tns:module_list_entry'
127                 );
128             
129             $this->serviceClass->registerType(
130                     'module_list_entry',
131                         'complexType',
132                          'struct',
133                          'all',
134                           '',
135                                 array(
136                                         'module_key'=>array('name'=>'module_key', 'type'=>'xsd:string'),
137                                         'module_label'=>array('name'=>'module_label', 'type'=>'xsd:string'),
138                                         'acls'=>array('name'=>'acls', 'type'=>'tns:acl_list'),
139                                 )
140                 );
141                 
142                 $this->serviceClass->registerType(
143                     'acl_list',
144                         'complexType',
145                          'array',
146                          '',
147                           'SOAP-ENC:Array',
148                         array(),
149                     array(
150                         array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType'=>'tns:acl_list_entry[]')
151                     ),
152                         'tns:acl_list_entry'
153                 );
154                 
155                 $this->serviceClass->registerType(
156                     'acl_list_entry',
157                         'complexType',
158                          'struct',
159                          'all',
160                           '',
161                                 array(
162                                         'action'=>array('name'=>'action', 'type'=>'xsd:string'),
163                                         'access'=>array('name'=>'access', 'type'=>'xsd:string'),
164                                 )
165                 );
166                 
167                 $this->serviceClass->registerType(
168                          'get_entry_list_result_version2',
169                          'complexType',
170                          'struct',
171                          'all',
172                           '',
173                         array(
174                                 'result_count' => array('name'=>'result_count', 'type'=>'xsd:int'),
175                                 'total_count' => array('name'=>'total_count', 'type'=>'xsd:int'),
176                                 'next_offset' => array('name'=>'next_offset', 'type'=>'xsd:int'),
177                                 'entry_list' => array('name' =>'entry_list', 'type'=>'tns:entry_list'),
178                                 'relationship_list' => array('name' =>'relationship_list', 'type'=>'tns:link_lists'),
179                         )
180                 );
181                 
182                 $this->serviceClass->registerType(
183                     'new_module_fields',
184                         'complexType',
185                          'struct',
186                          'all',
187                           '',
188                                 array(
189                                 'module_name'=>array('name'=>'module_name', 'type'=>'xsd:string'),
190                                 'module_name'=>array('name'=>'table_name', 'type'=>'xsd:string'),
191                                         'module_fields'=>array('name'=>'module_fields', 'type'=>'tns:field_list'),
192                                         'link_fields'=>array('name'=>'link_fields', 'type'=>'tns:link_field_list'),
193                                 )
194                 );
195                 
196                 //From v2_1, can't extend from this class because of versioning.
197                 $this->serviceClass->registerType(
198                         'link_list2',
199                         'complexType',
200                         'struct',
201                         'all',
202                         '',
203                         array(
204                         'link_list'=>array('name'=>'link_list', 'type'=>'tns:link_list'),
205                         )
206                 );
207                 $this->serviceClass->registerType(
208                     'link_lists',
209                         'complexType',
210                          'array',
211                          '',
212                           'SOAP-ENC:Array',
213                         array(),
214                     array(
215                         array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType'=>'tns:link_list2[]')
216                     ),
217                         'tns:link_list2'
218                 );
219                 
220                 $this->serviceClass->registerType(
221                     'link_array_list',
222                         'complexType',
223                          'array',
224                          '',
225                           'SOAP-ENC:Array',
226                         array(),
227                     array(
228                         array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType'=>'tns:link_value2[]')
229                     ),
230                         'tns:link_value2'
231                 );
232                 
233                 $this->serviceClass->registerType(
234                         'link_value2',
235                         'complexType',
236                         'struct',
237                         'all',
238                         '',
239                         array(
240                         'link_value'=>array('name'=>'link_value', 'type'=>'tns:link_value'),
241                         )
242                 );
243                 
244                 $this->serviceClass->registerType(
245                         'report_field_list',
246                         'complexType',
247                         'array',
248                         '',
249                         'SOAP-ENC:Array',
250                         array(),
251                         array(
252                         array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:field_list2[]')
253                         ),
254                         'tns:field_list2'
255                 );
256                 $this->serviceClass->registerType(
257                         'field_list2',
258                         'complexType',
259                         'struct',
260                         'all',
261                         '',
262                         array(
263                         "field_list"=>array('name'=>'field_list', 'type'=>'tns:field_list'),
264                         )
265                 );
266                 $this->serviceClass->registerType(
267                         'report_entry_list',
268                         'complexType',
269                         'array',
270                         '',
271                         'SOAP-ENC:Array',
272                         array(),
273                         array(
274                         array('ref'=>'SOAP-ENC:arrayType', 'wsdl:arrayType'=>'tns:entry_list2[]')
275                         ),
276                         'tns:entry_list2'
277                 );
278                 $this->serviceClass->registerType(
279                         'entry_list2',
280                         'complexType',
281                         'struct',
282                         'all',
283                         '',
284                         array(
285                         "entry_list"=>array('name'=>'entry_list', 'type'=>'tns:entry_list'),
286                         )
287                 );
288         }
289 }