code: private CmsObject getClonedCmsObject(CmsObject cms) throws CmsException {
  
          CmsObject clonedCms = OpenCms.initCmsObject(cms);
          // only online images get caches
          clonedCms.getRequestContext().setCurrentProject(clonedCms.readProject(CmsProject.ONLINE_PROJECT_ID));
          // paths are always root path
          clonedCms.getRequestContext().setSiteRoot("");
  
          return clonedCms;
      }
docs: Clones a CmsObject.<p>
  
  @param cms the CmsObject to be cloned.
  @return a clones CmsObject
  @throws CmsException if something goes wrong