/** * @see java.lang.Object#toString() */ @Override public String toString() { switch (getMode()) { case 1: return "shared inherited"; case 2: return "shared exclusive"; case 3: return "inherited"; case 4: return "exclusive"; case 6: return "temporary exclusive"; case 7: return "publish"; case 8: return "system unlocked"; default: return "unlocked"; } } }
/** * @see java.lang.Object#toString() */ @Override public String toString() { switch (getMode()) { case 1: return "shared inherited"; case 2: return "shared exclusive"; case 3: return "inherited"; case 4: return "exclusive"; case 6: return "temporary exclusive"; case 7: return "publish"; case 8: return "system unlocked"; default: return "unlocked"; } } }
/** * Generates a client side lock info object representing the current lock state of the given resource.<p> * * @param resource the resource * * @return the client lock * * @throws CmsException if something goes wrong */ private CmsClientLock generateClientLock(CmsResource resource) throws CmsException { CmsObject cms = getCmsObject(); CmsLock lock = cms.getLock(resource); CmsClientLock clientLock = new CmsClientLock(); clientLock.setLockType(CmsClientLock.LockType.valueOf(lock.getType().getMode())); CmsUUID ownerId = lock.getUserId(); if (!lock.isUnlocked() && (ownerId != null)) { clientLock.setLockOwner(cms.readUser(ownerId).getDisplayName(cms, cms.getRequestContext().getLocale())); clientLock.setOwnedByUser(cms.getRequestContext().getCurrentUser().getId().equals(ownerId)); } return clientLock; }