From 46d17a16a161d820c228b11650ee3abf573d5fb7 Mon Sep 17 00:00:00 2001 From: Nicolas Herbaut Date: Fri, 31 Aug 2012 17:09:15 +0200 Subject: [PATCH 1/2] spring mvc portlet archetype --- .../pom.xml | 17 ++ .../src/main/resources/META-INF/MANIFEST.MF | 6 + .../META-INF/maven/archetype-metadata.xml | 65 +++++++ .../resources/archetype-resources/pom.xml | 180 ++++++++++++++++++ .../main/java/__portletName__Controller.java | 34 ++++ .../main/resources/Language-ext.properties | 1 + .../src/main/webapp/META-INF/MANIFEST.MF | 3 + .../WEB-INF/__portletName__-portlet.xml | 35 ++++ .../webapp/WEB-INF/applicationContext.xml | 13 ++ .../src/main/webapp/WEB-INF/jsp/init.jsp | 5 + .../src/main/webapp/WEB-INF/jsp/view.jsp | 7 + .../main/webapp/WEB-INF/liferay-display.xml | 9 + .../WEB-INF/liferay-plugin-package.properties | 9 + .../main/webapp/WEB-INF/liferay-portlet.xml | 12 ++ .../src/main/webapp/WEB-INF/portlet.xml | 15 ++ .../src/main/webapp/WEB-INF/web.xml | 19 ++ .../src/main/webapp/css/main.css | 0 .../src/main/webapp/js/main.js | 0 18 files changed, 430 insertions(+) create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/pom.xml create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/META-INF/MANIFEST.MF create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/pom.xml create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/java/__portletName__Controller.java create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/resources/Language-ext.properties create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/META-INF/MANIFEST.MF create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/__portletName__-portlet.xml create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/init.jsp create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/view.jsp create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-display.xml create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-plugin-package.properties create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-portlet.xml create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/css/main.css create mode 100644 archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/js/main.js diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/pom.xml b/archetypes/liferay-portlet-spring-mvc-archetype/pom.xml new file mode 100644 index 00000000..3b4c18c2 --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/pom.xml @@ -0,0 +1,17 @@ + + 4.0.0 + com.intellinium.maven.archetypes + liferay-portlet-spring-mvc-archetype + 1.0-SNAPSHOT + jar + liferay-portlet-spring-mvc-archetype + + Intellinium + http://www.intellinium.com + + + jira + https://intellinium.atlassian.net + + diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/META-INF/MANIFEST.MF b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/META-INF/MANIFEST.MF new file mode 100644 index 00000000..0409bd88 --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/META-INF/MANIFEST.MF @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Archiver-Version: Plexus Archiver +Created-By: Apache Maven +Built-By: nherbaut +Build-Jdk: 1.6.0_26 + diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 00000000..85113787 --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,65 @@ + + + + MyPortlet + + + groupId + + + myportlet + + + 1.0-SNAPSHOT + + + com.mycompany.portlet + + + My Company + + + this is my portlet + + + + + + + + + + + src/main/java + + + src/test/java + + + src/main/webapp + + **/*.jsp + + + + + + src/main/webapp/ + + **/*.jsp + + + + + + src/main/resources + + + + + + \ No newline at end of file diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/pom.xml b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/pom.xml new file mode 100644 index 00000000..bae2c8e3 --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/pom.xml @@ -0,0 +1,180 @@ + + 4.0.0 + + ${groupId} + ${artifactId} + ${version} + war + + ${fullTextDescription} + + + 3.0.7.RELEASE + 1.0.6 + + + + + com.liferay.portal + portal-service + ${liferay.version} + provided + + + + + + javax.servlet + jstl + 1.2 + + + + com.liferay.portal + util-bridges + ${liferay.version} + provided + + + com.liferay.portal + util-taglib + ${liferay.version} + provided + + + com.liferay.portal + util-java + ${liferay.version} + provided + + + javax.portlet + portlet-api + 2.0 + provided + + + javax.servlet + servlet-api + 2.4 + provided + + + javax.servlet.jsp + jsp-api + 2.0 + provided + + + + org.springframework + spring-jdbc + ${spring.version} + + + + org.springframework + spring-orm + ${spring.version} + + + + org.springframework + spring-web + ${spring.version} + + + + + + org.springframework + spring-webmvc-portlet + ${spring.version} + + + + org.springframework.webflow + spring-webflow + 2.3.1.RELEASE + + + + org.springframework.security + spring-security-web + ${spring.version} + + + + org.springframework.security + spring-security-config + ${spring.version} + + + + org.springframework.security + spring-security-taglibs + ${spring.version} + + + + javax.inject + javax.inject + 1 + + + + org.slf4j + slf4j-api + 1.6.6 + + + + + + + + + + + + + com.liferay.maven.plugins + liferay-maven-plugin + ${liferay.version} + + ${liferay.auto.deploy.dir} + ${liferay.app.server.deploy.dir} + ${liferay.app.server.lib.global.dir} + ${liferay.app.server.portal.dir} + ${liferay.version} + portlet + + + + maven-compiler-plugin + 2.5 + + UTF-8 + 1.6 + 1.6 + + + + maven-resources-plugin + 2.5 + + UTF-8 + + + + + + + + ${organization} + + + + + diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/java/__portletName__Controller.java b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/java/__portletName__Controller.java new file mode 100644 index 00000000..dcf9362d --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/java/__portletName__Controller.java @@ -0,0 +1,34 @@ +package ${package}; + + +import java.util.List; + + +import javax.portlet.RenderRequest; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.portlet.ModelAndView; +import org.springframework.web.portlet.bind.annotation.RenderMapping; + + + +@Controller("${portletName}Controller") +@RequestMapping("VIEW") +public class ${portletName}Controller { + + + + @RenderMapping + public ModelAndView onPortletRender(RenderRequest request) { + + ModelAndView res = new ModelAndView(); + res.setViewName("view"); + + + return res; + } + + +} \ No newline at end of file diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/resources/Language-ext.properties b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/resources/Language-ext.properties new file mode 100644 index 00000000..b0a00009 --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/resources/Language-ext.properties @@ -0,0 +1 @@ +javax.portlet.title=${portletName} Title diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/META-INF/MANIFEST.MF b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5e949512 --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/__portletName__-portlet.xml b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/__portletName__-portlet.xml new file mode 100644 index 00000000..07cc24b9 --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/__portletName__-portlet.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml new file mode 100644 index 00000000..a4df49bb --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/applicationContext.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/init.jsp b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/init.jsp new file mode 100644 index 00000000..361959b5 --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/init.jsp @@ -0,0 +1,5 @@ +<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="liferay-ui" uri="http://liferay.com/tld/ui" %> + \ No newline at end of file diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/view.jsp b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/view.jsp new file mode 100644 index 00000000..9b995d99 --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/jsp/view.jsp @@ -0,0 +1,7 @@ +<%@ page contentType="text/html" isELIgnored="false"%> +<%@ include file="init.jsp"%> + + +hello from + +Portlet! diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-display.xml b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-display.xml new file mode 100644 index 00000000..25e1dbbd --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-display.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-plugin-package.properties b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-plugin-package.properties new file mode 100644 index 00000000..9b91aefb --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-plugin-package.properties @@ -0,0 +1,9 @@ +name=${portletName} +module-group-id=liferay +module-incremental-version=1 +tags= +short-description= +change-log= +page-url=http://www.liferay.com +author=Liferay, Inc. +licenses=LGPL \ No newline at end of file diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-portlet.xml b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-portlet.xml new file mode 100644 index 00000000..faf1774e --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/liferay-portlet.xml @@ -0,0 +1,12 @@ + + + + + + + ${portletName} + true + + + + \ No newline at end of file diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml new file mode 100644 index 00000000..85f3e92c --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/portlet.xml @@ -0,0 +1,15 @@ + + + + + ${portletName} + org.springframework.web.portlet.DispatcherPortlet + + text/html + view + + Language-ext + + \ No newline at end of file diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000..f978bc9d --- /dev/null +++ b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,19 @@ + + + + + org.springframework.web.context.ContextLoaderListener + + + view-servlet + org.springframework.web.servlet.ViewRendererServlet + 1 + + + + view-servlet + /WEB-INF/servlet/view + + \ No newline at end of file diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/css/main.css b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/css/main.css new file mode 100644 index 00000000..e69de29b diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/js/main.js b/archetypes/liferay-portlet-spring-mvc-archetype/src/main/resources/archetype-resources/src/main/webapp/js/main.js new file mode 100644 index 00000000..e69de29b From 376f71c8d3505785058d5e097e81fe0be3fec6d5 Mon Sep 17 00:00:00 2001 From: Nicolas Herbaut Date: Fri, 31 Aug 2012 17:11:00 +0200 Subject: [PATCH 2/2] fixed version --- archetypes/liferay-portlet-spring-mvc-archetype/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archetypes/liferay-portlet-spring-mvc-archetype/pom.xml b/archetypes/liferay-portlet-spring-mvc-archetype/pom.xml index 3b4c18c2..9a9f6455 100644 --- a/archetypes/liferay-portlet-spring-mvc-archetype/pom.xml +++ b/archetypes/liferay-portlet-spring-mvc-archetype/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.intellinium.maven.archetypes liferay-portlet-spring-mvc-archetype - 1.0-SNAPSHOT + 6.1.0-SNAPSHOT jar liferay-portlet-spring-mvc-archetype