code: public void initialize(CmsObject cms) throws CmsRoleViolationException {
  
          OpenCms.getRoleManager().checkRole(cms, CmsRole.WORKPLACE_MANAGER);
          try {
              // store the Admin cms to index Cms resources
              m_adminCms = OpenCms.initCmsObject(cms);
          } catch (CmsException e) {
              // this should never happen
              LOG.error(e.getLocalizedMessage(), e);
          }
          // make sure the site root is the root site
          m_adminCms.getRequestContext().setSiteRoot("/");
  
          // create the extraction result cache
          m_extractionResultCache = new CmsExtractionResultCache(
              OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebInf(getDirectory()),
              "/extractCache");
          initializeFieldConfigurations();
          initializeIndexes();
          initOfflineIndexes();
  
          // register this object as event listener
          OpenCms.addCmsEventListener(
              this,
              new int[] {
                  I_CmsEventListener.EVENT_CLEAR_CACHES,
                  I_CmsEventListener.EVENT_PUBLISH_PROJECT,
                  I_CmsEventListener.EVENT_REBUILD_SEARCHINDEXES});
      }
docs: Initializes the search manager.<p>
  
  @param cms the cms object
  
  @throws CmsRoleViolationException in case the given opencms object does not have <code>{@link CmsRole#WORKPLACE_MANAGER}</code> permissions