Reset Settings Portlet for uPortal 2.4, 2.5

Reset Settings Portlet for uPortal 2.4, 2.5

Reset My Settings

Downloads

You may download the portlet here: reset-layout-portlet.tar.gz

Please see below for configuration instructions.

What?

We needed a way for users to reset their layouts through the portal, as this functionality did not seem to exist for aggregated layouts. We experimented deleting user information exclusively from the database layout tables but that led to a number of problems either with what we were trying to delete or the aggregated layout system marking fragments as excluded that should not have been. User templates were not reliably reproduced that way, either. It quickly became clear we didn't know enough about the aggregated layout implementation to hassle with selectively modifying the databse, so we decided to take an easier route - delete the user's account entirely from the database. Having used this approach in the past, it seemed like a good idea but left orphaned fragments in the database and other information there that was never removed. We ended up writing code to remove a user's account and all data in the database that was associated with their USER_ID. This is by no means an elegant solution to the problem, but it has worked fine for us the 6 months we've been using it.

Implementation at Virginia Tech is slightly different than default. We maintain a settings page which just has a link to the portlet using our navigate.jsp which just displays "Resetting your settings is irreversible. Are you sure you want to reset your My VT settings?" with yes and no links to respectively confirm or cancel a settings reset.

Be aware that this portlet will reset a user's entire portal account, causing them to lose any portlet preferences, bookmarks, etc... We should and will eventually modify all references to call the tool "reset settings" instead of "reset layout".

Also note: this portlet is intended to delete a user's account and log them out. Their account must be recreated by the portal when the log in. It is standard behavior, but I think it's possible that someone may have disabled this for some reason.

How?

Installation

Installation couldn't be easier! Download the portlet and un-tar the archive. You should get a reset-layout directory. If you want to use the default settings, there are only 2 pieces of information the build script needs:

  • server.home - the root tomcat directory... I believe this needs to be set for uPortal already. Maybe this should have been named differently

  • uportal.home - the uPortal SOURCE root directory (e.g. where we can run ant deployPortletApp)

NOTE: The build script will try to get these properties from $USER_HOME/build.properties first, and secondly from the environment variables $TOMCAT_HOME and $UPORTAL_HOME, respectively. It goes without saying, but: if it cannot get the correct settings somewhere, it won't work.

After setting up server.home and uportal.home, from the reset-layout directory, run:

ant uportal-install

After this, you should have a working portlet or at least something close to working.

If you need to change publish or deploy time settings

The uportal-install target will deploy the portlet with the default settings. The channel will be published available to everyone, selectable from the Development category with the name Reset My Settings. If you would like to change the publishing parameters you may publish it by a different means or simply edit the publish file at: reset-layout/WEB-INF/data/publish.xml.

You can run ant uportal-publish or ant uportal-deploy to publish or deploy your portlet, respectively.

Configure the portlet

By default, the portlet looks for your portal's rdbm.properties file to determine your database settings. If, for some reason you haven't configured that file, you will need to do so - or at least make a new file with the same settings that a uPortal rdbm.properties file would have. The portlet is configured for use under Tomcat with a default uPortal setup - it looks for ../uPortal/WEB-INF/classes/properties/rdbm.properties to get your DB settings. You may specify a different path to find the file if you wish. If your uPortal instance is deployed to a different context, for example, you will need to change this path to reflect that. If you are using JBoss, I would suggest including the rdbm.properties within the reset-layout file structure.

Applicable Configuration Parameters
<!-- Relative path or absolute URL where to find the XSLT file for this portlet. --> <init-param> <name>xsltURL</name> <value>WEB-INF/data/default.xsl</value> </init-param> <!-- Path to a uPortal properties file with database settings --> <init-param> <name>uPortalRDBMPropertiesFile</name> <value>../uPortal/WEB-INF/classes/properties/rdbm.properties</value> </init-param> <!-- Where the user should be sent to log out --> <init-param> <name>redirectURL</name> <value>Logout</value> </init-param> <!-- Determines whether or not the portlet displays an initial screen with --> <!-- a link to confirm the reset or just the confirmation screen --> <init-param> <name>confirmResetOnly</name> <value>false</value> </init-param>

User Interface

The interface is generated through XSLT. The file may be found at reset-layout/WEB-INF/data/default.xsl. It's not the most complicated thing. You are welcome to change it, but you should make sure the conditional checks remain in place to determine the portlet's mode.

XSLT conditional checks
... <xsl:choose> <xsl:when test="attributes/attribute[@name = 'reset-url']"> <!-- Give link to go to confirmation screen --> </xsl:when> <xsl:when test="attributes/attribute[@name = 'confirm-reset-layout-url']"> <!-- Give confirmation action or cancel action --> </xsl:when> <xsl:otherwise> <!-- Redirect to logout URL --> </xsl:otherwise> </xsl:choose> ...

That's about it...