Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
[maven-release-plugin] copy for tag FunctionalTestsPortlet-1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
edalquist committed Jun 16, 2008
1 parent 00254cd commit e0aeb01
Show file tree
Hide file tree
Showing 4 changed files with 142 additions and 32 deletions.
98 changes: 69 additions & 29 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">

<parent>
<groupId>org.jasig</groupId>
Expand All @@ -13,13 +10,13 @@
<groupId>org.jasig.portlet</groupId>
<artifactId>FunctionalTestsPortlet</artifactId>
<packaging>war</packaging>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.1</version>

<name>Test Portlets</name>
<description>Portlets used for testing JSR-168 functionality.</description>

<properties>
<issues.projectKey></issues.projectKey>
<issues.projectKey />
<scm.path>/portlets</scm.path>
</properties>

Expand Down Expand Up @@ -234,28 +231,71 @@
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<injectString>&lt;!-- [INSERT JSPC FRAGMENT HERE] --&gt;</injectString>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>${basedir}/target/jspweb.xml</webXml>
</configuration>
</plugin>
</plugins>
</build>
</project>

<profiles>
<profile>
<id>jspc55</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jspc-maven-plugin</artifactId>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<injectString>&lt;!-- [INSERT JSPC FRAGMENT HERE] --&gt;</injectString>
</configuration>
<dependencies>
<!-- These dependencies are the portlet.tld is needed for JSP compilation
<dependency>
<groupId>org.apache.pluto</groupId>
<artifactId>pluto-taglib</artifactId>
<version>1.1.3</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>1.0</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.1.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<type>jar</type>
</dependency>-->
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>${basedir}/target/jspweb.xml</webXml>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<scm>
<connection>scm:svn:https://www.ja-sig.org/svn/portlets/FunctionalTestsPortlet/tags/FunctionalTestsPortlet-1.0.1</connection>
<developerConnection>scm:svn:https://www.ja-sig.org/svn/portlets/FunctionalTestsPortlet/tags/FunctionalTestsPortlet-1.0.1</developerConnection>
<url>http://developer.ja-sig.org/source/browse/jasigsvn/portlets/FunctionalTestsPortlet/tags/FunctionalTestsPortlet-1.0.1</url>
</scm>
</project>
41 changes: 41 additions & 0 deletions src/main/java/org/jasig/portlet/test/mvc/tests/LocaleTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* Copyright 2007 The JA-SIG Collaborative. All rights reserved.
* See license distributed with this file and
* available online at http://www.uportal.org/license.html
*/
package org.jasig.portlet.test.mvc.tests;

import java.util.Enumeration;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

import org.apache.commons.collections15.EnumerationUtils;
import org.springframework.web.portlet.ModelAndView;
import org.springframework.web.portlet.mvc.AbstractController;

/**
* @author Eric Dalquist
* @version $Revision$
*/
public class LocaleTest extends AbstractController {
/* (non-Javadoc)
* @see org.springframework.web.portlet.mvc.AbstractController#handleRenderRequestInternal(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
*/
@Override
protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception {
final Locale preferedRequestLocale = request.getLocale();
final Enumeration<Locale> requestLocales = request.getLocales();
final Locale responseLocale = response.getLocale();

final Map<String, Object> model = new HashMap<String, Object>();
model.put("preferedRequestLocale", preferedRequestLocale);
model.put("requestLocales", EnumerationUtils.toList(requestLocales));
model.put("responseLocale", responseLocale);

return new ModelAndView("localeTest", model);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<property name="roles">
<map>
<entry key="Everyone" value="local.0" />
<entry key="Admin" value="local.14" />
<entry key="Developer" value="local.4" />
<entry key="Guest" value="local.15" />
<entry key="Portal Administrators" value="local.2" />
<entry key="Developers" value="local.20" />
<entry key="Guests" value="local.27" />
<entry key="UnDefinedInPortal" value="local.UnDefinedInPortal" />
<entry key="UnDefinedInDescriptor" value="local.UnDefinedInDescriptor" />
</map>
Expand All @@ -31,6 +31,9 @@
<entry key="Portlet Preferences Test">
<bean class="org.jasig.portlet.test.mvc.tests.PortletPrefrencesTest" />
</entry>
<entry key="Locale Test">
<bean class="org.jasig.portlet.test.mvc.tests.LocaleTest" />
</entry>
</map>
</property>
</bean>
Expand Down
26 changes: 26 additions & 0 deletions src/main/webapp/WEB-INF/jsp/localeTest.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<%@ include file="/WEB-INF/jsp/include.jsp" %>

<%@ include file="/WEB-INF/jsp/testSelectorHeader.jsp" %>

<table>
<tbody>
<tr>
<td align="right">Prefered Request Locale: </td>
<td>${preferedRequestLocale}</td>
</tr>
<tr>
<td align="right">Request Locales: </td>
<td>
<ol>
<c:forEach var="requestLocale" items="${requestLocales}">
<li>${requestLocale}</li>
</c:forEach>
</ol>
</td>
</tr>
<tr>
<td align="right">Response Locale: </td>
<td>${responseLocale}</td>
</tr>
</tbody>
</table>

0 comments on commit e0aeb01

Please sign in to comment.