/** * Default constructor */ public IntegrationFrame() { Integration integration = readIntegration(); adapter = createAdapter(integration); adapter.setFrame(this); adapter.setIntegration(integration); // Set the resource mapper which is the distinguishable cms adapter. SessionManager.getSession().setResourceMapper(adapter); initialize(); }
/** * @param frame * @param integration */ public AbstractIntegrationAdapter(IntegrationFrame frame, Integration integration) { this.frame = frame; this.integration = integration; defaultResource = frame.getDynamicResource(ReloadResource.class); }
public static Object getResource(String param) { return getResource(param); }
/** * {@inheritDoc} */ public void parseScripts(Source source) { Collection<Script> newScripts = new ArrayList<>(); Collection<StartTag> scriptTags = source.findAllStartTags("script"); for (StartTag scriptTag : scriptTags) { Attributes attributes = scriptTag.getAttributes(); String type = attributes.getValue("type"); String src = attributes.getValue("src"); if (src != null) newScripts.add(new Script(type, new Url(src))); } if (!newScripts.equals(scripts)) { // System.out.println("scripts = " + scripts); // System.out.println("newScripts = " + newScripts); for (Script script : scripts) frame.removeHeader(script); for (Script script : newScripts) frame.addHeader(script); scripts.clear(); scripts.addAll(newScripts); } } }
/** * {@inheritDoc} */ public void parseTitle(Source source, OutputDocument output) { Element titleElement = source.findNextElement(0, "title"); if (titleElement != null) { String title = titleElement.getTextExtractor().toString(); frame.setTitle(title); } }
@Override protected void initialize() { templateLayout = new TemplateIntegrationLayout(); setContentPane(new TemplateIntegrationForm(templateLayout)); super.initialize(); }
frame.removeHeader(script); frame.addHeader(script);
private Source prepareTitle(Source headSource) { Element titleElement = headSource.findNextElement(0, Tag.TITLE); if (titleElement != null) { String title = titleElement.getTextExtractor().toString(); frame.setTitle(title); return HtmlParserUtils.removeAllTags(headSource, Tag.TITLE); } return headSource; } }
/** */ private Source prepareTitle(Source headSource) { Element titleElement = headSource.findNextElement(0, Tag.TITLE); if (titleElement != null) { String title = titleElement.getTextExtractor().toString(); frame.setTitle(title); return HtmlParserUtils.removeAllTags(headSource, Tag.TITLE); } return headSource; }