/** * Adds a publish listener to listen on publish events.<p> * * @param listener the publish listener to add */ public void addPublishListener(I_CmsPublishEventListener listener) { m_publishEngine.addPublishListener(listener); }
/** * Disables the publishing of resources.<p> */ public void disablePublishing() { m_publishEngine.disableEngine(); }
/** * Enables the enqeueing of resources for publishing.<p> */ public void enablePublishing() { m_publishEngine.enableEngine(); }
CmsDriverManager driverManager = m_publishEngine.getDriverManager(); if (revive) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); List publishJobs; try { dbc = m_publishEngine.getDbContextFactory().getDbContext(); if (!job.isStarted()) { m_publishEngine.lockPublishList(job); OpenCms.getMemoryMonitor().cachePublishJob(job); } catch (CmsException exc) { job.getPublishHistoryId()), exc); m_publishEngine.getDriverManager().deletePublishJob(dbc, job.getPublishHistoryId()); } finally { dbc.clear(); m_publishEngine.unlockPublishList(job); new CmsPublishJobEnqueued(job).m_publishJob.finish(); m_publishEngine.getPublishHistory().add(job); } catch (CmsException exc) { LOG.error(exc.getLocalizedMessage(), exc);
CmsDriverManager driverManager = m_publishEngine.getDriverManager(); if (revive) { CmsDbContext dbc = m_publishEngine.getDbContext(null); List<CmsPublishJobInfoBean> publishJobs = null; try { for (Iterator<CmsPublishJobInfoBean> i = publishJobs.iterator(); i.hasNext();) { CmsPublishJobInfoBean job = i.next(); dbc = m_publishEngine.getDbContext(null); if (!job.isStarted()) { m_publishEngine.lockPublishList(job); OpenCms.getMemoryMonitor().cachePublishJob(job); } catch (CmsException exc) { exc); m_publishEngine.getDriverManager().deletePublishJob(dbc, job.getPublishHistoryId()); } finally { dbc.clear(); m_publishEngine.unlockPublishList(job); new CmsPublishJobEnqueued(job).m_publishJob.finish(); m_publishEngine.getPublishHistory().add(job); } catch (CmsException exc) { dbc.rollback();
m_publishEngine.publishJobStarted(m_publishJob); m_started = true; if (isAborted()) { CmsDbContext dbc = m_publishEngine.getDbContext(getCms().getRequestContext()); try { m_publishEngine.getDriverManager().publishJob(getCms(), dbc, m_publishJob.getPublishList(), m_report); } catch (Throwable e) { m_publishEngine.publishJobFinished(getPublishJob()); } catch (Throwable e) { LOG.error(e.getMessage(), e);
unlockPublishList(publishJob.m_publishJob); getPublishHistory().add(publishJob.m_publishJob); } else { getPublishQueue().remove(publishJob.m_publishJob);
m_publishEngine.publishJobStarted(m_publishJob); m_started = true; if (isAborted()) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(getCms().getRequestContext()); try { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(getCms().getRequestContext()); try { m_publishEngine.getDriverManager().publishJob(getCms(), dbc, m_publishJob.getPublishList(), m_report); m_publishEngine.publishJobFinished(getPublishJob()); } catch (CmsException exc) { LOG.error(exc.getLocalizedMessage(), exc);
/** * Removes the given job from the list.<p> * * @param publishJob the publish job to remove * * @throws CmsException if something goes wrong */ protected void remove(CmsPublishJobInfoBean publishJob) throws CmsException { try { // signalizes that job will be removed m_publishEngine.publishJobRemoved(publishJob); } finally { // remove publish job from cache OpenCms.getMemoryMonitor().uncachePublishJob(publishJob); } // remove job from database if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); try { m_publishEngine.getDriverManager().deletePublishJob(dbc, publishJob.getPublishHistoryId()); } finally { dbc.clear(); } } }
/** * Removes the given job from the list.<p> * * @param publishJob the publish job to remove * * @throws CmsException if something goes wrong */ protected void remove(CmsPublishJobInfoBean publishJob) throws CmsException { try { // signalizes that job will be removed m_publishEngine.publishJobRemoved(publishJob); } finally { // remove publish job from cache OpenCms.getMemoryMonitor().uncachePublishJob(publishJob); } // remove job from database if necessary if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContext(null); try { m_publishEngine.getDriverManager().deletePublishJob(dbc, publishJob.getPublishHistoryId()); } catch (CmsException e) { dbc.rollback(); LOG.error(e.getLocalizedMessage(), e); throw e; } finally { dbc.clear(); } } }
/** * Updates the given job in the list.<p> * * @param publishJob the publish job to */ protected void update(CmsPublishJobInfoBean publishJob) { if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(); try { m_publishEngine.getDriverManager().writePublishJob(dbc, publishJob); } catch (CmsException e) { if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } finally { dbc.clear(); } } } }
/** * Updates the given job in the list.<p> * * @param publishJob the publish job to */ protected void update(CmsPublishJobInfoBean publishJob) { if (OpenCms.getMemoryMonitor().requiresPersistency()) { CmsDbContext dbc = m_publishEngine.getDbContext(null); try { m_publishEngine.getDriverManager().writePublishJob(dbc, publishJob); } catch (CmsException e) { dbc.rollback(); if (LOG.isErrorEnabled()) { LOG.error(e.getLocalizedMessage(), e); } } finally { dbc.clear(); } } } }
Iterator<CmsPublishJobEnqueued> itEnqueuedJobs = getPublishQueue().asList().iterator(); while (itEnqueuedJobs.hasNext()) { CmsPublishJobEnqueued enqueuedJob = itEnqueuedJobs.next(); Iterator<CmsPublishJobFinished> itFinishedJobs = getPublishHistory().asList().iterator(); while (itFinishedJobs.hasNext()) { CmsPublishJobFinished finishedJob = itFinishedJobs.next();
CmsPublishJobInfoBean publishJob = m_currentPublishThread.getPublishJob(); try { abortPublishJob(m_adminUserId, new CmsPublishJobEnqueued(publishJob), false); } catch (CmsException e) { if (LOG.isErrorEnabled()) { CmsDbContext dbc = getDbContext(null); try { m_driverManager.updateLog(dbc);
/** * Returns the publish history list with already publish jobs.<p> * * @return a list of {@link CmsPublishJobFinished} objects */ public List<CmsPublishJobFinished> getPublishHistory() { return m_publishEngine.getPublishHistory().asList(); }
CmsPublishJobInfoBean publishJob = m_currentPublishThread.getPublishJob(); try { abortPublishJob(m_adminUserId, new CmsPublishJobEnqueued(publishJob), false); } catch (CmsException e) { if (LOG.isErrorEnabled()) {
/** * Returns a publish job based on its publish history id.<p> * * The returned publish job may be an enqueued, running or finished publish job.<p> * * @param publishHistoryId the publish history id to search for * * @return the publish job with the given publish history id, or <code>null</code> */ public CmsPublishJobBase getJobByPublishHistoryId(CmsUUID publishHistoryId) { return m_publishEngine.getJobByPublishHistoryId(publishHistoryId); }
/** * Returns the current running publish job.<p> * * @return the current running publish job */ public CmsPublishJobRunning getCurrentPublishJob() { if (m_publishEngine.getCurrentPublishJob() == null) { return null; } return new CmsPublishJobRunning(m_publishEngine.getCurrentPublishJob().getPublishJob()); }
m_publishEngine.enqueuePublishJob(cms, publishList, report); } catch (CmsException exc) { enqueueException = exc;
m_publishEngine = new CmsPublishEngine(systemConfiguration.getRuntimeInfoFactory());