code: public void setCurrentRoot(CmsWorkplace wp, String key) {
  
          // use last used root if param empty
          if (CmsStringUtil.isEmpty(key) || key.trim().equals("null")) {
              key = getCurrentRoot(wp).getKey();
          }
          // set it
          CmsToolUserData userData = getUserData(wp);
          userData.setRootKey(key);
      }
docs: Sets the current user's root key.<p>
  
  @param wp the workplace context
  @param key the current user's root key to set