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)
version update via api - problems with property
timw86
I get the error message at the bottom, when I run the following code. I am trying to update the modified date of a version when I import it into WorkSiteMP. Currently, the modified date on the document is showing the current date/time of import. I would like it to reflect the original file modified date, just like the bulk loader tool allows. I need to import via code for other application reasons.
try {
Version ver2 = (Version) lib.getObjectById(verid);
ver2.setComment(file.getAbsolutePath());
ver2.setPropertyValue("BASE::MODIFIED_TIME", new Date(file.lastModified()));
ver2.update();
debug("Version properties updated");
}catch(WorkteamException e){e.printStackTrace(); }
Failed to execute message: CmsUpdateVersionBySID
Return code=435
Error msg=Message for code 435 not found.
Library=worksitemp
Server=SCDDMSSQL
Property Error List:
Property ID : Property Name : Error Code : Error String
-------------------------------------------------------------------
27005 : MODIFIED_TIME / BASE::MODIFIED_TIME : 430 : Message for code 430 not found.
com.imanage.cms.exceptions.verification.InvalidUpdateDeltaException: Verification Exception
at com.imanage.cms.t1.db.cmsdatabase.CMSCommon.verifyUpdateDelta(CMSCommon.java:232)
at com.imanage.cms.t1.db.cmsdatabase.CMSCommon.verifyUpdateDelta(CMSCommon.java:192)
at com.imanage.cms.t1.service.cmshelperbeans.CmsVersionHelperBean.updateVersion(CmsVersionHelperBean.java:784)
at com.imanage.cms.t1.service.cmsbeans.CmsUpdateVersionBySIDBean.execute(CmsUpdateVersionBySIDBean.java:69)
at com.imanage.cms.t1.service.CmsServiceBean.processMessage(CmsServiceBean.java:157)
at com.imanage.cms.t1.service.CmsMsgProcessor.processMessage(CmsMsgProcessor.java:165)
at com.imanage.cms.t1.service.CmsMsgProcessor.processMessage(CmsMsgProcessor.java:139)
at com.imanage.cms.t1.service.CmsServiceBeanContainer.processMessage(CmsServiceBeanContainer.java:40)
at com.imanage.cms.t1.net.rpc.RpcSession.processMessage(RpcSession.java:546)
at com.imanage.cms.t1.net.rpc.RpcSession$RpcSessionThread.run(RpcSession.java:460)
at com.imanage.cms.fc.base.ImThread.callRun(ImThread.java:808)
at com.imanage.cms.fc.base.ImThread.executeOneLoop(ImThread.java:931)
at com.imanage.cms.fc.thread.ThreadHWRunner.run(ThreadHWRunner.java:141)
at java.lang.Thread.run(Unknown Source)
at com.imanage.cms.fc.cmsifc.CMSClientInterfaceBase.executeMessage(CMSClientInterfaceBase.java:320)
at com.imanage.cms.fc.cmsifc.CMSClientInterfaceGenerated.updateVersionBySID(CMSClientInterfaceGenerated.java:2562)
at com.imanage.cms.t2.jom.impl.VersionImpl.updateOnServer(VersionImpl.java:741)
at com.imanage.cms.t2.jom.impl.VersionImpl.update(VersionImpl.java:1581)
at com.imanage.cms.api.workteam.impl.VersionImpl.updateProfile(VersionImpl.java:274)
at com.imanage.cms.api.workteam.impl.VersionImpl.update(VersionImpl.java:303)
Find more posts tagged with
Comments
dbguy
To set the modified time you have to use the "supervised" APIs from Catalog, CatalogFolder, Folder, Project and Workspace. In order to use these APIs you have to be logged on as the owner of the workspace/catalog where you are importing documents.
timw86
Thanks dbguy!
Although the supervisedCreateDocument is part of the container controls. What about the version's properties. A document is very similar to a container of versions. How do I go about setting the modified and or created times for individual versions, especially when using "Importing New Version" is applied. The "supervised" procedure works great for the initial version. I am not sure how to mimic this functionality on additional versions.
Thanks in advance. I am studying the apis, but I am not having much success.
Migrateduser
If you're just getting started with the API, you might want to check ou the DevNet webcast recording about the WOM API:
http://devnet.interwoven.com/site.fcgi/webcasts/docs/webcast-recordings.html#webcast04-09a
hth,
lissa
dbguy
Unfortunately, there are no APIs for individual versions. What you want to do is not supported in the current SDK. Sorry...