/** * Adds a new export rule to the configuration.<p> * * @param name the name of the rule * @param description the description for the rule */ public void addExportRule(String name, String description) { m_exportRules.add(new CmsStaticExportExportRule( name, description, m_exportTmpRule.getModifiedResources(), m_exportTmpRule.getExportResourcePatterns())); m_exportTmpRule = new CmsStaticExportExportRule("", ""); }
/** * Adds a export uri to the latest export rule.<p> * * @param exportUri the export uri to add */ public void addExportRuleUri(String exportUri) { m_exportTmpRule.addExportResourcePattern(exportUri); }
/** * Adds a regex to the latest export rule.<p> * * @param regex the regex to add */ public void addExportRuleRegex(String regex) { m_exportTmpRule.addModifiedResource(regex); }
/** * Returns a set of <code>{@link CmsPublishedResource}</code> objects specified by the * <code><export-resources></code> node of this rule, if the publishedResource * matches a modified Resource regular expression.<p> * * @param cms the cms context * @param publishedResource a published resource to test * * @return a set of matching resources, or <code>null</code> if resource does not match * * @throws CmsException if something goes wrong */ public Set getRelatedResources(CmsObject cms, CmsPublishedResource publishedResource) throws CmsException { if (match(publishedResource.getRootPath())) { return getExportResources(cms); } return null; }
exportRuleElement.addElement(N_STATICEXPORT_NAME).addText(rule.getName()); exportRuleElement.addElement(N_STATICEXPORT_DESCRIPTION).addText(rule.getDescription()); Iterator<Pattern> itMods = rule.getModifiedResources().iterator(); while (itMods.hasNext()) { Pattern regex = itMods.next(); Iterator<String> itExps = rule.getExportResourcePatterns().iterator(); while (itExps.hasNext()) { String uri = itExps.next();
/** * Creates a new static export property object.<p> * */ public CmsStaticExportManager() { m_lockCmsEvent = new Object(); m_lockScrubExportFolders = new Object(); m_lockSetExportnames = new Object(); m_exportSuffixes = new ArrayList<String>(); m_exportFolders = new ArrayList<String>(); m_exportHeaders = new ArrayList<String>(); m_rfsRules = new ArrayList<CmsStaticExportRfsRule>(); m_exportRules = new ArrayList<CmsStaticExportExportRule>(); m_exportTmpRule = new CmsStaticExportExportRule("", ""); m_rfsTmpRule = new CmsStaticExportRfsRule("", "", "", "", "", "", null, null); m_fullStaticExport = false; }
while (itExportRules.hasNext()) { CmsStaticExportExportRule rule = itExportRules.next(); Set<CmsPublishedResource> relatedResources = rule.getRelatedResources(cms, pubResource); if (relatedResources != null) { Iterator<CmsPublishedResource> itRelatedRes = relatedResources.iterator();
exportRuleElement.addElement(N_STATICEXPORT_NAME).addText(rule.getName()); exportRuleElement.addElement(N_STATICEXPORT_DESCRIPTION).addText(rule.getDescription()); Iterator itMods = rule.getModifiedResources().iterator(); while (itMods.hasNext()) { Pattern regex = (Pattern)itMods.next(); Iterator itExps = rule.getExportResourcePatterns().iterator(); while (itExps.hasNext()) { String uri = (String)itExps.next();
/** * Returns a set of <code>{@link CmsPublishedResource}</code> objects specified by the * <code><export-resources></code> node of this rule, if the publishedResource * matches a modified Resource regular expression.<p> * * @param cms the cms context * @param publishedResource a published resource to test * * @return a set of matching resources, or <code>null</code> if resource does not match * * @throws CmsException if something goes wrong */ public Set<CmsPublishedResource> getRelatedResources(CmsObject cms, CmsPublishedResource publishedResource) throws CmsException { if (match(publishedResource.getRootPath())) { return getExportResources(cms); } return null; }
/** * Creates a new static export property object.<p> * */ public CmsStaticExportManager() { m_lockCmsEvent = new Object(); m_lockScrubExportFolders = new Object(); m_lockSetExportnames = new Object(); m_exportSuffixes = new ArrayList(); m_exportFolders = new ArrayList(); m_exportHeaders = new ArrayList(); m_rfsRules = new ArrayList(); m_exportRules = new ArrayList(); m_exportTmpRule = new CmsStaticExportExportRule("", ""); m_rfsTmpRule = new CmsStaticExportRfsRule("", "", "", "", "", "", null, null); m_fullStaticExport = false; }
while (itExportRules.hasNext()) { CmsStaticExportExportRule rule = (CmsStaticExportExportRule)itExportRules.next(); Set relatedResources = rule.getRelatedResources(cms, pubResource); if (relatedResources != null) { Iterator itRelatedRes = relatedResources.iterator();
/** * Adds a new export rule to the configuration.<p> * * @param name the name of the rule * @param description the description for the rule */ public void addExportRule(String name, String description) { m_exportRules.add( new CmsStaticExportExportRule( name, description, m_exportTmpRule.getModifiedResources(), m_exportTmpRule.getExportResourcePatterns())); m_exportTmpRule = new CmsStaticExportExportRule("", ""); }
/** * Adds a export uri to the latest export rule.<p> * * @param exportUri the export uri to add */ public void addExportRuleUri(String exportUri) { m_exportTmpRule.addExportResourcePattern(exportUri); }
/** * Adds a regex to the latest export rule.<p> * * @param regex the regex to add */ public void addExportRuleRegex(String regex) { m_exportTmpRule.addModifiedResource(regex); }