/** * Initializes some member variables for this report.<p> * * @param locale the locale for this report * @param siteRoot the site root of the user who started this report (may be <code>null</code>) */ protected void init(Locale locale, String siteRoot) { m_starttime = System.currentTimeMillis(); m_locale = locale; m_siteRoot = siteRoot; m_messages = Messages.get().getBundle(locale); }
/** * Initializes some member variables for this report.<p> * * @param locale the locale for this report * @param siteRoot the site root of the user who started this report (may be <code>null</code>) */ protected void init(Locale locale, String siteRoot) { m_starttime = System.currentTimeMillis(); m_locale = locale; m_siteRoot = siteRoot; m_messages = Messages.get().getBundle(locale); }
/** * @see org.opencms.report.I_CmsReport#printMessageWithParam(int,int,org.opencms.i18n.CmsMessageContainer,Object) */ public void printMessageWithParam(int m, int n, CmsMessageContainer container, Object param) { print( Messages.get().container(Messages.RPT_SUCCESSION_2, String.valueOf(m), String.valueOf(n)), I_CmsReport.FORMAT_NOTE); printMessageWithParam(container, param); }
/** * @see org.opencms.report.I_CmsReport#printMessageWithParam(int,int,org.opencms.i18n.CmsMessageContainer,Object) */ public void printMessageWithParam(int m, int n, CmsMessageContainer container, Object param) { print( Messages.get().container(Messages.RPT_SUCCESSION_2, String.valueOf(m), String.valueOf(n)), I_CmsReport.FORMAT_NOTE); printMessageWithParam(container, param); }
/** * @see org.opencms.report.I_CmsReport#printMessageWithParam(org.opencms.i18n.CmsMessageContainer,Object) */ public void printMessageWithParam(CmsMessageContainer container, Object param) { print(container, I_CmsReport.FORMAT_NOTE); print(Messages.get().container(Messages.RPT_ARGUMENT_1, param)); print(Messages.get().container(Messages.RPT_DOTS_0)); }
/** * @see org.opencms.report.I_CmsReport#printMessageWithParam(org.opencms.i18n.CmsMessageContainer,Object) */ public void printMessageWithParam(CmsMessageContainer container, Object param) { print(container, I_CmsReport.FORMAT_NOTE); print(Messages.get().container(Messages.RPT_ARGUMENT_1, param)); print(Messages.get().container(Messages.RPT_DOTS_0)); }
/** * 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); }
/** * 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); }
/** * 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; }
/** * 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)); }
/** * 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)); }
String resName = (String)i.next(); m_report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(count++),
for (int i = 0; i < allProjects.size(); i++) { CmsProject project = allProjects.get(i); report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(i + 1), String.valueOf(allProjects.size())), I_CmsReport.FORMAT_NOTE); report.print(Messages.get().container(Messages.RPT_EXPORT_PROJECT_0), I_CmsReport.FORMAT_NOTE); report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, project.getName())); report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK);
CmsProject project = allProjects.get(i); report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(i + 1), report.print(Messages.get().container(Messages.RPT_EXPORT_PROJECT_0), I_CmsReport.FORMAT_NOTE); report.print( org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, project.getName())); report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK);
for (int i = 0, l = allUsers.size(); i < l; i++) { CmsUser user = allUsers.get(i); report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(i + 1), String.valueOf(l)), I_CmsReport.FORMAT_NOTE); report.print(Messages.get().container(Messages.RPT_EXPORT_USER_0), I_CmsReport.FORMAT_NOTE); report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, user.getName())); report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); exportUser(parent, user); report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK);
List folders = m_cms.getSubFolders(resname, CmsResourceFilter.IGNORE_EXPIRATION); if (folders.size() == 0) { m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(counter), String.valueOf(size)), I_CmsReport.FORMAT_NOTE); m_report.print(Messages.get().container(Messages.RPT_DELFOLDER_0), I_CmsReport.FORMAT_NOTE); m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, resname), I_CmsReport.FORMAT_DEFAULT); m_cms.lockResource(resname); m_cms.deleteResource(resname, CmsResource.DELETE_PRESERVE_SIBLINGS); m_report.println(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK); counter++;
CmsResource res = (CmsResource)it.next(); m_report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(i + 1), Messages.get().container(Messages.RPT_PARSE_LINKS_FOR_1, m_cms.getSitePath(res)), I_CmsReport.FORMAT_NOTE); m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK); } catch (Throwable e) { m_report.addWarning(e); m_report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_FAILED_0), I_CmsReport.FORMAT_ERROR); if (LOG.isWarnEnabled()) {
org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_ARGUMENT_1, filename)); m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK);
for (int i = 0, l = allGroups.size(); i < l; i++) { CmsGroup group = allGroups.get(i); report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(i + 1), String.valueOf(l)), I_CmsReport.FORMAT_NOTE); report.print(Messages.get().container(Messages.RPT_EXPORT_GROUP_0), I_CmsReport.FORMAT_NOTE); report.print(org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_ARGUMENT_1, group.getName())); report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); exportGroup(parent, group); report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK);
org.opencms.report.Messages.get().container( org.opencms.report.Messages.RPT_SUCCESSION_2, String.valueOf(i + 1), Messages.get().container(Messages.RPT_PARSE_LINKS_FOR_1, m_cms.getSitePath(res)), I_CmsReport.FORMAT_NOTE); m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0), I_CmsReport.FORMAT_OK); } catch (Throwable e) { m_report.addWarning(e); m_report.println( org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_FAILED_0), I_CmsReport.FORMAT_ERROR); if (LOG.isWarnEnabled()) {