code: public static int getDialogAction(CmsObject cms) {
  
          String fileName = CmsResource.getName(cms.getRequestContext().getUri());
          if (fileName == null) {
              // file name could not be determined, return "see locked subresources" action
              return TYPE_LOCKS;
          } else if (fileName.equalsIgnoreCase("lock.jsp")) {
              // a "lock" action is requested
              return TYPE_LOCK;
          } else if (fileName.indexOf("change") != -1) {
              // a "steal lock" action is requested
              return TYPE_LOCKCHANGE;
          } else if (fileName.indexOf("unlock") != -1) {
              // an "unlock" action is requested
              return TYPE_UNLOCK;
          } else {
              // an "see locked subresources" action is requested
              return TYPE_LOCKS;
          }
      }
docs: Determines if the resource should be locked, unlocked or if the lock should be stolen.<p>
  
  @param cms the CmsObject
  @return the dialog action: lock, change lock (steal) or unlock