Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
OpenAPI: submit file deletion to staging
System
We have some old code that tries to delete a file from a workarea, and them submit the deletion to staging using OpenAPI as follows:
IWSimpleFile sFile = (IWSimpleFile)IWPathNamedObject.lookupByPath(fileService, path);
sFile.destroy(fileService);
IWFileBatch.SubmitFileRequestInfo submitFile = new IWFileBatch.SubmitFileRequestInfo();
submitFile.fileComment = "";
submitFile.fromFile = sFile;
Collection submitFileCollection = new ArrayList();
submitFileCollection.add(submitFile);
IWFileBatch.ResultOfChange submitResult = IWFileBatch.submit(fileService,fromArea,submitFileCollection,IWPathNamedObject.rkmSelf,null,false, true,false,null,null,null,true, true,IWPathNamedObject.oNone);
I'm getting the following error at run time:
- com.interwoven.api.service.IWServiceManagedObject$InvalidException: Invalid service managed object.
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at com.interwoven.api.filesys.IWFileBatchRemoterImpl_Stub.submit(Unknown Source)
at com.interwoven.api.filesys.IWFileBatch.submit(IWFileBatch.java:987)
Is this the correct way of submitting a deleted file?
Thanks in advance!
Find more posts tagged with
Comments
Dwayne
One of my co-workers just showed me a block of code that's very similar to this, and is throwing a similar error. I'll admit I'm no OpenAPI expert, but the one thing that strikes me as potentially suspicious about this is that you're trying to submit the deleted file as an
IWSimpleFile
object. According to the docs that I've read,
IWSimpleFile
is a subclass of
IWFile
which can only represent a normal file. It specifically cannot represent a "hole," which is Interwoven's terminology for a place where a file
used
to be.
This problem was placed on the back burner here, so I haven't spent any significant time trying to track down the problem, but I would consider trying to coerce your object into being an
IWHole
object, and see if
that
can be submitted.
I'd also appreciate hearing your results, good or bad, so that I can pass it on to my coworker.
--
Current project: TS 5.5.2/6.1 W2K
Migrateduser
Thanks. And I found a old posting in this forum about how to submit a IWHole. It worked for me.
Dwayne
Thanks for the tip on the old post. It's basically recommending the same thing I told my coworker to try. Glad to know I wasn't out in left field somewhere (for once)
--
Current project: TS 5.5.2/6.1 W2K