New
method is used to create an empty landmark or landmark category item. You can use the new item as a template. It is available only in synchronous mode.
The following is an example for using New
:
new_output = landmark_handle.call('New', {'Type': u'Landmark'})
The following table summarizes the specification of New
:
Interface | IDataSource |
Operation | Creates an empty landmark or category item. |
Response Model | Synchronous |
Pre-condition | IDataSource interface is loaded. |
Post-condition | Nil |
Input Parameters
Input parameter specifies the content type to create.
|
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 create an empty landmark/category item:
import scriptext landmark_handle = scriptext.load('Service.Landmarks', 'IDataSource') try: new_output = landmark_handle.call('New', {'Type': u'Landmark'}) error = new_output['ErrorCode'] if error != 0: print "Error in creating the landmark item" else: print "The Landmark item is created" except scriptext.ScriptextError, err: print "Error performing the operation : ", err
See About this document... for information on suggesting changes.