History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: UP-2083
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andrew Wills
Reporter: Matt Peterson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
uPortal

crn-export of type user-prefs fails

Created: 12/Jun/08 07:16 PM   Updated: 15/Sep/08 06:47 PM
Component/s: Import / Export
Affects Version/s: 3.0.0
Fix Version/s: 3.0.1, 3.1.0-M1

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File export-preferences.crn.patch (17 kb)
2. Java Source File PortletEntityPreferenceHandler.java (7 kb)



 Description  « Hide
When running the ant target crn-export on the entity type of preferences, the target fails due to the getEntityPreferences() method of org.jasig.portal.io.support.PortletEntityPreferenceHandler requiring an Integer as its argument while the crn script (uportal-impl/src/main/resources/org/jasig/portal/io/export-preferences.crn) calls it with a BigDecimal.

As we use Oracle 10g as our DB, this hasn't been tested on other DB platforms.

 All   Comments   Work Log   Change History      Sort Order:
Matt Peterson [12/Jun/08 07:18 PM]
I implemented our local fix by changing the getEntityPreferences() method to use a Number as its argument and not a specific type of number such as Integer:

public Set<IPortletEntity> getEntityPreferences(Number userIdArg) {
Integer userId = new Integer(userIdArg.intValue()); //Argument might be any number type, but we need to deal with an Integer
final Set<IPortletEntity> portletEntities = this.portletEntityRegistry.getPortletEntitiesForUser(userId);

for (final Iterator<IPortletEntity> entityItr = portletEntities.iterator(); entityItr.hasNext(); ) {
final IPortletEntity portletEntity = entityItr.next();
final IPortletPreferences portletPreferences = portletEntity.getPortletPreferences();
final List<IPortletPreference> preferencesList = portletPreferences.getPortletPreferences();

//Only bother with entities that have preferences
if (preferencesList.size() <= 0) { entityItr.remove(); }
}

return portletEntities;
}


Matt Peterson [12/Jun/08 07:40 PM]
PortletEntityPreferenceHandler.java with our local fix applied.

Andrew Wills [12/Jun/08 08:09 PM]
Here is a patch for this issue that was developed by Tuyhang Ly, Eric Dalquist, and myself. It also refactors, simplifies, and slims down the crn XML a good bit.

Andrew Wills [13/Jun/08 01:27 PM]
export-preferences.crn patch applied.

Eric Dalquist [15/Sep/08 06:47 PM]
Closing issues that have been released