/** * Returns the rfs name for the given locale, only used for multi-language export.<p> * * @param rfsName the original rfs name * @param fileSeparator the file separator to use * * @return the rfs name for the given locale */ public String getLocalizedRfsName(String rfsName, String fileSeparator) { String locRfsName = null; // this might be too simple locRfsName = CmsStringUtil.substitute(rfsName, fileSeparator + CmsLocaleManager.getDefaultLocale().toString() + fileSeparator, fileSeparator + getName() + fileSeparator); return locRfsName; }
/** * Returns the rfs name for the given locale, only used for multi-language export.<p> * * @param rfsName the original rfs name * @param fileSeparator the file separator to use * * @return the rfs name for the given locale */ public String getLocalizedRfsName(String rfsName, String fileSeparator) { String locRfsName = null; // this might be too simple locRfsName = CmsStringUtil.substitute( rfsName, fileSeparator + CmsLocaleManager.getDefaultLocale().toString() + fileSeparator, fileSeparator + getName() + fileSeparator); return locRfsName; }
/** * @see org.opencms.staticexport.CmsAfterPublishStaticExportHandler#getRelatedFilesToPurge(java.lang.String, java.lang.String) */ @Override protected List getRelatedFilesToPurge(String exportFileName, String vfsName) { CmsStaticExportManager manager = OpenCms.getStaticExportManager(); List result = new ArrayList(); if (m_rules == null) { // get the locale matching rules CmsLocaleManager locManager = OpenCms.getLocaleManager(); m_rules = new ArrayList(); Iterator itRules = manager.getRfsRules().iterator(); while (itRules.hasNext()) { CmsStaticExportRfsRule rule = (CmsStaticExportRfsRule)itRules.next(); Locale locale = CmsLocaleManager.getLocale(rule.getName()); if (locManager.getDefaultLocales().contains(locale)) { m_rules.add(rule); } } } // add paths for all possible locales Iterator it = m_rules.iterator(); while (it.hasNext()) { CmsStaticExportRfsRule rule = (CmsStaticExportRfsRule)it.next(); result.add(new File(rule.getLocalizedRfsName(exportFileName, File.separator))); } return result; } }
/** * @see org.opencms.staticexport.CmsAfterPublishStaticExportHandler#getRelatedFilesToPurge(java.lang.String, java.lang.String) */ @Override protected List<File> getRelatedFilesToPurge(String exportFileName, String vfsName) { CmsStaticExportManager manager = OpenCms.getStaticExportManager(); List<File> result = new ArrayList<File>(); if (m_rules == null) { // get the locale matching rules CmsLocaleManager locManager = OpenCms.getLocaleManager(); m_rules = new ArrayList<CmsStaticExportRfsRule>(); Iterator<CmsStaticExportRfsRule> itRules = manager.getRfsRules().iterator(); while (itRules.hasNext()) { CmsStaticExportRfsRule rule = itRules.next(); Locale locale = CmsLocaleManager.getLocale(rule.getName()); if (locManager.getDefaultLocales().contains(locale)) { m_rules.add(rule); } } } // add paths for all possible locales Iterator<CmsStaticExportRfsRule> it = m_rules.iterator(); while (it.hasNext()) { CmsStaticExportRfsRule rule = it.next(); result.add(new File(rule.getLocalizedRfsName(exportFileName, File.separator))); } return result; } }
rule.getExportPath(), rule.getExportBackups().intValue(), OpenCms.getResourceManager().getFileTranslator().translateResource(rule.getName())); staticExportWorkRule.renameTo(new File(rule.getExportPath()));
rule.getExportPath(), rule.getExportBackups().intValue(), OpenCms.getResourceManager().getFileTranslator().translateResource(rule.getName())); staticExportWorkRule.renameTo(new File(rule.getExportPath()));
rfsRuleElement.addElement(N_STATICEXPORT_NAME).addText(rule.getName()); rfsRuleElement.addElement(N_STATICEXPORT_DESCRIPTION).addText(rule.getDescription()); rfsRuleElement.addElement(N_STATICEXPORT_SOURCE).addText(rule.getSource().pattern());
rfsRuleElement.addElement(N_STATICEXPORT_NAME).addText(rule.getName()); rfsRuleElement.addElement(N_STATICEXPORT_DESCRIPTION).addText(rule.getDescription()); rfsRuleElement.addElement(N_STATICEXPORT_SOURCE).addText(rule.getSource().pattern());
Locale locale = CmsLocaleManager.getLocale(rule.getName()); if (locales.contains(locale)) {
Locale locale = CmsLocaleManager.getLocale(rule.getName()); if (locales.contains(locale)) {