GetDokument, DeleteDocument, Ino[...]

I have problems using some methods of TaminoX control in VB.

Especially, GetDocument and DeleteDocument. What are those methods for? Getting and deleting a document from tamino db? I

There are two ways to get documents from Tamino. One is by using the queries using X-Query which uses URLs of the type:
http://localhost/tamino/myDB/collection?_xql=doctype[….

which returns 0 or more documents. The second way is to directly access the document by ino:id or ino:docname. So if you know the ino:id of a document is 1 say, and you want to return just that one document without all the Tamino wrappers then you can use URL of the type:
http://localhost/tamino/myDB/collection/doctype/@1

for example. The method of the OCX that allows the second type of access is GetDocument. DeleteDocument deletes an absolute document (i.e. not using a query).

Below is a bit of code (JScript) that uses GetDocument.

code:
  
function demoGetDocument()
{
var tx = new ActiveXObject (“TAMINOX.TaminoX1”);
tx.initialize();
tx.csDatabaseURL=“http://localhost/tamino/myDB”;
var doc = tx.GetDocument(“myCollection/myDoctype/@1”) ;
}



:cool:

Hallo Stuart,

thank you, for your help. Your example works fine, even in VB. And now I find the JScript documentation too.

Peter

Hi,

can anybody explain me why the delete statements are different when I want to delete a document over the API or the Interactive tool?

My statement over the interactive tool look as follows:

/BKPElementMatrixList[@ino:id=“7”]

Document with Ino ID 7 will be deleted, works fine! Looks even logically to me.

Why do I have to provide the following statement, if I’m using the API:

/BKPElementMatrixList/@7

I’m totally puzzled and it cost me a couple of hours to find it out.

Any explanation?

Thanks

The answer is- you don’t have to use /BKPElementMatrixList/@7

Inthe Tamino Active API are three ways of deleting a document from the database
1.delete a document with the same doctype and ino:id as the supplied element
2.delete by Query (/BKPElementMatrixList)[@ino:id=“7”]
3.delete by URI /BKPElementMatrixList/@7

See below for the document

form 3) is present because is you do already have a URL
for a document it is a bit tricky to decompose and turn it into form 2) - expecially if you don’t know if the ino:id or the docname is used and whether the URI is absolute or relative, or even if it points to a different collection or database from the current collection.
Also - which is very convenient in some applications - 3) works even if the URL points to another Tamino or Web Server that understands HTTP DELETE

In the Active X interface it is as follows

InoDelete
LPDISPATCH InoDelete(LPDISPATCH lpDOMElement)

Deletes a DOM element from the Tamino database.
Parameter Type:
IXMLDOMElement
Return Type:
IXMLDOMDocument

--------------------------------------------------------------------------------

DeleteByQuery
LPDISPATCH DeleteByQuery(LPCTSTR lpszQuery, LPCTSTR lpszCollection, LPCTSTR lpszDocType)

Delete by query with collection and doctype names in the query string.
The Tamino object will attempt to delete all documents that are described by the query. If the collection is set be sure that the baseURL does not contain the collection name. Otherwise you receive an error. Note: From Tamino Version 2.1 onwards it’s necessary to add the collection to the baseURL.
Parameters:
lpszQuery - query expression to select records to delete
lpszQueryCollection - collection name
lpszQueryDocType - doctype name
Return Type:
IXMLDOMDocument


DeleteDocument
LPDISPATCH DeleteDocument(LPCTSTR lpszReURL)

Deletes the document specified by the lpszReURL parameter.
Parameter:
lpszReURL - NULL or the relative URL added to the database URL, if it does not begin with “http://”
Return Type:
IXMLDOMDocument