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)
unfreezing workspace with WOM API
peter_choe
i am trying to unfreeze a frozen workspace using the api. i am programmatically able to freeze the workspace logged in as an administrator of the workspace, but when i try to unfreeze it, using the same log in credentials (not the same session), i get a com.imanage.cms.exceptions.privilege.PrivilegeException: Privilege Exception.
why can i freeze a workspace using an administrator account but i can't unfreeze it with the same account?
Find more posts tagged with
Comments
dbguy
It should work. Can you post the exception stack trace and a code snippet?
peter_choe
Here is the stack trace:
Failed to execute message: CmsSetWorkspaceArchiveStatus
Return code=99999
Error msg=Message for code 99999 not found.
Library=ARCHIVE
Server=WSMPDEV
com.imanage.cms.exceptions.privilege.PrivilegeException: Privilege Exception
at com.imanage.cms.t1.service.CmsServiceBean.checkPrivilege(CmsServiceBean.java:2245)
at com.imanage.cms.t1.service.cmsbeans.CmsSetWorkspaceArchiveStatusBean.execute(CmsSetWorkspaceArchiveStatusBean.java:29)
at com.imanage.cms.t1.service.CmsServiceBean.processMessage(CmsServiceBean.java:166)
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.setWorkspaceArchiveStatus(CMSClientInterfaceGenerated.java:9145)
at com.imanage.cms.t2.jom.impl.WorkspaceImpl.setArchiveStatus(WorkspaceImpl.java:2277)
at com.imanage.cms.api.workteam.impl.WorkspaceImpl.unfreeze(WorkspaceImpl.java:164)
at com.microstrat.worksitemp.UserLoginTest.main(UserLoginTest.java:26)
Code I have been testing:
import java.util.*;
import com.imanage.cms.api.workteam.*;
public class UserLoginTest {
public static void main(String[] args) throws Exception {
SessionManager manager = SessionManager.getInstance();
SimpleSession session = manager.createSimpleSession("myapp", "wsmpdev");
session.logon("", "pchoe", "pchoe");
session.ping();
SearchArgument sArg = new SearchArgument();
User u = session.getLoggedOnUser();
Collection names = session.getAllLibraryNames();
Iterator iNames = names.iterator();
String libName = new String();
while(iNames.hasNext()){
libName = (String)iNames.next();
System.out.println("library: " + libName);
}
Library library = session.getLibraryByName(libName);
Object obj = library.getObjectById("!V3!ARCHIVE!C!F$200!W$617!");
Workspace w = (Workspace)obj;
if(!w.isFrozen()) w.freeze();
System.out.println("obj type: " + obj);
System.out.println("frozen: " + w.isFrozen());
if(w.isFrozen()) w.unfreeze();
session.logoff();
}
}
dbguy
I got it wrong... Just checked the code: the actual rule is workspace owner, workspace administrators or the admin user can freeze workspaces. Only the admin user can unfreeze them.
Sorry for the confusion. I guess the coffee had not kicked in yet.
As for the reason it is like this, unfreeze should be a rare occurrence, to be used if someone freezes a workspace by mistake. The idea is that once frozen, no one should unfreeze it (for compliance reasons). This is a very narrow use case, but this is what we thought people wanted when we added the feature.
peter_choe
by the admin user, do you mean the person that logs into the worksite mp server and is able to use the library manager, et al.? so, is there a way to get the admin user id programatically? when i look through the library manager, i don't see an admin user.
dbguy
Yes, that admin. In Library Manager, it is under libname->Trustees->System Users. If you never changed its password, it is admin.
You can logon using a LibrarySession.
SessionManager.createLibrarySession(...)
LibrarySession.logon(...)
before.jpg
after.jpg
peter_choe
thanks. the information helps me quite a bit.