Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Delete contents of personalWS using LAPI?
NATS_Support
I'm looking for some help with deleting the items in a user's personal workspace using LAPI. The code I've tried using is as follows: //impersonate user to be deleted connection.ImpersonateUser(loginName); //get personal workspace LLValue personalWS = (new LLValue()).setAssocNotSet(); docs.AccessPersonalWS(personalWS); //use workspace ID to delete the workspace object. int workspaceID = personalWS.toInteger("ID"); docs.DeleteObject(0, workspaceID);My thinking here was that deleting an object also deletes all child objects, so deleting the workspace object would delete the contents of the workspace. However, the code throws an error trying to execute personalWS.toInteger("ID");If anyone could help me out with this it'd be much appreciated!
Find more posts tagged with
Comments
Pierre_Nocera
Message from Pierre Nocera <
pnocera@opentext.com
> via eLink
eLink
Hi,
I would give the strong recommendation not to delete the personal workspace, but try to delete its contents by calling ListContents of the personal ws, and then delete objects one by one.
Note that the deletion may not succeed on reserved documents and on documents which have locked versions.
Cheers,
Pierre Nocera
Solutions Architect
Tel : +33 (0)1 47 96 55 45
Fax : +33 (0)1 47 96 54 01
Mob : +33 (0)6 63 39 05 45
De:
eLink Discussion: LAPI Discussion [mailto:lapi@elinkkc.opentext.com]
Date:
mer. 14/01/2009 10:25
À:
eLink Recipient
Objet :
Delete contents of personalWS using LAPI?
Delete contents of personalWS using LAPI?
Posted by
natsadmin
(Administrator, NATS) on 2009/01/14 04:24
I'm looking for some help with deleting the items in a user's personal workspace using LAPI. The code I've tried using is as follows:
//impersonate user to be deleted
connection.ImpersonateUser(loginName);
//get personal workspace
LLValue personalWS = (new LLValue()).setAssocNotSet();
docs.AccessPersonalWS(personalWS);
//use workspace ID to delete the workspace object.
int workspaceID = personalWS.toInteger("ID");
docs.DeleteObject(0, workspaceID);
My thinking here was that deleting an object also deletes all child objects, so deleting the workspace object would delete the contents of the workspace. However, the code throws an error trying to execute personalWS.toInteger("ID");
If anyone could help me out with this it'd be much appreciated!
[To reply to this thread, use your normal E-mail reply function.]
Discussion:
LAPI Discussion
Livelink Server:
knowledge-wlweb01
To Unsubscribe from this Discussion, send an e-mail to
unsubscribe.lapi@elinkkc.opentext.com
.
Carsten_Kulms
Message from Carsten Kulms via eLinkThe code works perfectly for me. (Tried with Admin user impersonating adifferent user, LES/LAPI 9.7.1)Which error do you observe? Which LES version do you use?The example code does not check if AccessPersonalWS succeeded ...However, as Pierre mentioned the deletion may fail because of severalreasons.Also deletion of a Personal Workspace is somewhat dangerous as this ispossible even when the user still exists.