code: protected CmsObject getSearchCms(CmsGallerySearchBean searchObj) throws CmsException {
  
          CmsObject searchCms = getCmsObject();
          if (searchObj.isIncludeExpired()) {
              searchCms = OpenCms.initCmsObject(getCmsObject());
              searchCms.getRequestContext().setRequestTime(CmsResource.DATE_RELEASED_EXPIRED_IGNORE);
          }
          return searchCms;
      }
docs: Gets an initialized CmsObject to be used for the actual search for a given search bean.<p>
  
  @param searchObj the search object
  @return the initialized CmsObject
  
  @throws CmsException if something goes wrong