cancel
Showing results for 
Search instead for 
Did you mean: 

Show message if doc is checked out by another user

johnnyecm
Champ in-the-making
Champ in-the-making
Hi,

we are in an IBM CM environment and are using your OpenWorkdesk => we would like to open the images with the IBM Generic Viewer => is it possible to show a message/text/whatever if the document is already checked out by another user?

That would be really helpful for us.
Best regards
JohnnyECM
1 REPLY 1

chfi
Champ in-the-making
Champ in-the-making
Hi,

yes, this can be implemented in the "IBMCMThinViewer.jsp" that is located in your deployment in the folder "viewer/ibmcm" ==> you can add a check if the current document is already checked out by another user => if so, just render an alert box in the following way:


if (obj.getVersion().isCheckedOut(OwStatusContextDefinitions.STATUS_CONTEXT_CORRECT_STATUS) && !obj.getVersion().isMyCheckedOut(OwStatusContextDefinitions.STATUS_CONTEXT_CORRECT_STATUS))
{
   canEdit = false;
   String strUser = "";
   if (obj.getVersion().getCheckedOutUserID(OwStatusContextDefinitions.STATUS_CONTEXT_CORRECT_STATUS) != null)
       strUser = obj.getVersion().getCheckedOutUserID(OwStatusContextDefinitions.STATUS_CONTEXT_CORRECT_STATUS);
            
   out.write("<script type='text/javascript'>");
   out.write("alert('Checked out by the user " + strUser + " - you are not allowed to modify the annotations!');");
   out.write("</script>");
   contentName = OwString.localize(m_context.getLocale(), "ibmcm.IBMCMThinViewer.notCheckedOut", "Document is checked out by another user " + strUser);
}

Please contact me if you have any questions.

Bye
Christian