Function tip_DeleteAnnotations


Prototype: tip_DeleteAnnotations(Document);
Arguments:

Document: A Document object. (CDM_Document)
Type: The type of the Annotations to be deleted. (string)

C++ API Sections
Tcl API Sections
Description
Return Value
Notes
See Also
Index

Description:

This function accepts two arguments: a Document object and a UTF-8 string that defines the Annotations to be deleted. According to the value specified by the "Type" parameter, this function will delete Annotations or Annotation Attributes from the specified Document.

If the value of the "Type" parameter is an empty string, then ALL the Annotations that the specified Document currently has will be deleted from this Document object. The used Annotation Ids will be also reseted. This means that the first Annotation that will be added to this Document will take the value "0" as Annotation Id, if it does not already have an Id. If the deletion is done successfully, the total number of the deleted Annotations will be returned.

If Annotations having as type the value of the "Type" parameter exist, then all these Annotations will be deleted from the Document. If the deletion is done successfully, the total number of the deleted Annotations will be returned.

If all Annotations have been searched and no Annotation having as type the value of the "Type" parameter was found, the value of the "Type" parameter is examined whether it can be splitted in two words. If this is the case (the value of the "Type" parameter contains at least one space character), then the value is splitted in two parts on the first space character that is found. The first word will be used as an Annotation type and the rest of the value (second word) will be used as an Attribute name. All Annotations will be seached. If Annotations having as type the first word are found, they are examined whether they contain an Attribute named as the second word. If such an Attribute is found in an Annotation, it will be deleted from the Annotation. The total number of deleted Attributes will be returned as the return value of this function.

If this function fails to delete any Annotation or any Annotation Attribute, then the value "0" will be deleted. In case of an error, the value "-1" will be returned, and an error message describing the error will be left at the current Tcl interpreter.

Return Value:

This function will return the number of the deleted Annotations or Annotation Attributes. If nothing was deleted, this function will return "0". In case of an error, he value "-1" will be returned, and an error message describing the error will be left at the current Tcl interpreter.

Notes:

This function is equivelant to CDM_DeleteAnnotations (C++ API).

See Also:

tip_FindMaxUsedAnnotationId


Generated by: petasis@aias on Wed Aug 16 10:31:45 PM EEST 2006.