Organise is used to associate or disassociate a list of landmarks in a database to a category. It accepts a set of parameters that defines the Type, data, and operation type for performing the operation. It is available only in synchronous mode.
The following is an example for using Organise:
org_output = landmark_handle.call('Organise', {'Type': u'Landmark',
'Data': {'id': unicode(cat_id),
'idList': [id_val1,id_val2]},
'Operation Type': 'Associate'})
The following table summarizes the specification of Organise:
| Interface | IDataSource |
| Description | Associates or disassociates a list of landmarks in a database to a category. |
| Response Model | Synchronous |
| Pre-condition | IDataSource interface is loaded. |
| Post-condition | The default or active database is opened for reading landmarks and categories. A default database is created, if it does not exist and is set as active. Landmarks is exported to the specified file. |
Input Parameters
Input parameter specifies the type, data, and type of operation for performing the operation.
|
Output Parameters
Output parameters contain ErrorCode, and ErrorMessage if the operation fails.
|
Errors
The following table lists the error codes and their values:
|
Error Messages
The following table lists the error messages and their description:
|
Example
The following sample code illustrates how to associate or disassociate list of landmarks in a database to a category:
import scriptext
landmark_handle = scriptext.load('Service.Landmarks', 'IDataSource')
try:
getlist_cat_output = landmark_handle.call('GetList', {'Type': u'Category'})
retval_cat = getlist_cat_output['ReturnValue']
cat_id = retval_cat['id']
getlist_land1_output = landmark_handle.call('GetList', {'Type': u'Landmark',
'Filter': {'LandmarkName': u'land1'}})
retval1 = getlist_land1_output['ReturnValue']
id_val1 = retval['id']
getlist_land2_output = landmark_handle.call('GetList', {'Type': u'Landmark',
'Filter': {'LandmarkName': u'land2'}})
retval2 = getlist_land2_output['ReturnValue']
id_val2 = retval['id']
org_output = landmark_handle.call('Organise', {'Type': u'Landmark',
'Data': {'id': unicode(cat_id),
'idList': [id_val1,id_val2]},
'Operation Type': 'Associate'})
error = org_output['ErrorCode']
if error != 0:
print "Error in organising contacts"
else:
print "Conatcs organised"
except scriptext.ScriptextError, err:
print "Error performing the operation : ", err
See About this document... for information on suggesting changes.