Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Commit

Permalink
spring mvc portlet archetype
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Herbaut committed Aug 31, 2012
1 parent fea108d commit 46d17a1
Show file tree
Hide file tree
Showing 18 changed files with 430 additions and 0 deletions.
17 changes: 17 additions & 0 deletions archetypes/liferay-portlet-spring-mvc-archetype/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.intellinium.maven.archetypes</groupId>
<artifactId>liferay-portlet-spring-mvc-archetype</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>liferay-portlet-spring-mvc-archetype</name>
<organization>
<name>Intellinium</name>
<url>http://www.intellinium.com</url>
</organization>
<issueManagement>
<system>jira</system>
<url>https://intellinium.atlassian.net</url>
</issueManagement>
</project>
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<archetype-descriptor
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="Intellinium spring mvc portlet archetype" partial="false">
<requiredProperties>
<requiredProperty key="portletName">
<defaultValue>MyPortlet</defaultValue>
</requiredProperty>
<requiredProperty key="groupId">
<defaultValue>groupId</defaultValue>
</requiredProperty>
<requiredProperty key="artifactId">
<defaultValue>myportlet</defaultValue>
</requiredProperty>
<requiredProperty key="version">
<defaultValue>1.0-SNAPSHOT</defaultValue>
</requiredProperty>
<requiredProperty key="package">
<defaultValue>com.mycompany.portlet</defaultValue>
</requiredProperty>
<requiredProperty key="organization">
<defaultValue>My Company</defaultValue>
</requiredProperty>
<requiredProperty key="fullTextDescription">
<defaultValue>this is my portlet</defaultValue>
</requiredProperty>





</requiredProperties>

<fileSets>
<fileSet filtered="true" packaged="true">
<directory>src/main/java</directory>
</fileSet>
<fileSet filtered="true" packaged="true">
<directory>src/test/java</directory>
</fileSet>
<fileSet filtered="true" packaged="false">
<directory>src/main/webapp</directory>
<excludes>
<exclude>**/*.jsp</exclude>
</excludes>

</fileSet>

<fileSet filtered="false" packaged="false">
<directory>src/main/webapp/</directory>
<includes>
<include>**/*.jsp</include>
</includes>

</fileSet>

<fileSet filtered="true" packaged="false">
<directory>src/main/resources</directory>
</fileSet>
</fileSets>



</archetype-descriptor>
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<packaging>war</packaging>

<name>${fullTextDescription}</name>

<properties>
<spring.version>3.0.7.RELEASE</spring.version>
<logback.version>1.0.6</logback.version>
</properties>

<dependencies>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope>
</dependency>



<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>

<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-bridges</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-taglib</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-java</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>



<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc-portlet</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${spring.version}</version>
</dependency>

<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>





</dependencies>


<build>
<plugins>
<plugin>
<groupId>com.liferay.maven.plugins</groupId>
<artifactId>liferay-maven-plugin</artifactId>
<version>${liferay.version}</version>
<configuration>
<autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
<appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir>
<appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir>
<appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir>
<liferayVersion>${liferay.version}</liferayVersion>
<pluginType>portlet</pluginType>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>


<organization>
<name>${organization}</name>
</organization>



</project>
Original file line number Diff line number Diff line change
@@ -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;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
javax.portlet.title=${portletName} Title
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">


<context:component-scan
base-package="${package}" />



<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.InternalResourceView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>

<bean
class="org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping" />

<bean
class="org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter" />





</beans>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">



</beans>
Original file line number Diff line number Diff line change
@@ -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" %>
<portlet:defineObjects />
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<%@ page contentType="text/html" isELIgnored="false"%>
<%@ include file="init.jsp"%>


hello from
<c:out value="${portletConfig.getPortletName()}" />
Portlet!
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.1.0//EN" "http://www.liferay.com/dtd/liferay-display_6_1_0.dtd">

<display>
<category name="${organization}">
<portlet id="${portletName}"></portlet>
</category>

</display>

0 comments on commit 46d17a1

Please sign in to comment.