code: public void lock(final CmsUUID structureId, final I_CmsSimpleCallback<Boolean> callback) {
  
          CmsRpcAction<String> lockAction = new CmsRpcAction<String>() {
  
              /**
              * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
              */
              @Override
              public void execute() {
  
                  start(200, false);
                  getService().lockTemp(structureId, this);
              }
  
              /**
              * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
              */
              @Override
              public void onResponse(String result) {
  
                  stop(false);
                  if (result != null) {
                      // unable to lock
                      String text = Messages.get().key(Messages.GUI_LOCK_NOTIFICATION_2, structureId, result);
                      CmsNotification.get().sendDeferred(CmsNotification.Type.WARNING, text);
                  }
                  callback.execute(result == null ? Boolean.TRUE : Boolean.FALSE);
              }
          };
          lockAction.execute();
      }
docs: Locks the given resource with a temporary lock.<p>
  
  @param structureId the resource structure id
  @param callback the callback to execute