@Override public String getProperty(String name) throws UnknownPropertyError { // Obtain the extension property value return HttpTemplateSectionSource.this.getContext().getProperty(this.extensionPropertyPrefix + name); }
@Override public Properties getProperties() { // Obtain all the properties Properties properties = new Properties(); // Filter to just this extension's properties String[] contextNames = HttpTemplateSectionSource.this.getContext().getPropertyNames(); for (String contextName : contextNames) { if (contextName.startsWith(this.extensionPropertyPrefix)) { // Add the extension property name String extensionName = contextName.substring(this.extensionPropertyPrefix.length()); String value = HttpTemplateSectionSource.this.getContext().getProperty(contextName); properties.setProperty(extensionName, value); } } // Return the properties return properties; }
@Override public String[] getPropertyNames() { // Obtain all the property names String[] contextNames = HttpTemplateSectionSource.this.getContext().getPropertyNames(); // Filter to just this extension's properties List<String> extensionNames = new LinkedList<String>(); for (String contextName : contextNames) { if (contextName.startsWith(this.extensionPropertyPrefix)) { // Add the extension property name String extensionName = contextName.substring(this.extensionPropertyPrefix.length()); extensionNames.add(extensionName); } } // Return the extension names return extensionNames.toArray(new String[extensionNames.size()]); }
String sectionClassName = context.getProperty(PROPERTY_CLASS_NAME, null); boolean isLogicClass = true; if (CompileUtil.isBlank(sectionClassName)) { this.sectionClass = context.loadClass(sectionClassName); super.sourceSection(designer, context); String templateLocation = context.getSectionLocation(); String inheritedTemplatesValue = context.getProperty(PROPERTY_INHERITED_TEMPLATES, null); if (inheritedTemplatesValue != null) { String templateUriPath = context.getProperty(PROPERTY_TEMPLATE_URI); String extensionClassName = context.getProperty(EXTENSION_PREFIX + extensionIndex, null); while (extensionClassName != null) { .loadClass(extensionClassName).newInstance(); extensionClassName = context.getProperty(EXTENSION_PREFIX + extensionIndex, null); String templateUriSuffix = context.getProperty(HttpTemplateWorkSource.PROPERTY_TEMPLATE_URI_SUFFIX, null); NEXT_PROPERTY: for (String propertyName : context.getPropertyNames()) { if (propertyName.startsWith(HttpTemplateWorkSource.PROPERTY_LINK_SECURE_PREFIX)) {
@Override public void sourceSection(SectionDesigner designer, SectionSourceContext context) throws Exception { // Create the Servlet Bridge dependency SectionObject servletBridge = designer.addSectionObject( "SERVLET_BRIDGE", ServletBridge.class.getName()); // Create the non-handled task String nonHandledInputName = context.getSectionLocation(); this.addServletResource(nonHandledInputName, null, servletBridge, designer); // Create the Servlet container resource tasks Set<String> registeredResources = new HashSet<String>(); for (String inputName : context.getPropertyNames()) { // Obtain the request dispatcher path String requestDispatcherPath = context.getProperty(inputName); // Ensure only register the resource once if (registeredResources.contains(requestDispatcherPath)) { continue; } // Add Servlet Resource this.addServletResource(inputName, requestDispatcherPath, servletBridge, designer); // Resource registered registeredResources.add(requestDispatcherPath); } }
String webXmlLocation = context.getSectionLocation(); InputStream webXmlConfiguration; if (webXmlLocation != null) { webXmlConfiguration = context.getResource(webXmlLocation); String webXmlContent = context.getProperty(PROPERTY_WEB_XML_CONFIGURATION); webXmlConfiguration = new ByteArrayInputStream(webXmlContent.getBytes());
String key = context.getSectionLocation(); if (CompileUtil.isBlank(key)) { key = context.getProperty(PROPERTY_HTTP_SECURITY_SOURCE_KEY);
.createPropertyList(); properties .addProperty( WorkType<?> workType = sectionContext.loadWorkType( GwtServiceWorkSource.class.getName(), properties);
ClassLoader classLoader = sectionContext.getClassLoader();
String sectionClassName = context.getProperty(PROPERTY_CLASS_NAME, null); boolean isLogicClass = true; if (CompileUtil.isBlank(sectionClassName)) { this.sectionClass = context.loadClass(sectionClassName); super.sourceSection(designer, context); String templatePath = context.getSectionLocation(); .parseInt(context.getProperty(PROPERTY_INHERITED_TEMPLATES_COUNT, String.valueOf(0))); String[] templateInheritanceHierarchy = new String[inheritedTemplatesCount + 1]; for (int inheritanceIndex = 0; inheritanceIndex < inheritedTemplatesCount; inheritanceIndex++) { .loadClass(extension.webTemplateExtensionClassName); WebTemplateExtension extensionInstance = extensionClass.getDeclaredConstructor().newInstance(); .valueOf(context.getProperty(PROPERTY_TEMPLATE_SECURE, String.valueOf(false))); String templateContentType = context.getProperty(PROPERTY_CONTENT_TYPE, null); String charsetName = context.getProperty(PROPERTY_CHARSET, null); if (!CompileUtil.isBlank(charsetName)) { .getProperty(PROPERTY_LINK_SEPARATOR, String.valueOf(DEFAULT_LINK_SEPARATOR)).charAt(0); .parseBoolean(context.getProperty(PROPERTY_IS_PATH_PARAMETERS, String.valueOf(false))); if (isPathParameters && (!isLogicClass)) { throw designer.addIssue("Must provide logic class, as template has path parameters");
for (String propertyName : context.getPropertyNames()) { if (propertyName.startsWith(PROPERTY_URL_LINK_PREFIX)) { String inputName = context.getProperty(propertyName); String isSecureText = context.getProperty( PROPERTY_URL_SECURE_PREFIX + uriPath, null); Boolean isSecure = null;
@Override public String getProperty(String name, String defaultValue) { // Obtain the extension property value return HttpTemplateSectionSource.this.getContext().getProperty(this.extensionPropertyPrefix + name, defaultValue); }
for (String name : context.getPropertyNames()) { if (name.startsWith(PROPERTY_RESOURCE_PREFIX)) { String resourcePath = context.getProperty(name);
for (String name : context.getPropertyNames()) { if (name.startsWith(PROPERTY_MANUAL_PUBLISH_URI_PREFIX)) { String requestUriPrefix = context.getProperty(name).trim();