Switch to the offline project
From OpenCms Wiki
... // setting current project to 'Offline' CmsRequestContext cmsContext = cmsObject.getRequestContext(); CmsProject offlineProject = cmsObject.readProject("Offline"); cmsContext.setCurrentProject(offlineProject); ...