code: public String getLockedByName() {
  
          String lockedBy = "";
          if (!getLock().isNullLock()) {
              // user
              lockedBy = getLock().getUserId().toString();
              try {
                  lockedBy = getCurrentOuRelativeName(
                      CmsPrincipal.readPrincipalIncludingHistory(getCms(), getLock().getUserId()).getName());
              } catch (Throwable e) {
                  lockedBy = e.getMessage();
              }
          }
          return lockedBy;
      }
docs: Returns the user name who owns the lock for the given resource.<p>
  
  @return the user name who owns the lock for the given resource