Jasig/uPortal — pull request #230 by apetro (2014-02-20 23:56:55+00:00)
Title: Switch favorites collections to be their own folder type

Whereas previously collections-of-favorites were just plain old `@type='regular'` folders, now they're `@type='favorite_collection'` thereby differentiating them from regular-old-tabs. This allows using traditional layout alongside collections-of-favorites.

# Features:

The favorites portlet now lists applicable collections, with an example such collection ("News") included in this changeset:

![favorites_portlet_showing_news_collection](https://f.cloud.github.com/assets/952283/2225187/cf41eeca-9a88-11e3-99ad-9a73b99db7d8.png)

The structure transform is enhanced to understand how to tee up a single fragment for rendering (fragment-in-focus-mode essentially) so that when a user clicks on the name of such a collection-of-favorites in the Favorites portlet, that collection is rendered:

![rendering_focused_upon_fragment](https://f.cloud.github.com/assets/952283/2225199/2067b776-9a89-11e3-88b7-fee421a0fa37.png)

Existing theme support for rendering tab navigation is re-used (abused?) for rendering focused-upon collection. The logo is enhanced to be a clickable hyperlink that returns the user "home" in the portal, providing a way to escape the focused-upon fragment.

# Implementation / design:

The implementation invents a new supported folder type `favorite_collection` and a new portal-level request parameter `focusedFragmentId` (which when used in a URL is `u_focusedFragmentId` because of how request parameters are namespaced for scoping).

The structure transform previously knew how to render a single portlet in focus mode or the dashboard view with one of the tabs selected. This customization adds a third broad path in the structure transform, that of rendering one fragment "focused".

# Known shortcomings, deferred work, and technical debt:

* Does not detect and handle appropriately the case where one attempts to focus upon a fragment identifier that does not identify a fragment, or that identifies a fragment that is not in the user's layout.
* At least as the admin user, one can un-favorite a collection-of-favorites but that un-favoriting does not persist across logins. This might be an admin user edge case.
* The favorites portlet `view.jsp` uses knowledge of portal URL implementation details (namely, that `u_focusedFragmentId` parameter) to compose the URL users follow when they click the name of a collection-of-favorites, but it should probably be using an API instead and not have that URL composition implementation detail coded into the JSP.
* The structure transform signals too little to the theme about the nature of the invented tab representing the focused-upon fragment in the navigation, whereas that should probably be better flagged so that the theme can better style it. This will be presumably be addressed in a subsequent UI enhancement pass since (also known shortcoming) this just doesn't look like the mockup yet. (e.g., http://navy8o.axshare.com/#p=academics__interim_ ).
* The enhancement to the portal logo to add the link to go to portal "home" is at odds with the change in `master` to make that a simple content portlet rather than a JSP portlet.