code: private CmsObject getOnlineCmsObject(CmsObject cms) {
  
          CmsObject res = null;
          try {
              res = OpenCms.initCmsObject(cms);
              res.getRequestContext().setCurrentProject(cms.readProject(CmsProject.ONLINE_PROJECT_ID));
          } catch (CmsException e) {
              LOG.error("Cannot create CmsObject", e);
          }
          return res;
      }
docs: Creates online version of given CmsObject.<p>
  
  @param cms given CmsObject
  @return online CmsObject