Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 44 Next »

MailPortlet v2.0.0-alpha-1 User Manual

Foreword

Matt Young and Ren Provey of the Internet Frameworks Services division of Duke University's Office Of Information Technology (OIT) created the original version of this portlet in 2007 and it was contributed by Duke University to the JA-SIG community in early 2008. Since then Jen Bourey (of Yale University), Eric Dalquist (of University of Wisconsin-Madison), Erik A. Olsson (of University of California, Irvine), and Gary Weaver (of Duke University) have made contributions. Mail Portlet was free under the BSD License upon original contribution and since then has converted to an Apache 2.0 license per Jasig. The MailPortlet is a collaborative open-source project whose source control, wiki, and project tracking is hosted by Jasig.

Feedback

If you'd like to ask questions and/or provide feedback on usage and configuration, please contact use via the portlet-user list. Requests for enhancements and discussion of its development can be made via the portlet-dev list and/or via the MPT Jasig-hosted Jira project. Please request support via email on the portlet-user list if it is a matter of just getting it setup/working properly.

Disclaimer

The Mail portlet is capable of fetching email headers from any IMAP server or POP server, although this version of the portlet has unacceptably slow POP mail retreival. This portlet is not intended to be a rich email client, rather a dashboard with a quick view of some of the most recent email headers received.

Prerequisites

Before you begin, you should know how to deploy portlets into your portal environment. It is currently running at a few universities using various versions of uPortal (2.5.3 and later). If you discover a shortcoming in our code that we can correct to make the portlet more JSR-168 compliant, please let us know, but note that there has already been some discussion about FSS, PLT.C (CSS) compliance and JSR-168's poor PLT.C definition, so search Nabble first through the jasig-ui, portlet-dev, uportal-user lists for terms like "PLT-C", "PLT.C", "FSS", "MailPortlet".

Roadmap

There is no certain roadmap to the MailPortlet's future, but after Duke finished up with the pre-release version(s) in Fall 2009, Yale (Jen Bourey) will likely become actively involved in its further development. Not aware of the features/functionality to be added other than they might bear some similarity to Calendar and News portlets per discussion.

Procurement

The latest pre-release version that is almost sure to be changed much more before final release is:

svn co https://www.ja-sig.org/svn/sandbox/MailPortlet/tags/rel-2.0.0-alpha-1

To get the latest dev version of the source (which may not build and may be buggy and/or unstable):

svn co https://www.ja-sig.org/svn/sandbox/MailPortlet/trunk

Building

To develop/build the portlet, you will need to have Subversion, Maven 2, and a Java 1.5+ compiler installed.

Use the following to build the portlet:

mvn clean install

Deploying

Your built portlet is in the target directory that you can then deploy via uPortal with deployPortletApp or whatever the approved method for "plutofication" and deployment is for your version of uPortal. Note that it won't work until you at the very least specify a key for the password encryption in its Spring config. Keep reading...

Configuration/Customization

This portlet has Spring and properties-based configuration, so you should be able to change all relevant parameters in XML and properties files rather than changing the source code.

To get up and running with MailPortlet, you only need to do the first two steps to configure it to use a real database and to set it to use your password encryption key. If you don't want to mess with persisting accounts yet, you can even skip the database config part and it will use an in-memory database (for example, if you just want to demo it).

For each of the configuration steps below, you'll either need to restart your webapp server after your changes or in the case of an overlaid portlet, you can often just redeploy the portlet without a webapp server restart.

Configuring the Database

By default, MailPortlet just stores users' preferences in-memory, for testing and demonstration purposes. Since some users don't want portlets creating tables on their own, this works great for testing and demo'ing quickly in those environments.

However, you'll want to persist user account information in production. To set it up, you'll need the JDBC connection string, username, and password from the database administrator and you'll need to set hibernate.dialect to an appropriate value. In the deployed portlet edit WEB-INF/classes/datasource.properties.

Some examples:

## Oracle 10g - example
#hibernate.connection.driver_class=oracle.jdbc.OracleDriver
#hibernate.connection.url=jdbc:oracle:thin:@exampleuniversity.edu:1521:SIDGOESHERE
#hibernate.connection.username=test
#hibernate.connection.password=mypass
#hibernate.dialect=org.hibernate.dialect.Oracle10gDialect

# MySQL - example
#hibernate.dialect org.hibernate.dialect.MySQLDialect
#hibernate.connection.driver_class=com.mysql.jdbc.Driver
#hibernate.connection.url=jdbc:mysql:///test
#hibernate.connection.username=test
#hibernate.connection.password=mypass

## PostgreSQL - example
#hibernate.connection.driver_class=org.postgresql.Driver
#hibernate.connection.url=jdbc:postgresql://exampleuniversity.edu/portal
#hibernate.connection.username=test
#hibernate.connection.password=mypass
#hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect

## Sybase - example
#hibernate.connection.driver_class=com.sybase.jdbc2.jdbc.SybDriver
#hibernate.connection.username=test
#hibernate.connection.password=mypass
#hibernate.connection.url=jdbc:sybase:Tds:exampleuniversity.edu:3456?ServiceName=STUFF
#hibernate.dialect org.hibernate.dialect.SybaseDialect

## DB2 - example
#hibernate.dialect=org.hibernate.dialect.DB2Dialect
#hibernate.connection.driver_class=com.ibm.db2.jdbc.app.DB2Driver
#hibernate.connection.url=jdbc:db2:test
#hibernate.connection.username=test
#hibernate.connection.password=mypass

For a full list of supported dialects, see the Hibernate 3.2.6 docs. For example JDBC strings see Chui's counterpoint. For other examples, see this example in Bedework.

Specifying Custom Mail Account Templates

Customize the mail account templates in WEB-INF/context/portlet/mailservers.xml. The following are the defaults with some commented examples of further customization and customization of JavaMail properties:

<?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"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
            http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

    <bean name="mailAccountTemplateManager" class="org.jasig.portlet.mail.MailAccountTemplateManager">
        <property name="templates">
            <list>
                <!-- Order here doesn't matter, as order is dictated by ordinal set in each bean. -->
                <!-- Anything you add below must be added here. -->
                <ref bean="custom"/>
                <ref bean="aol"/>
                <ref bean="gmail"/>
                <ref bean="dotMac"/>
                <ref bean="mobileMe"/>
                <!-- examples:
                <ref bean="myInstitutionalMailServer"/>
                <ref bean="anotherInstitutionalMailServer"/>
                <ref bean="demo"/>
                -->
            </list>
        </property>
    </bean>

    <!-- Change the values of this bean to reflect the situation at your institution -->

    <!-- Note: name is the formal name of the account that will be listed. displayName is the default tabname. -->

    <!-- default custom to imaps, to hopefully influence user to choose an imaps server if available over imap, pops, pop -->
    <bean name="custom" parent="imaps">
        <property name="name" value="Email account"/>
        <property name="displayName" value="Custom"/>
        <property name="ordinal" value="99999"/>
        <property name="custom" value="true"/>
    </bean>
    <!-- remember to make sure your server bean name is listed in the mailAccountTemplateManager above -->

    <bean name="aol" parent="imaps">
        <property name="host" value="imap.aol.com"/>
        <property name="link" value="http://webmail.aol.com"/>
        <property name="name" value="AOL"/>
        <property name="displayName" value="AOL"/>
        <property name="ordinal" value="30"/>
    </bean>
    <!-- remember to make sure your server bean name is listed in the mailAccountTemplateManager above -->

    <bean name="gmail" parent="imaps">
        <property name="host" value="imap.gmail.com"/>
        <property name="link" value="http://mail.google.com"/>
        <property name="name" value="Gmail"/>
        <property name="displayName" value="Gmail"/>
        <property name="ordinal" value="40"/>
    </bean>
    <!-- remember to make sure your server bean name is listed in the mailAccountTemplateManager above -->

    <bean name="dotMac" parent="imaps">
        <property name="host" value="mail.mac.com"/>
        <property name="link" value="http://www.mac.com"/>
        <property name="name" value=".Mac"/>
        <property name="displayName" value=".Mac"/>
        <property name="ordinal" value="50"/>
    </bean>
    <!-- remember to make sure your server bean name is listed in the mailAccountTemplateManager above -->

    <bean name="mobileMe" parent="imaps">
        <property name="host" value="mail.me.com"/>
        <property name="link" value="http://www.me.com"/>
        <property name="name" value="MobileMe"/>
        <property name="displayName" value="MobileMe"/>
        <property name="ordinal" value="60"/>
    </bean>
    <!-- remember to make sure your server bean name is listed in the mailAccountTemplateManager above -->

    <!-- Examples: -->

    <!-- Example of a mail tab that gets username from REMOTE_USER and password from a userinfo attribute you would
         define in mailsecurity.xml. This mail tab would show up by default but can be removed or added by the user.
         To make it such that the user could not remove it, we'd change fixed to true. -->
    <!--
    <bean name="myInstitutionalMailServer" parent="imap">
        <property name="host" value="imap.exampleuniversity.edu"/>
        <property name="link" value="https://webmail.exampleuniversity.edu"/>
        <property name="name" value="EU Mail"/>
        <property name="displayName" value="EU"/>
        <property name="ordinal" value="10"/>
        <property name="credentialsService" value="userInfoCredentialsService"/>
        <property name="includeInDefault" value="true"/>
        <property name="fixed" value="false"/>
    </bean>
    -->

    <!-- Example of a mail tab for a server that defines some extra javamail properties and requires the student to be
         in a PAGS group with the PAGS group key "sample". Note that in order to have a PAGS group work, it must be also
         declared in the portlet.xml in the portlet.xml's portlet element like:

         <security-role-ref>
            <role-link>pags.Law</role-link>
         </security-role-ref>

         The user must enter their own username and password since it inherits the .
         This mail tab would not show up by default but is user addable.

         This example also shows how custom JavaMail properties can be defined. Note that JavaMail properties that are
         defined here will override the ones set by setting host and port, for example (so if set in both places, the
         JavaMail properties trump the others).
         -->
    <!--
    <bean name="anotherInstitutionalMailServer" parent="imaps">
        <property name="host" value="imap.law.exampleuniversity.edu"/>
        <property name="port" value="888"/>
        <property name="javaMailProperties">
            <props merge="true">
                <prop key="mail.imap.fetchsize">16384</prop>
                <prop key="mail.imap.allowreadonlyselect">true</prop>
            </props>
        </property>
        <property name="link" value="https://webmail.law.exampleuniversity.edu"/>
        <property name="name" value="Law School Mail"/>
        <property name="displayName" value="Law"/>
        <property name="memberOfAny">
            <list>
                <value>pags.Law</value>
            </list>
        </property>
        <property name="ordinal" value="20"/>
        <property name="includeInDefault" value="false"/>
        <property name="fixed" value="false"/>
    </bean>
    -->

    <!-- Example of a configured test account for test/demonstration purposes. This could also be used to allow everyone
         or certain PAGS group(s) access to a shared account, in theory, not that we're suggesting that. The password
         should be encrypted, so a way to do this is to create the account manually using the portlet and then
         copy that password from the database into the credentials below. At one point I tried offering plain text
         credentials as an option for testing, but there is too much danger of exposing credentials as those are
         persisted also. -->
    <!--
    <bean name="demo" parent="imaps">
        <property name="host" value="imap.gmail.com"/>
        <property name="link" value="http://mail.google.com"/>
        <property name="name" value="Demo"/>
        <property name="displayName" value="Demo"/>
        <property name="ordinal" value="40"/>
        <property name="includeInDefault" value="true"/>
        <property name="credentials" ref="demoCredentials"/>
        <property name="custom" value="true"/>
    </bean>

    <bean name="demoCredentials" class="org.jasig.portlet.mail.model.impl.MailCredentialsImpl">
        <property name="username" value="test"/>
        <property name="password" value="test"/>
    </bean>
    -->

</beans>

Encrypting User Mail Account Passwords

If you let your users add their own mail accounts then it is likely that they will be storing passwords as well. This means you should really have some level of security on the passwords that are stored. Hopefully you also have your server environment and database locked down among other things, and this is just a little icing on the cake.

If right now you are scared, don't be. With the default configuration of MailPortlet, the following change to set the AES encryption key is the only change you should have to make to the configuration to get it up and running and letting your users connect to their Gmail, AOL, ISP, etc. accounts, although you may want to customize it more, which is why there are other steps below.

Here is an example of a 40-byte hex key that someone might put into WEB-INF/context/portlet/mailsecurity.xml for 128-bit AES encryption, but USE YOUR OWN KEY - do NOT use the 1f1f1f... provided here. If you use 1f1f1f... then you may as well not have encrypted the passwords at all:

...

    <bean name="encryptionTool" class="org.jasig.portlet.mail.encryption.impl.AesEncryptionToolImpl">
        <!-- REPLACE THIS KEY WITH A KEY YOU MAKE UP IN HEX THAT IS THE SAME LENGTH. THIS LENGTH OF KEY IS ONLY ALLOWED IN THE U.S. -->
        <property name="key" value="1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f"/>
    </bean>
...
</beans>

Here is an example of a 16-byte hex key that someone might put into WEB-INF/context/portlet/mailsecurity.xml for 64-bit AES encryption. Again, USE YOUR OWN KEY - do NOT use the 1f1f1f... provided here. If you use 1f1f1f... then you may as well not have encrypted the passwords at all:

...

    <bean name="encryptionTool" class="org.jasig.portlet.mail.encryption.impl.AesEncryptionToolImpl">
        <!-- REPLACE THIS KEY WITH A KEY YOU MAKE UP IN HEX THAT IS THE SAME LENGTH. THIS LENGTH OF KEY IS FOR LOCATIONS OUTSIDE OF THE U.S. -->
        <property name="key" value="1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f"/>
    </bean>
...
</beans>

For those interested, it might also be a good idea to load key/iv for password encryption from one or more files separate from the spring config (that way the portal admin wouldn't necessarily have the key to decrypt passwords if you wanted to set it up that way), but I assume that if someone really wanted to do that they could figure it out on their own. I think you'd involve org.springframework.core.io.FileSystemResource in a bean somewhere, but I'm having trouble finding a good example. If you find one, please add it here (without any confidential info, please).

Using CAS for Mail Server Authentication

Yale University contributed classes and configuration to support CAS. To enable CAS support, modify the spring config files in the exploded war file or file the overlay technique described in this document, specifically (generically) take a look at files in either WEB-INF/context/.xml or WEB-INF/context/portlet/.xml as well as WEB-INF/web.xml.

You will see various sections in those configuration files commented out relating to CAS that you must uncomment and configure for CAS support in your environment.

Note that version 2.0.0-alpha-1 has not been tested with CAS authentication, so it likely needs additional work.

Using UserInfo for Mail Server Authentication

In WEB-INF/context/portlet/mailsecurity.xml be sure that the userInfoCredentialsService is setup (it should be by default):

...
    <bean name="credentialsServiceManager" class="org.jasig.portlet.mail.CredentialsServiceManager">
        <property name="services">
            <map>
                ...
                <entry key="userInfoCredentialsService" value-ref="userInfoCredentialsService"/>
                ...
            </map>
        </property>
    </bean>
    ...
    <bean name="userInfoCredentialsService" class="org.jasig.portlet.mail.service.impl.UserInfoCredentialsService">
        <!-- if you want to get the password from userinfo, change exampleProxyTicket to the name of the attribute
             in userinfo that contains the password -->
        <property name="userInfoPasswordAttributeName" value="exampleProxyTicket"/>
    </bean>
    ...

Be sure that "exampleProxyTicket" is replaced with the UserInfo key that holds the MailServer password. Note that it currently gets the username by calling getRemoteUser() on the PortletRequest. If you would like the UserInfoCredentialsService to get the username from somewhere else, contact us (see the Feedback section).

We suggest that this attribute contain a password that a token that can only be used for the current login session. Passing in a plain-text password via UserInfo is probably not a good idea (for example- what if there were something outputting UserInfo to the screen for debugging purposes in another portlet- then the mailpassword would show up on the screen).

CSS

Starting with MailPortlet v2.0.0-alpha-1, we're trying our best to use some sort of uPortal standard styling that would be most compatible with existing and custom skins.

Note that later versions of uPortal (not sure which ones yet) may possibly change fl-activeTab to a newer class name since that one was changed in 1.0 (or earlier) of Fluid Infusion (or prior). So, if you find that the active tab is not being highlighted properly, then check to make sure that fl-activeTab is defined.

uPortal v2.5.x-v3.0.x

The MailPortlet UI depends on FSS classes (Fluid Skinning System CSS) introduced in uPortal 3.1.x. While we don't expect that you implement all of the FSS and related skin classes as defined in uPortal 3.1.x, in order for the tabs to look like tabs, you'll need to add the following to each of your skins if these classes are not already implemented. Please forgive the redefines here (copied the FSS and FSS uPortal 3.1 skin redefines).

/* The following is basically copied from uPortal 3.1.1's css with exception of removal of the skin class from the lower-half. Please modify to suit your skins */

.fl-container-flex {width: 100%; clear:both;}

/*
 * Tabs: a quick tab system
 * Dependency: list-based markup ?
 */
.fl-tabs {margin:0.75em 0 0 0; border-bottom:1px solid #000; text-align:center; padding-bottom:0.2em;}
.fl-tabs li {list-style-type:none; display:inline;}
.fl-tabs li a {padding:0.25em 1.25em; background-color:#fff; margin-left:-5px; *margin-bottom:-8px; zoom:1; border:1px solid #000; border-bottom:1px solid #fff;}
.fl-tabs li a:hover {}
.fl-tabs .orderable-drop-marker {padding:0 3px; background-color:#c00;margin:0 5px 0 -5px; zoom:1;}

.fl-tabs .fl-activeTab {}

.fl-tabs-center {text-align:center;}
.fl-tabs-left {text-align:left; padding-left:10px;}
.fl-tabs-right {text-align:right; padding-right:15px;}

/* Helper: Tabs */
.fl-tabs {border-bottom-color:#4070a1;}
.fl-tabs li {background-color:#dfefff;}
.fl-tabs li,
.fl-tabs li a {font-weight:bold; color:#4070a1; border-color:#4070a1; text-decoration:none;}
.fl-tabs li:hover,
.fl-tabs li:hover a,
.fl-tabs li a:hover {background-color:#5a95cf; color:#fff;}
.fl-tabs li.fl-activeTab,
.fl-tabs li.fl-activeTab:hover,
.fl-tabs li.fl-activeTab a,
.fl-tabs li.fl-activeTab a:hover {background-color: #fff; border-bottom-color:#fff; color:#508cc9;}
.fl-tab-content {background-color:#ffffff; color:#000;}

In addition, if you don't have the following JSR-168 PLT.C classes defined (the "portlet-*" classes), you might want to define them to suit your skin's needs. In older versions of uPortal these classes were defined per portlet in the skin, like cartoon_portlet.css in uPortal 2.5.3.1. In comparison, the default skin has a dedicated CSS file in the skin jsr168_portlet_spec.css in uPortal 3.1.1. Here are the portlet-* CSS classes it uses as of 2.0-alpha-1:

  • portlet-msg-info
  • portlet-msg-error
  • portlet-form-button
  • portlet-section-header
  • portlet-section-subheader
  • portlet-form-field-label

Internationalization/Internationalisation/I18n/Localization/Localisation/L10n/Message Customization

The messages properties files are located in WEB-INF/classes/org/jasig/portlet/mail/i18n/.

For example, in WEB-INF/classes/org/jasig/portlet/mail/i18n/MailPortlet_en_US.properties there is:

# MailPortlet messages

# All entries for CredentialsServiceManager in WEB-INF/context/portlet/mailsecurity.xml should have corresponding
# (keyname).description defined.
encryptedCredentialsService.description=Password encrypted and username/password stored in database
userInfoCredentialsService.description=Use logged-in user's username/password
casProxyCredentialsService.description=Use username/password from CAS

# This is the date format used for messages sent today's date and sent prior to today's date
# see: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html#dt
dateFormatSentToday=%tl:%tM %tp
dateFormatNotSentToday=%tD %tl:%tM %tp

# Miscellaneous
account=Account
add=Add
addAccount=Add Account
addModifyAccounts=Add/Modify Accounts
addOrModifyAccounts=Add/Modify Accounts
cancel=Cancel
cannotAddFixedMailAccount=You cannot add this type of account.
cannotDeleteFixedMailAccount=You cannot delete this type of account.
cannotEditFixedMailAccount=You cannot edit this type of account.
configuration=Configuration
createAccount=Create Account
delete=Remove
deleteAccount=Remove Account
deleteAccountConfirm=This will remove this mail account from your mail portlet preferences. Are you sure?
delim=&nbsp;&gt;&nbsp;
displayName=Name of Account
edit=Edit
editHelp=Notes: For some types of accounts, the username may need to be the full email address. The Name of Account is the text that will show up in the tab (the tab's name).
editThisAccount=Edit this account
host=Host
link=Webmail URL
mail=Mail
moreActions=More Actions
myAccounts=My Accounts
noAccountsFound=No accounts found.
noDate=(No Date)
noEditOrDelete=(May Not Edit/Remove)
noMailAccount=No Mail Account
noSender=(No Sender)
noSubject=(No Subject)
password=Password
port=Port
protocol=Protocol
refreshAccount=Refresh Account
resetPreferences=Reset Preferences
resetPreferencesConfirm=This will reset your mail portlet preferences to the defaults, removing any accounts you have created or changes you have made. Are you sure?
returnToMailView=Return to Mail
save=Save
updateAccount=Update Account
username=Username

# Errors
authenticationFailedException=Failed to authenticate to mail server. Please ensure your account information is correct.
folderClosedException=The mail folder was closed while attempting to get mail. Please try again later.
folderNotFoundException=The specified mail folder was not found. Please ensure your account information is correct.
messageRemovedException=The message we were attempting to read was removed. Please try a refresh or try again later.
noSuchProviderException=The configured protocol is not supported by this portlet.
problemRetrievingMail=Problem retrieving mail.
storeClosedException=The mail store was closed while attempting to get mail. Please try again later or ensure your account information is correct.
messagingException=There was a problem retrieving mail from the server. Please try again later and ensure your account information is correct.
unknownErrorGettingMail=There was an unexpected error while attempting to retrieve mail from the server. Please try again later and ensure your account information is correct.
unknownMailCredentialsService=Unknown Mail Credentials Service

# Protocols. The keys should correspond to JavaMail providers (javamail.providers). See:
# http://java.sun.com/products/javamail/FAQ.html
imaps=Secure IMAP (Using SSL)
imap=IMAP
pop3s=Secure POP (Using SSL)
pop3=POP

Please see the corresponding properties file in the tag of the release you are using for additional detail, as more may be added or keys could change during further development.

Advanced Configuration

Restrict/Add JavaMail Providers

To restrict or add custom JavaMail providers/protocoles, edit WEB-INF/context/portlet/mailmvc.xml and modify the availableProtocols property of mailService, and restart the portal:

...
    <bean name="mailService" class="org.jasig.portlet.mail.service.impl.MailServiceImpl">
        ...
        <property name="availableProtocols">
            <list>
                <!-- Be sure to include i18n messages for each of these, and this indicates the display order of
                     options as display in the custom create/update view for a mail account. -->
                <value>imaps</value>
                <value>imap</value>
                <!-- Commenting these out because if the user has a ton of email it ties things up -->
                <!--
                <value>pop3s</value>
                <value>pop3</value>
                -->
            </list>
        </property>
    </bean>
    ...

If you add new providers (protocols), you need to add them to your i18n messages file for your locale, for example: WEB-INF/classes/org/jasig/portlet/mail/i18n/MailPortlet_en_US.properties. Here are the labels for the ones provided by default:

...
# Protocols
imaps=Secure IMAP (Using SSL)
imap=IMAP
pop3s=Secure POP (Using SSL)
pop3=POP
...

How to Create a Local Maven 2 Overlay Project

Checkout the MailPortlet project and build it per the instructions above. Specifically, install it locally with:

mvn clean install

Create the following file at the root of some new project directory you create. Note that this is only an example and you should tailor the groupId and artifactId up top and the finalName to meet the needs of your environment. Please change the versions to match the version of the Jasig MailPortlet as defined in that version's pom.xml (so, for example, you should change the version on the the MailPortlet dependency war to 2.0-alpha-1 for that tag or 2.0-SNAPSHOT for trunk).

<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>

    <groupId>edu.example.university</groupId>
    <artifactId>mail</artifactId>
    <packaging>war</packaging>

    <name>Mail</name>
    <version>yourversionnumbergoeshere</version>

    <dependencies>
      <dependency>
        <groupId>org.jasig.portlet</groupId>
        <artifactId>MailPortlet</artifactId>
        <type>war</type>
        <version>2.0.0-alpha-1</version>
      </dependency>
    </dependencies>

    <build>
        <finalName>mailportlet</finalName>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.0</version>
          </plugin>
        </plugins>
    </build>
</project>

Create the following directory structure:

mkdir -P src/main/resources/
mkdir -P src/main/webapp/WEB-INF/context/portlet
mkdir -P src/test

Put the custom datasource.properties and log4j.properties files that you want to use into:

src/main/webapp/WEB-INF/context/portlet

Put the Spring config files (mailsecurity.xml and mailservers.xml usually) that you want to use into:

src/main/webapp/WEB-INF/context/portlet

Build your project:

mvn clean install

A word of warning to those developing the MailPortlet itself: If you automate the build of the MailPortlet as part of your build, and it fails, your overlay build may use an older version of the portlet.

Your built portlet is in the target directory that you can then deploy via uPortal with deployPortletApp or whatever the approved method for "plutofication" and deployment is for your version of uPortal.

  • No labels