@Override public void removeComponent(SComponent component) { super.removeComponent(component); TemplateSource source = getTemplateSource(); if (source != null) { TemplateIntegrationLayout.ComponentSet componentSet = componentSets.get(source.getCanonicalName()); componentSet.contained.remove(component); componentSet.notContained.remove(component); } }
@Override public void addComponent(SComponent component, Object constraint, int index) { component.setName((String)constraint); super.addComponent(component, constraint, index); TemplateSource source = getTemplateSource(); if (source != null) { TemplateIntegrationLayout.ComponentSet componentSet = componentSets.get(source.getCanonicalName()); boolean contained = componentSet.names.contains(component.getName()); component.setVisible(contained); if (contained) componentSet.contained.add(component); else componentSet.notContained.add(component); } }
private static void write(Device device, TemplateIntegrationLayout layout) throws IOException { final TemplateSource source = layout.getTemplateSource(); if (source == null) { device.print("The cms server is not reachable at the moment or the connection data is wrong. Please check your <em>integration.xml</em>"); } else { IntegrationTemplateParseContext context = new IntegrationTemplateParseContext(device, layout); parser.process(source, context); } }
public static Map<String, Map<String, String>> getComponentProperties(TemplateIntegrationLayout layout) throws IOException { final TemplateSource source = layout.getTemplateSource(); IntegrationTemplateParseContext context = new IntegrationTemplateParseContext(new NullDevice(), layout); return TemplateIntegrationLayoutCG.parser.getComponentProperties(source, context); }
public static Set<String> getContainedComponents(TemplateIntegrationLayout layout) throws IOException { final TemplateSource source = layout.getTemplateSource(); IntegrationTemplateParseContext context = new IntegrationTemplateParseContext(new NullDevice(), layout); return TemplateIntegrationLayoutCG.parser.getContainedComponents(source, context); }