07-28-2014 04:04 PM
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status)
{
try
{
// —- get node ref —-
String reference = "workspace/SpacesStore/company_home/" + model.get("nodePath");
nodeRef = repository.findNodeRef("path", reference.split("/"));
if (nodeRef == null)
{
logger.info(ERR_MSG_NODEREF_PATH);
throw new WebScriptException(ERR_CODE_NODEREF_PATH, ERR_MSG_NODEREF_PATH);
}
logger.info("Done: " + nodeRef);
AuthenticationUtil.RunAsWork<Object> work = new AuthenticationUtil.RunAsWork<Object>()
{
public Object doWork() throws Exception
{
LockStatus lockStatus = lockService.getLockStatus(nodeRef, AuthenticationUtil.getRunAsUser());
if (LockStatus.LOCKED.equals(lockStatus))
logger.debug("— node already locked");
else
{
logger.debug("— locking node…");
LockType lockType = null;
lockService.lock(nodeRef, lockType.READ_ONLY_LOCK);
logger.debug("— done.");
}
return(lockStatus);
}
};
}
catch(WebScriptException e)
{
logger.debug("Error message:" + e.getMessage());
throw new WebScriptException(HttpServletResponse.SC_NOT_FOUND,
e.getMessage());
}
return model;
}
07-29-2014 04:23 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.