You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by as...@apache.org on 2019/03/25 21:48:59 UTC

[portals-pluto] branch master updated: PLUTO-749 Develop the thymeleaf-mvc-portlet-cdi module

This is an automated email from the ASF dual-hosted git repository.

asfgriff pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/portals-pluto.git


The following commit(s) were added to refs/heads/master by this push:
     new c80f9dc  PLUTO-749 Develop the thymeleaf-mvc-portlet-cdi module
c80f9dc is described below

commit c80f9dc359bd13d67d6a5c1fead41474df4cc4ee
Author: Neil Griffin <ne...@gmail.com>
AuthorDate: Mon Mar 25 17:48:40 2019 -0400

    PLUTO-749 Develop the thymeleaf-mvc-portlet-cdi module
---
 portlet-templating/pom.xml                         |   1 +
 .../thymeleaf-mvc-portlet-cdi/pom.xml              |  81 ++++++++++++
 .../mvc/portlet/cdi/CDIVariableValidator.java      |  56 ++++++++
 .../cdi/TemplateEngineSupplierProducer.java        |  79 +++++++++++
 .../mvc/portlet/cdi/VariableValidatorProducer.java |  55 ++++++++
 .../mvc/portlet/cdi/ViewEngineProducer.java        |  55 ++++++++
 .../mvc/portlet/cdi/WebContextProducer.java        | 146 +++++++++++++++++++++
 .../src/main/resources/META-INF/beans.xml}         |  24 +---
 8 files changed, 478 insertions(+), 19 deletions(-)

diff --git a/portlet-templating/pom.xml b/portlet-templating/pom.xml
index 90db636..8ded1ef 100644
--- a/portlet-templating/pom.xml
+++ b/portlet-templating/pom.xml
@@ -25,6 +25,7 @@
 	<modules>
 		<module>thymeleaf-portlet-api</module>
 		<module>thymeleaf-mvc-portlet-api</module>
+		<module>thymeleaf-mvc-portlet-cdi</module>
 	</modules>
 
 </project>
diff --git a/portlet-templating/thymeleaf-mvc-portlet-cdi/pom.xml b/portlet-templating/thymeleaf-mvc-portlet-cdi/pom.xml
new file mode 100644
index 0000000..03d306b
--- /dev/null
+++ b/portlet-templating/thymeleaf-mvc-portlet-cdi/pom.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor 
+   license agreements. See the NOTICE file distributed with this work for additional 
+   information regarding copyright ownership. The ASF licenses this file to 
+   you under the Apache License, Version 2.0 (the "License"); you may not use 
+   this file except in compliance with the License. You may obtain a copy of 
+   the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+   by applicable law or agreed to in writing, software distributed under the 
+   License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+   OF ANY KIND, either express or implied. See the License for the specific 
+   language governing permissions and limitations under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>org.apache.portals.pluto</groupId>
+		<artifactId>portlet-templating</artifactId>
+		<version>3.0.2-SNAPSHOT</version>
+		<relativePath>../pom.xml</relativePath>
+	</parent>
+	<artifactId>thymeleaf-mvc-portlet-cdi</artifactId>
+	<name>Thymeleaf MVC Portlet CDI</name>
+	<description>CDI implementation of the Thymeleaf MVC Portlet API</description>
+
+	<dependencies>
+		<dependency>
+			<groupId>javax.enterprise</groupId>
+			<artifactId>cdi-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.mvc</groupId>
+			<artifactId>javax.mvc-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.portlet</groupId>
+			<artifactId>portlet-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>javax.servlet-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>javax.ws.rs</groupId>
+			<artifactId>javax.ws.rs-api</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>ognl</groupId>
+			<artifactId>ognl</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.portals.pluto</groupId>
+			<artifactId>portlet-servlet-adapter</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.portals.pluto</groupId>
+			<artifactId>thymeleaf-mvc-portlet-api</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.8</source>
+					<target>1.8</target>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>
diff --git a/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/CDIVariableValidator.java b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/CDIVariableValidator.java
new file mode 100644
index 0000000..40ffda5
--- /dev/null
+++ b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/CDIVariableValidator.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.thymeleaf.mvc.portlet.cdi;
+
+import org.apache.pluto.thymeleaf.portlet.VariableValidatorBase;
+
+
+/**
+ * This class provides a CDI implementation of the {@link org.apache.pluto.thymeleaf.portlet.VariableValidator}
+ * interface.
+ *
+ * @author  Neil Griffin
+ */
+public class CDIVariableValidator extends VariableValidatorBase {
+
+	private boolean includeStandardBeans;
+
+	public CDIVariableValidator(boolean includeStandardBeans) {
+		this.includeStandardBeans = includeStandardBeans;
+	}
+
+	@Override
+	public boolean isIncludeStandardBeans() {
+		return includeStandardBeans;
+	}
+
+	@Override
+	public boolean isValidName(String name, boolean headerPhase, boolean renderPhase, boolean resourcePhase) {
+
+		boolean valid = super.isValidName(name, headerPhase, renderPhase, resourcePhase);
+
+		if (!valid) {
+			return false;
+		}
+
+		if (name.startsWith("javax.enterprise")) {
+			return false;
+		}
+
+		return true;
+	}
+}
diff --git a/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/TemplateEngineSupplierProducer.java b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/TemplateEngineSupplierProducer.java
new file mode 100644
index 0000000..874a85a
--- /dev/null
+++ b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/TemplateEngineSupplierProducer.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.thymeleaf.mvc.portlet.cdi;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+import javax.mvc.MvcContext;
+import javax.mvc.engine.ViewEngine;
+import javax.portlet.PortletConfig;
+import javax.servlet.ServletContext;
+import javax.ws.rs.core.Configuration;
+
+import org.apache.pluto.thymeleaf.portlet.DefaultTemplateEngineSupplier;
+import org.apache.pluto.thymeleaf.portlet.PortletMessageResolver;
+import org.apache.pluto.thymeleaf.portlet.PortletTemplateResolver;
+import org.apache.pluto.thymeleaf.portlet.TemplateEngineSupplier;
+import org.apache.pluto.thymeleaf.portlet.TemplateLocationSupplier;
+
+import org.thymeleaf.TemplateEngine;
+
+
+/**
+ * This class is a CDI producer that provides the ability to generate an instance of {@link TemplateEngineSupplier}.
+ *
+ * @author  Neil Griffin
+ */
+public class TemplateEngineSupplierProducer {
+
+	@ApplicationScoped
+	@Produces
+	public TemplateEngineSupplier getTemplateEngineSupplier(PortletConfig portletConfig, ServletContext servletContext,
+															MvcContext mvcContext) {
+
+		TemplateEngine templateEngine = new TemplateEngine();
+
+		templateEngine.setMessageResolver(new PortletMessageResolver(portletConfig));
+
+		Configuration configuration = mvcContext.getConfig();
+
+		String templateLocation = (String) configuration.getProperty(ViewEngine.VIEW_FOLDER);
+
+		if (templateLocation == null) {
+			templateLocation = ViewEngine.DEFAULT_VIEW_FOLDER;
+		}
+
+		templateEngine.setTemplateResolver(new PortletTemplateResolver(servletContext,
+				new CDITemplateLocationSupplier(templateLocation)));
+
+		return new DefaultTemplateEngineSupplier(templateEngine);
+	}
+
+	private static class CDITemplateLocationSupplier implements TemplateLocationSupplier {
+
+		private String templateLocation;
+
+		public CDITemplateLocationSupplier(String templateLocation) {
+			this.templateLocation = templateLocation;
+		}
+
+		@Override
+		public String get() {
+			return templateLocation;
+		}
+	}
+}
diff --git a/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/VariableValidatorProducer.java b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/VariableValidatorProducer.java
new file mode 100644
index 0000000..cefaa7f
--- /dev/null
+++ b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/VariableValidatorProducer.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.thymeleaf.mvc.portlet.cdi;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.inject.Produces;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+
+import org.apache.pluto.thymeleaf.portlet.VariableValidator;
+
+
+/**
+ * This class is a CDI producer that provides the ability to generate an instance of {@link VariableValidator}.
+ *
+ * @author  Neil Griffin
+ */
+@ApplicationScoped
+public class VariableValidatorProducer {
+
+	@Produces
+	@ApplicationScoped
+	public VariableValidator getVariableValidator(PortletConfig portletConfig, PortletContext portletContext) {
+
+		boolean includeStandardBeans = false;
+
+		String initParameter = portletConfig.getInitParameter(VariableValidator.INCLUDE_STANDARD_BEANS);
+
+		if (initParameter != null) {
+			includeStandardBeans = Boolean.valueOf(initParameter.toString());
+		}
+
+		initParameter = portletContext.getInitParameter(VariableValidator.INCLUDE_STANDARD_BEANS);
+
+		if (initParameter != null) {
+			includeStandardBeans = Boolean.valueOf(initParameter.toString());
+		}
+
+		return new CDIVariableValidator(includeStandardBeans);
+	}
+}
diff --git a/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/ViewEngineProducer.java b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/ViewEngineProducer.java
new file mode 100644
index 0000000..9974fd9
--- /dev/null
+++ b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/ViewEngineProducer.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.thymeleaf.mvc.portlet.cdi;
+
+import java.io.IOException;
+
+import javax.enterprise.inject.Produces;
+import javax.mvc.engine.ViewEngine;
+import javax.mvc.engine.ViewEngineException;
+import javax.portlet.MimeResponse;
+import javax.portlet.annotations.PortletRequestScoped;
+
+import org.apache.pluto.thymeleaf.mvc.portlet.ThymeleafViewEngine;
+import org.apache.pluto.thymeleaf.portlet.TemplateEngineSupplier;
+
+import org.thymeleaf.context.IWebContext;
+
+
+/**
+ * This class is a CDI producer that provides the ability to generate instances of {@link ViewEngine}.
+ *
+ * @author  Neil Griffin
+ */
+public class ViewEngineProducer {
+
+	@PortletRequestScoped
+	@Produces
+	public ViewEngine getTimeleafViewEngine(TemplateEngineSupplier templateEngineSupplier, IWebContext webContext) {
+		return new ThymeleafViewEngine(templateEngineSupplier.get(), webContext,
+				viewEngineContext -> {
+					MimeResponse mimeResponse = viewEngineContext.getResponse(MimeResponse.class);
+
+					try {
+						return mimeResponse.getWriter();
+					}
+					catch (IOException e) {
+						throw new ViewEngineException(e);
+					}
+				});
+	}
+}
diff --git a/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/WebContextProducer.java b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/WebContextProducer.java
new file mode 100644
index 0000000..f0aa4e4
--- /dev/null
+++ b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/java/org/apache/pluto/thymeleaf/mvc/portlet/cdi/WebContextProducer.java
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.thymeleaf.mvc.portlet.cdi;
+
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+
+import javax.enterprise.inject.Any;
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.util.AnnotationLiteral;
+import javax.mvc.Models;
+import javax.mvc.MvcContext;
+import javax.portlet.MimeResponse;
+import javax.portlet.PortletRequest;
+import javax.portlet.annotations.PortletRequestScoped;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.pluto.portlet.servlet.adapter.HttpServletRequestAdapter;
+import org.apache.pluto.portlet.servlet.adapter.HttpServletResponseAdapter;
+import org.apache.pluto.thymeleaf.portlet.VariableValidator;
+import org.apache.pluto.thymeleaf.portlet.WebContextBase;
+
+import org.thymeleaf.context.IWebContext;
+
+
+/**
+ * This class is a CDI producer that provides the ability to generate instances of {@link IWebContext}.
+ *
+ * @author  Neil Griffin
+ */
+public class WebContextProducer {
+
+	@PortletRequestScoped
+	@Produces
+	public IWebContext getWebContext(BeanManager beanManager, VariableValidator variableValidator,
+		MvcContext mvcContext, Models models, PortletRequest portletRequest, MimeResponse mimeResponse,
+		ServletContext servletContext) {
+
+		return new CDIPortletWebContext(beanManager, variableValidator, models,
+				(String) portletRequest.getAttribute(PortletRequest.LIFECYCLE_PHASE),
+				new HttpServletRequestAdapter(portletRequest), new HttpServletResponseAdapter(mimeResponse),
+				servletContext, mvcContext.getLocale());
+	}
+
+	private static class CDIPortletWebContext extends WebContextBase {
+
+		private BeanManager beanManager;
+		private Set<String> beanNames;
+		private Models models;
+
+		public CDIPortletWebContext(BeanManager beanManager, VariableValidator variableInspector, Models models,
+			String lifecyclePhase, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse,
+			ServletContext servletContext, Locale locale) {
+
+			super(httpServletRequest, httpServletResponse, servletContext, locale);
+			this.beanManager = beanManager;
+			this.models = models;
+			this.beanNames = new HashSet<>();
+
+			boolean headerPhase = lifecyclePhase.equals(PortletRequest.HEADER_PHASE);
+			boolean renderPhase = lifecyclePhase.equals(PortletRequest.RENDER_PHASE);
+			boolean resourcePhase = lifecyclePhase.equals(PortletRequest.RESOURCE_PHASE);
+
+			Set<Bean<?>> beans = beanManager.getBeans(Object.class, new AnnotationLiteral<Any>() {
+					});
+
+			for (Bean<?> bean : beans) {
+				String beanName = bean.getName();
+
+				if ((beanName != null) &&
+						variableInspector.isValidName(beanName, headerPhase, renderPhase, resourcePhase)) {
+					this.beanNames.add(beanName);
+				}
+			}
+		}
+
+		@Override
+		public boolean containsVariable(String name) {
+
+			Map<String, Object> modelsMap = models.asMap();
+
+			if (modelsMap.containsKey(name)) {
+				return true;
+			}
+
+			return beanNames.contains(name);
+		}
+
+		@Override
+		public Object getVariable(String name) {
+
+			Object value = models.get(name);
+
+			if (value == null) {
+
+				Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(name));
+
+				if (resolvedBean != null) {
+					Set<Type> types = resolvedBean.getTypes();
+
+					if (!types.isEmpty()) {
+						Iterator<Type> typeIterator = types.iterator();
+						Type firstType = typeIterator.next();
+						value = beanManager.getReference(resolvedBean, firstType,
+								beanManager.createCreationalContext(resolvedBean));
+					}
+				}
+			}
+
+			return value;
+		}
+
+		@Override
+		public Set<String> getVariableNames() {
+
+			Map<String, Object> modelsMap = models.asMap();
+			Set<String> variableNames = new HashSet<>(modelsMap.keySet());
+			variableNames.addAll(beanNames);
+
+			return variableNames;
+		}
+
+	}
+}
diff --git a/portlet-templating/pom.xml b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/resources/META-INF/beans.xml
similarity index 56%
copy from portlet-templating/pom.xml
copy to portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/resources/META-INF/beans.xml
index 90db636..1469f73 100644
--- a/portlet-templating/pom.xml
+++ b/portlet-templating/thymeleaf-mvc-portlet-cdi/src/main/resources/META-INF/beans.xml
@@ -9,22 +9,8 @@
    License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
    OF ANY KIND, either express or implied. See the License for the specific
    language governing permissions and limitations under the License. -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-	<modelVersion>4.0.0</modelVersion>
-	<parent>
-		<groupId>org.apache.portals.pluto</groupId>
-		<artifactId>pluto</artifactId>
-		<version>3.0.2-SNAPSHOT</version>
-		<relativePath>../pom.xml</relativePath>
-	</parent>
-	<artifactId>portlet-templating</artifactId>
-	<packaging>pom</packaging>
-	<name>Portlet Templating</name>
-
-	<modules>
-		<module>thymeleaf-portlet-api</module>
-		<module>thymeleaf-mvc-portlet-api</module>
-	</modules>
-
-</project>
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" bean-discovery-mode="all" version="1.2"
+	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd">
+	<!-- This file is necessary in order to inform CDI that scanning should occur for CDI annotations. -->
+</beans>
\ No newline at end of file