/** * Waits until no publish jobs remain.<p> */ public void waitWhileRunning() { waitWhileRunning(Long.MAX_VALUE); }
/** * Waits until no publish jobs remain.<p> */ public void waitWhileRunning() { waitWhileRunning(Long.MAX_VALUE); }
/** * Publishes the current project and waits until it finishes.<p> * * @throws Exception if something goes wrong */ public void publishProjectAndWait() throws Exception { OpenCms.getPublishManager().publishProject(m_cms); OpenCms.getPublishManager().waitWhileRunning(); }
/** * Publishes the current project and waits until it finishes.<p> * * @throws Exception if something goes wrong */ public void publishProjectAndWait() throws Exception { OpenCms.getPublishManager().publishProject(m_cms); OpenCms.getPublishManager().waitWhileRunning(); }
/** * Publishes the resources of a specified publish list.<p> * * @param report an instance of <code>{@link I_CmsReport}</code> to print messages * @param publishList a publish list * * @return the publish history id of the published project * * @throws CmsException if something goes wrong * * @see #getPublishList() * @see #getPublishList(CmsResource, boolean) * @see #getPublishList(List, boolean) * * @deprecated use <code>{@link OpenCms#getPublishManager()}.{@link org.opencms.publish.CmsPublishManager#publishProject(CmsObject, I_CmsReport, CmsPublishList) publishProject(CmsObject, I_CmsReport, CmsPublishList)}</code> instead */ public CmsUUID publishProject(I_CmsReport report, CmsPublishList publishList) throws CmsException { CmsUUID publishHistoryId = OpenCms.getPublishManager().publishProject(this, report, publishList); OpenCms.getPublishManager().waitWhileRunning(); return publishHistoryId; }
/** * Publishes a single resource.<p> * * @param resourcename the name of the resource to be published * @param publishSiblings if <code>true</code>, all siblings of the resource are also published * @param report the report to write the progress information to * * @return the publish history id of the published project * * @throws Exception if something goes wrong * * @deprecated use <code>{@link OpenCms#getPublishManager()}.{@link org.opencms.publish.CmsPublishManager#publishResource(CmsObject, String, boolean, I_CmsReport) publishResource(CmsObject, String, boolean, I_CmsReport)}</code> instead */ public CmsUUID publishResource(String resourcename, boolean publishSiblings, I_CmsReport report) throws Exception { CmsResource resource = readResource(resourcename, CmsResourceFilter.ALL); CmsUUID publishHistoryId = OpenCms.getPublishManager().publishProject(this, report, resource, publishSiblings); OpenCms.getPublishManager().waitWhileRunning(); return publishHistoryId; }
/** * Publishes the current project, printing messages to a shell report.<p> * * @return the publish history id of the published project * * @throws Exception if something goes wrong * * @see CmsShellReport * * @deprecated use <code>{@link OpenCms#getPublishManager()}.{@link org.opencms.publish.CmsPublishManager#publishProject(CmsObject) publishProject(CmsObject)}</code> instead */ public CmsUUID publishProject() throws Exception { CmsUUID publishHistoryId = OpenCms.getPublishManager().publishProject( this, new CmsShellReport(m_context.getLocale())); OpenCms.getPublishManager().waitWhileRunning(); return publishHistoryId; }
/** * Publishes the current project.<p> * * @param report an instance of <code>{@link I_CmsReport}</code> to print messages * * @return the publish history id of the published project * * @throws CmsException if something goes wrong * * @deprecated use <code>{@link OpenCms#getPublishManager()}.{@link org.opencms.publish.CmsPublishManager#publishProject(CmsObject, I_CmsReport) publishProject(CmsObject, I_CmsReport)}</code> instead */ public CmsUUID publishProject(I_CmsReport report) throws CmsException { CmsUUID publishHistoryId = OpenCms.getPublishManager().publishProject( this, report, OpenCms.getPublishManager().getPublishList(this)); OpenCms.getPublishManager().waitWhileRunning(); return publishHistoryId; }
/** * Publishes a single resource, printing messages to a shell report.<p> * * The siblings of the resource will not be published.<p> * * @param resourcename the name of the resource to be published * * @return the publish history id of the published project * * @throws Exception if something goes wrong * * @see CmsShellReport * * @deprecated use <code>{@link OpenCms#getPublishManager()}.{@link org.opencms.publish.CmsPublishManager#publishResource(CmsObject, String) publishResource(CmsObject, String)}</code> instead */ public CmsUUID publishResource(String resourcename) throws Exception { CmsUUID publishHistoryId = OpenCms.getPublishManager().publishResource( this, resourcename, false, new CmsShellReport(m_context.getLocale())); OpenCms.getPublishManager().waitWhileRunning(); return publishHistoryId; }
/** * Direct publishes a specified resource.<p> * * @param report an instance of <code>{@link I_CmsReport}</code> to print messages * @param directPublishResource a <code>{@link CmsResource}</code> that gets directly published; * or <code>null</code> if an entire project gets published. * @param directPublishSiblings if a <code>{@link CmsResource}</code> that should get published directly is * provided as an argument, all eventual siblings of this resource * get publish too, if this flag is <code>true</code>. * * @return the publish history id of the published project * * @throws CmsException if something goes wrong * * @see #publishResource(String) * @see #publishResource(String, boolean, I_CmsReport) * * @deprecated use <code>{@link OpenCms#getPublishManager()}.{@link org.opencms.publish.CmsPublishManager#publishProject(CmsObject, I_CmsReport, CmsResource, boolean) publishProject(CmsObject, I_CmsReport, CmsResource, boolean)}</code> instead */ public CmsUUID publishProject(I_CmsReport report, CmsResource directPublishResource, boolean directPublishSiblings) throws CmsException { CmsUUID publishHistoryId = OpenCms.getPublishManager().publishProject( this, report, OpenCms.getPublishManager().getPublishList(this, directPublishResource, directPublishSiblings)); OpenCms.getPublishManager().waitWhileRunning(); return publishHistoryId; }
OpenCms.getPublishManager().waitWhileRunning(); finishMessage = Messages.get().getBundle().key(Messages.LOG_PUBLISH_FINISHED_1, project.getName()); } catch (CmsException e) {
OpenCms.getPublishManager().waitWhileRunning(); finishMessage = Messages.get().getBundle().key(Messages.LOG_PUBLISH_FINISHED_1, project.getName()); } catch (CmsException e) {
/** * Imports a module (zipfile) from the default module directory, * creating a temporary project for this.<p> * * @param moduleName the name of the module to replace * @param importFile the name of the import .zip file located in the update module directory * @param report the shell report to write the output * * @throws Exception if something goes wrong * * @see org.opencms.importexport.CmsImportExportManager#importData(org.opencms.file.CmsObject, I_CmsReport, org.opencms.importexport.CmsImportParameters) */ protected void updateModule(String moduleName, String importFile, I_CmsReport report) throws Exception { String fileName = getModuleFolder() + importFile; report.println( Messages.get().container(Messages.RPT_BEGIN_UPDATE_MODULE_1, moduleName), I_CmsReport.FORMAT_HEADLINE); removeModule(moduleName, report); OpenCms.getPublishManager().stopPublishing(); OpenCms.getPublishManager().startPublishing(); OpenCms.getPublishManager().waitWhileRunning(); OpenCms.getImportExportManager().importData(m_cms, report, new CmsImportParameters(fileName, "/", true)); report.println( Messages.get().container(Messages.RPT_END_UPDATE_MODULE_1, moduleName), I_CmsReport.FORMAT_HEADLINE); OpenCms.getPublishManager().stopPublishing(); OpenCms.getPublishManager().startPublishing(); OpenCms.getPublishManager().waitWhileRunning(); }
publishManager.publishProject(cms, report); publishManager.waitWhileRunning();
/** * @see org.opencms.workplace.CmsMultiDialog#performDialogOperation() */ @Override protected boolean performDialogOperation() throws CmsException { CmsPublishList publishList = getSettings().getPublishList(); if (publishList == null) { throw new CmsException( Messages.get().container(org.opencms.db.Messages.ERR_GET_PUBLISH_LIST_PROJECT_1, getProjectname())); } OpenCms.getPublishManager().publishProject( getCms(), new CmsHtmlReport(getLocale(), getCms().getRequestContext().getSiteRoot()), publishList); // wait 2 seconds, may be it finishes fast OpenCms.getPublishManager().waitWhileRunning(1500); return true; }
/** * @see org.opencms.workplace.CmsMultiDialog#performDialogOperation() */ @Override protected boolean performDialogOperation() throws CmsException { CmsPublishList publishList = getSettings().getPublishList(); if (publishList == null) { throw new CmsException(Messages.get().container( org.opencms.db.Messages.ERR_GET_PUBLISH_LIST_PROJECT_1, getProjectname())); } OpenCms.getPublishManager().publishProject( getCms(), new CmsHtmlReport(getLocale(), getCms().getRequestContext().getSiteRoot()), publishList); // wait 2 seconds, may be it finishes fast OpenCms.getPublishManager().waitWhileRunning(1500); return true; }
shared, false); OpenCms.getPublishManager().waitWhileRunning(); } catch (CmsException e) { LOG.error(e.getLocalizedMessage(), e);
/** * Imports a folder or a ZIP file to the root folder of the * current site, creating a temporary project for this.<p> * * @param importFile the absolute path of the import resource * @throws Exception if something goes wrong */ public void importResourcesWithTempProject(String importFile) throws Exception { CmsProject project = m_cms.createProject( "SystemUpdate", getMessages().key(Messages.GUI_SHELL_IMPORT_TEMP_PROJECT_NAME_0), OpenCms.getDefaultUsers().getGroupAdministrators(), OpenCms.getDefaultUsers().getGroupAdministrators(), CmsProject.PROJECT_TYPE_TEMPORARY); CmsUUID id = project.getUuid(); m_cms.getRequestContext().setCurrentProject(project); m_cms.copyResourceToProject("/"); CmsImportParameters params = new CmsImportParameters(importFile, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); m_cms.unlockProject(id); OpenCms.getPublishManager().publishProject(m_cms); OpenCms.getPublishManager().waitWhileRunning(); }
/** * Imports a folder or a ZIP file to the root folder of the * current site, creating a temporary project for this.<p> * * @param importFile the absolute path of the import resource * @throws Exception if something goes wrong */ public void importResourcesWithTempProject(String importFile) throws Exception { CmsProject project = m_cms.createProject( "SystemUpdate", getMessages().key(Messages.GUI_SHELL_IMPORT_TEMP_PROJECT_NAME_0), OpenCms.getDefaultUsers().getGroupAdministrators(), OpenCms.getDefaultUsers().getGroupAdministrators(), CmsProject.PROJECT_TYPE_TEMPORARY); CmsUUID id = project.getUuid(); m_cms.getRequestContext().setCurrentProject(project); m_cms.copyResourceToProject("/"); CmsImportParameters params = new CmsImportParameters(importFile, "/", true); OpenCms.getImportExportManager().importData( m_cms, new CmsShellReport(m_cms.getRequestContext().getLocale()), params); m_cms.unlockProject(id); OpenCms.getPublishManager().publishProject(m_cms); OpenCms.getPublishManager().waitWhileRunning(); }
OpenCms.getPublishManager().waitWhileRunning();