Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to realy delete a Document in Livelink via Oscript 2

Status
Not open for further replies.

nicolas46

Programmer
Mar 4, 2010
33
FR
Hi,
Everything is in the title; I’m trying to remove a document in Livelink via an Oscript program. I tried DAPI.DeleteNote() method , and also $LLIAPI.LLNODE.NodeDelete() but nothing seem to work like I want.
The file is removed but I still have the document:


(the link to access to the file is delete, but I still have something)
Any help please..?
 
Thanks,


DAPINODE dapiDocument = Undefined
/*****************************************/
/* Suppression via le nom du document */
/****************************************/
dapiDocument = DAPI.GetNode("MyDoc",.fdapiRoot,false)
if (!isError(dapiDocument) && isDefined(dapiDocument))
Integer test2 = DAPI.deleteNode(dapiDocument)
//Assoc assResultDelete = $LLIAPI.LLNODE.NodeDelete(dapiDocument)
echo(test2)
end



The echo (test2) result is : 0

Something very weird is : if i push 1 time F5 after executing this code, my document seems removed but if i push an other time F5 the document reappear...[sadeyes]

Thanks
 
I don't have a column "DELETED" in DTREE

Maybe it's because i have the "recyclebin" module (i have a table gdcrecycleBin but my document's id isn't in this table)...
 
set if you are using IE to not cache.It should say every visit to the page.9 times out of 10 it is a browser cache.

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008
 
agree with AppNair that its likely to be a browser cache issue, the DTREE flag - or absence of the data from DTREE would also indicate that.

Despite having Recycle Bin installed may not mean it works for this subtype, so check your config.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Thanks for taking the time to help me.

I deasabled the IE cache and the result is the same.

ggriffit : i didn't say that there is no data of my doc in the Dtree table, in fact MyDoc is in it ! I have a line for this document but i havn't a column "Deleted".

What i don't understand is why DAPI.deleteNode result is ok and i have this line in dtree...B-(

 
If the node is in dtree then dapi.deletenode is giving you correct results I would check the ownerid of that node if that shows to be the recycle bin then your node.delete just moved it there and that is the reason for success.
When recycle bin is installed the delete is a move to the recycle bin.the node can be dleted only within therecyclebin pending confirmation form other mods such as recman For this very case one is told that you should use the lliapi implementation.this will allow you to allow callbacks from other modules such as recman to fire.

BTW if the nodeversion is tied to a geneartion nothing can dlete it until the geneartion is dleted.

since 2003 I always use the lliapi implementation for this very reason of inconsistent results when dealing with dapi stuff(the only one that seems to really work is dapi.rename)





Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008
 
I'tried again with $LLIAPI.LLNODE.NodeDelete(dapiDocument).
When i "Debug" i saw that the program execute well this instruction : "$RECYCLEBIN.Recycle.RecycleObject( dapiCtx.fPrgCtx, node )"

so it seems that you are right. But i'm a beginner in LL programming, and i don't really understand when talk about the recman mods...Can you explain to me how can i call this mods ? i want to fire a confirmation event to delete my doc ...

Thanks
 
When a Node is deleted in Livelink, then it is removed from the database UNLESS :

1. You have the UnDelete Workspace or Recycle Bin modules installed.

AND

2. You have them configure the store the SubType in the bin rather than actually delete it.

In which case the Node is MOVED from its current container to a special system container, just like the Windows Recycle Bin. The rules for the Undelete and Recycle Bin and configured on the Admin pages, so it is worth checking there. As far as I recall, both the Undelete Workspace and Recycle Bin have a purge option after X days as well.

As far as Livelink is concerned the item is deleted, so the way to test would be as follows :

1. Start with a new Object (e.g DTREE Dataid 1234 ParentID 5678)
2. Delete the node
3. check the DTREE values now
4. If the Parent ID is the same as in 1, then the node has not been deleted, if it is different check what the new Parent is - it is probably either a Recycle Bin or the Undelete Workspace.
5. If there is a new Parent ID and the refresh still shows the node then you have a caching issue somewhere between the server and the client, could be a client browser / proxy / server cache etc.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Thanks for your help (both of you).

It is always the same...
i have create an object "NewDoc" (parentId is 106563, owner id -2000 (admin))
i have run this script :

dapiDocument = DAPI.GetNode("NewDoc",.fdapiRoot,false)
if (!isError(dapiDocument) && isDefined(dapiDocument))
Assoc assResultDelete = $LLIAPI.LLNODE.NodeDelete(dapiDocument)
echo( Str.valueToString(assResultDelete))
end

the result of the echo is : A<1,?,'apiError'=?,'errMsg'='','ok'=true>

after 2 refresh, the parent id is still 106563, and my doc is not delete.

if i perform a delete manually the doc is in the RecycleBin folder (parent id 113688, owner id : -20701(recyclebin))


My IE cache is deseabled, i also tried to perform the refresh in firefox, same result.
Odd...
 
nicolas,
just to be sure can you echo the ID of dapiDocument and confirm that it is the same document. Can you also try using GetNodeByID rather than GetNode ?

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top