/** * @see I_CmsReport#print(CmsMessageContainer) */ @Override public void print(final CmsMessageContainer container) { for (I_CmsReport report : m_delegates) { report.print(container); } }
while (i.hasNext()) { String resName = (String)i.next(); m_report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2,
/** * Determine if this file is to be excluded.<p> * * @param file the file to check * * @return <code>true</code> if the file should be excluded from synchronization */ private boolean isExcluded(File file) { ArrayList<Pattern> excludes = OpenCms.getWorkplaceManager().getSynchronizeExcludePatterns(); for (Pattern pattern : excludes) { if (pattern.matcher(file.getName()).find()) { m_report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_1, String.valueOf(m_count++)), I_CmsReport.FORMAT_NOTE); m_report.print(Messages.get().container(Messages.RPT_EXCLUDING_0), I_CmsReport.FORMAT_NOTE); m_report.println( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, file.getAbsolutePath().replace("\\", "/"))); return true; } } return false; }
/** * @see I_CmsReport#print(CmsMessageContainer, int) */ @Override public void print(final CmsMessageContainer container, final int format) { for (I_CmsReport report : m_delegates) { report.print(container, format); } }
/** * Updates the synchronization lists if a resource is not used during the * synchronization process.<p> * * @param res the resource whose entry must be updated */ private void skipResource(CmsResource res) { // add the file to the new sync list... String resname = m_cms.getSitePath(res); CmsSynchronizeList syncList = m_syncList.get(translate(resname)); m_newSyncList.put(translate(resname), syncList); // .. and remove it from the old one m_syncList.remove(translate(resname)); // update the report m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_1, String.valueOf(m_count++)), I_CmsReport.FORMAT_NOTE); m_report.print(Messages.get().container(Messages.RPT_SKIPPING_0), I_CmsReport.FORMAT_NOTE); m_report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_ARGUMENT_1, resname)); }
/** * @see org.opencms.report.A_CmsReport#print(org.opencms.i18n.CmsMessageContainer) */ @Override public void print(CmsMessageContainer container) { if (!m_busy && (m_report != null)) { m_report.print(container); } m_busy = true; super.print(container); m_busy = false; }
/** * Updates the synchronization lists if a resource is not used during the * synchronization process.<p> * * @param res the resource whose entry must be updated */ private void skipResource(CmsResource res) { // add the file to the new sync list... String resname = m_cms.getSitePath(res); CmsSynchronizeList syncList = (CmsSynchronizeList)m_syncList.get(translate(resname)); m_newSyncList.put(translate(resname), syncList); // .. and remove it from the old one m_syncList.remove(translate(resname)); // update the report m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_1, String.valueOf(m_count++)), I_CmsReport.FORMAT_NOTE); m_report.print(Messages.get().container(Messages.RPT_SKIPPING_0), I_CmsReport.FORMAT_NOTE); m_report.println(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, resname)); }
/** * @see org.opencms.report.A_CmsReport#print(org.opencms.i18n.CmsMessageContainer, int) */ @Override public void print(CmsMessageContainer container, int format) { if (!m_busy && (m_report != null)) { m_report.print(container, format); } m_busy = true; super.print(container, format); m_busy = false; }
m_report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_1, I_CmsReport.FORMAT_NOTE); if (res.isFile()) { m_report.print(Messages.get().container(Messages.RPT_DEL_FILE_0), I_CmsReport.FORMAT_NOTE); } else { m_report.print(Messages.get().container(Messages.RPT_DEL_FOLDER_0), I_CmsReport.FORMAT_NOTE); m_report.print( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_ARGUMENT_1, resourcename)); m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
/** * @see org.opencms.report.A_CmsReport#print(org.opencms.i18n.CmsMessageContainer, int) */ @Override public void print(CmsMessageContainer container, int format) { if (!m_busy && (m_report != null)) { m_report.print(container, format); } m_busy = true; super.print(container, format); m_busy = false; }
/** * Deletes a resource in the VFS and updates the synchronisation lists.<p> * * @param res The resource to be deleted * * @throws CmsException if something goes wrong */ private void deleteFromVfs(CmsResource res) throws CmsException { String resourcename = m_cms.getSitePath(res); m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_1, String.valueOf(m_count++)), I_CmsReport.FORMAT_NOTE); if (res.isFile()) { m_report.print(Messages.get().container(Messages.RPT_DEL_FILE_0), I_CmsReport.FORMAT_NOTE); } else { m_report.print(Messages.get().container(Messages.RPT_DEL_FOLDER_0), I_CmsReport.FORMAT_NOTE); } m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, resourcename)); m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); // lock the file in the VFS, so that it can be updated m_cms.lockResource(resourcename); m_cms.deleteResource(resourcename, CmsResource.DELETE_PRESERVE_SIBLINGS); // Remove it from the sync list m_syncList.remove(translate(resourcename)); m_report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK); }
/** * @see org.opencms.report.A_CmsReport#print(org.opencms.i18n.CmsMessageContainer) */ @Override public void print(CmsMessageContainer container) { if (!m_busy && (m_report != null)) { m_report.print(container); } m_busy = true; super.print(container); m_busy = false; }
getReport().print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_STAT_0)); getReport().println( org.opencms.report.Messages.get().container(
/** * Reads the content as byte array of the given resource and prints a message to the report.<p> * * @param report the report * @param counter the counter * @param resCount the total resource count * @param resource the file to get the content for */ private void report(I_CmsReport report, int counter, int resCount, CmsResource resource) { // report entries report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(counter), String.valueOf(resCount)), I_CmsReport.FORMAT_NOTE); report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, report.removeSiteRoot(resource.getRootPath()))); report.print( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0), I_CmsReport.FORMAT_DEFAULT); }
/** * @see java.lang.Runnable#run() */ @Override public void run() { I_CmsReport report = getReport(); report.println( Messages.get().container(Messages.RPT_UPDATEXML_BEGIN_UPDATE_THREAD_0), I_CmsReport.FORMAT_HEADLINE); try { // update xml contents updateXmlContents(report, m_settings.getVfsFolder(), m_settings.getIncludeSubFolders(), m_cmsObject); } catch (Throwable f) { m_errorUpdate += 1; report.println(Messages.get().container(Messages.RPT_UPDATETXML_UPDATE_ERROR_0)); if (LOG.isErrorEnabled()) { LOG.error(f.toString()); } } // append runtime statistics to report getReport().print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_STAT_0)); getReport().println( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_STAT_DURATION_1, getReport().formatRuntime())); getReport().println( Messages.get().container(Messages.RPT_UPDATEXML_END_UPDATE_THREAD_0), I_CmsReport.FORMAT_HEADLINE); }
/** * Reads the content as byte array of the given resource and prints a message to the report.<p> * * @param report the report * @param counter the counter * @param resCount the total resource count * @param resource the file to get the content for */ private void report(I_CmsReport report, int counter, int resCount, CmsResource resource) { // report entries report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(counter), String.valueOf(resCount)), I_CmsReport.FORMAT_NOTE); report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, report.removeSiteRoot(resource.getRootPath()))); report.print( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0), I_CmsReport.FORMAT_DEFAULT); }
getReport().print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_STAT_0)); getReport().println( org.opencms.report.Messages.get().container(
getReport().print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_STAT_0)); getReport().println( org.opencms.report.Messages.get().container(
/** * @see java.lang.Runnable#run() */ @Override public void run() { getReport().println( Messages.get().container( Messages.RPT_CHANGEELEMENTLOCALE_BEGIN_2, m_settings.getOldLocale(), m_settings.getNewLocale()), I_CmsReport.FORMAT_HEADLINE); try { // change the element locales changeElementLocales(); } catch (CmsException e) { getReport().println(e); } // append runtime statistics to report getReport().print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_STAT_0)); getReport().println( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_STAT_DURATION_1, getReport().formatRuntime())); getReport().println( Messages.get().container(Messages.RPT_CHANGEELEMENTLOCALE_END_0), I_CmsReport.FORMAT_HEADLINE); }
private void replaceTags() throws CmsException { I_CmsReport report = getReport(); report.print(Messages.get().container(Messages.RPT_TAGREPLACE_READ_RESOURCES_1, m_settings.getWorkPath())); report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.RPT_TAGREPLACE_READ_RESOURCES_1, m_settings.getWorkPath())); } CmsResourceFilter filter = CmsResourceFilter.ALL.addRequireType( OpenCms.getResourceManager().getResourceType("xmlpage").getTypeId()); List resources = getCms().readResources(m_settings.getWorkPath(), filter, true); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key(Messages.LOG_TAGREPLACE_READ_RESOURCES_OK_1, m_settings.getWorkPath())); } report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK); Integer size = new Integer(resources.size()); Iterator itResources = resources.iterator(); CmsResource resource; int count = 1; while (itResources.hasNext()) { resource = (CmsResource)itResources.next(); replaceTags(resource, size, new Integer(count)); count++; } }