Import is used to import a set of Landmarks. It accepts a set of input parameters that define the Type and data for performing the operation. It is available only in synchronous mode.
The following is an example for using Import:
getlist_output = landmark_handle.call('GetList', {'Type': u'Landmark',
'Filter': {'LandmarkName': u'land1'}})
The following table summarizes the specification of Import:
| Interface | IDataSource |
| Description | Imports a set of Landmarks. |
| 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.
The iterator points to the first item in the list of imported objects. |
Input Parameters
Input parameter specifies the Type and Data of the particular landmark to import.
|
Output Parameters
Output parameters contain ReturnValue. It also ErrorCode, and ErrorMessage if the operation fails. ReturnValue is an iterator to an array of Landmarks.
|
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 import a set of landmarks:
import scriptext
landmark_handle = scriptext.load('Service.Landmarks', 'IDataSource')
try:
import_output = landmark_handle.call('Import', {'Type': u'Landmark',
'Data': {'SourceFile': u'c:\data\land_import.txt',
'MimeType':
u'application/vnd.nokia.landmarkcollection+xml'}})
error = import_output['ErrorCode']
if error != 0:
print "Error in importing landmark"
else:
print "Landmark imported"
except scriptext.ScriptextError, err:
print "Error performing the operation : ", err
See About this document... for information on suggesting changes.