docs: public void addBookmark(String user, String siteRoot, String sitePath, String project) throws Exception {
  
          CmsObject cms = OpenCms.initCmsObject(m_cms);
          if (project != null) {
              cms.getRequestContext().setCurrentProject(cms.readProject(project));
          }
          cms.getRequestContext().setSiteRoot(siteRoot);
          CmsFavoriteDAO favDao = new CmsFavoriteDAO(cms, user);
          List<CmsFavoriteEntry> entries = favDao.loadFavorites();
          CmsResource res = cms.readResource(sitePath);
          CmsFavoriteEntry entry = new CmsFavoriteEntry();
          CmsProject currProject = cms.getRequestContext().getCurrentProject();
          if (res.isFolder()) {
              entry.setType(Type.explorerFolder);
              entry.setStructureId(res.getStructureId());
              entry.setProjectId(currProject.getId());
              entry.setSiteRoot(siteRoot);
          } else {
              if (currProject.isOnlineProject()) {
                  throw new IllegalArgumentException("Can not set bookmark for page in Online project.");
              }
              entry.setType(Type.page);
              entry.setStructureId(res.getStructureId());
              entry.setProjectId(currProject.getId());
              entry.setSiteRoot(siteRoot);
          }
          entries.add(entry);
          favDao.saveFavorites(entries);
      }