public void configureCommon(BaseSiteMeshBuilder builder) { // TagRuleBundles String[] ruleSetNames = properties.getStringArray(TAG_RULE_BUNDLES_PARAM); // TODO: Support clearTagRuleBundles() for (String ruleSetName : ruleSetNames) { builder.addTagRuleBundle((TagRuleBundle) objectFactory.create(ruleSetName)); } // Custom ContentProcessor String contentProcessorName = properties.getString(CONTENT_PROCESSOR_PARAM); if (contentProcessorName != null) { builder.setCustomContentProcessor( (ContentProcessor) objectFactory.create(contentProcessorName)); } // Decorator mappings Map<String, String[]> decoratorsMappings = properties.getStringMultiMap(DECORATOR_MAPPINGS_PARAM); if (decoratorsMappings != null) { for (Map.Entry<String, String[]> entry : decoratorsMappings.entrySet()) { builder.addDecoratorPaths(entry.getKey(), entry.getValue()); } } }
public void configureCommon(BaseSiteMeshBuilder builder) { // TagRuleBundles String[] ruleSetNames = properties.getStringArray(TAG_RULE_BUNDLES_PARAM); // TODO: Support clearTagRuleBundles() for (String ruleSetName : ruleSetNames) { builder.addTagRuleBundle((TagRuleBundle) objectFactory.create(ruleSetName)); } // Custom ContentProcessor String contentProcessorName = properties.getString(CONTENT_PROCESSOR_PARAM); if (contentProcessorName != null) { builder.setCustomContentProcessor( (ContentProcessor) objectFactory.create(contentProcessorName)); } // Decorator mappings Map<String, String[]> decoratorsMappings = properties.getStringMultiMap(DECORATOR_MAPPINGS_PARAM); if (decoratorsMappings != null) { for (Map.Entry<String, String[]> entry : decoratorsMappings.entrySet()) { builder.addDecoratorPaths(entry.getKey(), entry.getValue()); } } }
public void configureCommon(BaseSiteMeshBuilder builder) { // TagRuleBundles // TODO: Support clearTagRuleBundles() for(Xml tagRuleBundle : xml.child("content-processor").children("tag-rule-bundle")) { String tagRuleBundleName = tagRuleBundle.attribute("class"); if (tagRuleBundleName != null) { builder.addTagRuleBundle((TagRuleBundle) objectFactory.create(tagRuleBundleName)); } } // Custom ContentProcessor String contentProcessorName = xml.child("content-processor").attribute("class"); if (contentProcessorName != null) { builder.setCustomContentProcessor( (ContentProcessor) objectFactory.create(contentProcessorName)); } // Decorator mappings for (Xml mapping : xml.children("mapping")) { List<Xml> paths = mapping.children("path"); if (!paths.isEmpty()) { for (Xml path : paths) { addDecoratorPaths(builder, mapping, path.text()); } } else { addDecoratorPaths(builder, mapping, mapping.attribute("path", "/*")); } } }
public void configureCommon(BaseSiteMeshBuilder builder) { // TagRuleBundles // TODO: Support clearTagRuleBundles() for(Xml tagRuleBundle : xml.child("content-processor").children("tag-rule-bundle")) { String tagRuleBundleName = tagRuleBundle.attribute("class"); if (tagRuleBundleName != null) { builder.addTagRuleBundle((TagRuleBundle) objectFactory.create(tagRuleBundleName)); } } // Custom ContentProcessor String contentProcessorName = xml.child("content-processor").attribute("class"); if (contentProcessorName != null) { builder.setCustomContentProcessor( (ContentProcessor) objectFactory.create(contentProcessorName)); } // Decorator mappings for (Xml mapping : xml.children("mapping")) { List<Xml> paths = mapping.children("path"); if (!paths.isEmpty()) { for (Xml path : paths) { addDecoratorPaths(builder, mapping, path.text()); } } else { addDecoratorPaths(builder, mapping, mapping.attribute("path", "/*")); } } }
@SuppressWarnings("unchecked") public void configureFilter(BaseSiteMeshFilterBuilder builder) { // Common configuration configureCommon(builder); // Filter specific configuration... // Error page inclusion String includeErrorPagesString = properties.getString(INCLUDE_ERROR_PAGES_PARAM); if ("true".equals(includeErrorPagesString) || "1".equals(includeErrorPagesString)) { builder.setIncludeErrorPages(true); } // decorator selector String decoratorSelector = properties.getString(DECORATOR_SELECTOR); if (decoratorSelector != null) { builder.setCustomDecoratorSelector((DecoratorSelector) getObjectFactory().create(decoratorSelector)); } // Excludes String[] excludes = properties.getStringArray(EXCLUDE_PARAM); for (String exclude : excludes) { builder.addExcludedPath(exclude); } // Mime-types String[] mimeTypes = properties.getStringArray(MIME_TYPES_PARAM); if (mimeTypes.length > 0) { builder.setMimeTypes(mimeTypes); } // Custom selector // TODO }
builder.setCustomDecoratorSelector((DecoratorSelector) getObjectFactory().create(customDecoratorSelector));
@SuppressWarnings("unchecked") public void configureFilter(BaseSiteMeshFilterBuilder builder) { // Common configuration configureCommon(builder); // Filter specific configuration... // Error page inclusion String includeErrorPagesString = properties.getString(INCLUDE_ERROR_PAGES_PARAM); if ("true".equals(includeErrorPagesString) || "1".equals(includeErrorPagesString)) { builder.setIncludeErrorPages(true); } // decorator selector String decoratorSelector = properties.getString(DECORATOR_SELECTOR); if (decoratorSelector != null) { builder.setCustomDecoratorSelector((DecoratorSelector) getObjectFactory().create(decoratorSelector)); } // Excludes String[] excludes = properties.getStringArray(EXCLUDE_PARAM); for (String exclude : excludes) { builder.addExcludedPath(exclude); } // Mime-types String[] mimeTypes = properties.getStringArray(MIME_TYPES_PARAM); if (mimeTypes.length > 0) { builder.setMimeTypes(mimeTypes); } // Custom selector // TODO }
builder.setCustomDecoratorSelector((DecoratorSelector) getObjectFactory().create(customDecoratorSelector));