Okay, pull request updated to address fragments-to-be-focused using the
folder-name portion of the portal URL.
https://github.com/Jasig/uPortal/pull/230
where the folder-name names a regular-type folder, traditional handling.
where the folder-name names a not-regular-type folder, renders just that
one fragment as if it were the only (regular) tab in the layout.
The regular-tab-ordinal-index-computing stuff (in the structure
transform e.g.) turns out to be a red herring and ignorable. When
focusing on a non-regular-type folder it fails to compute an index and
defaults to 1, but that index can then be just ignored and I can go back
to using the node ID directly, and do.
For some reason I had a very difficult time getting to this working
code, but now that I'm here it's pretty straightforward. The
interesting part is in the structure transform where it essentially
learns a new trick, a third path besides 1) rendering the regular whole
layout dashboardy and 2) rendering just one portlet "in focus mode" : 3)
rendering a fragment "in focus mode". It just goes ahead and re-writes
the type of the focused-upon fragment to be regular, so as to take
advantage of existing theme transform rendering support.
While this solution is developed for the purpose of the Favorites
portlet being able to present useful links to favorited collections, the
solution is more general in that you can now focus upon any
(in-the-layout, not @hidden, not @type=regular) fragment. At the least,
this is useful for troubleshooting other non-regular-type fragments,
i.e., regions.
So, Favorites. Coming along, bit by bit.
Andrew
On 2/21/14, 12:42 PM, Andrew Petro wrote:
I think I have this figured out. Mentioning this in case anyone was
about to invest a bunch of effort into digging into this, so I can
save you the trouble, but I still appreciate the thought. :)
I'll have an update to the pull request and a more substantive reply
to this email in a bit.
Andrew
On 2/21/14, 5:47 AM, Andrew Petro wrote:
Anyone else implemented rendering a *fragment* "in focus mode"? Or
want to look at my implementation and show me how to make it less
painful? :)
# Background:
Favorites introduces a concept of layout folders of
@type="favorite_collection" rather than the @type="regular" that
marks plain-old-normal-layout-tabs. Such layout folders are real DLM
managed fragments, are "in the layout" of the users to whom they
apply (for whom they are activated when the relevant DLM audience
evaluator matches). But because their @type is goofy, they're not
rendered as regular-old-tabs and normally users don't see them.
Users are intended to access them via the new Favorites portlet and
to select new curated such collections for favoriting via the new
Marketplace portlet in an experience that will probably be analogous
to subscribable fragments (which subscribable fragments currently
come in as regular old tabs).
When a user clicks on the name of a favorite collection in the
Favorites portlet, the portal needs to render that fragment mostly as
if it were @type="regular", and as if it were the only tab in the
layout. We're focusing in on a fragment that the user normally
doesn't see at all.
So, I've got an implementation of this that sort of works. Pull
request here, with lovely screenshots:
https://github.com/Jasig/uPortal/pull/230
# How this solution needs to improve
As I continue to try out this solution, I'm learning that it would be
a lot better to re-purpose the folder-name in the uPortal URL for
this rather than introducing a new parameter. In the case where the
folder name matches a regular-old-tab, then the current behavior of
"activating" that tab and rendering the dashboard with that tab
selected. In the case where it matches a non-regular fragment,
render that fragment focused.
Anyone have hints on how I'd go after that approach rather than what
I did? I looked into it but got tangled up where it seems to be
translating the identifier into the index of the activated tab, which
of course doesn't quite work when the targeted folder isn't a regular
tab and so doesn't end up having an index, and that seemed to be just
enough to prevent the just-use-the-folder-name approach from getting
the id of the desired-for-focus fragment to show up as a parameter to
the structure transform where it could do some good.
Andrew
--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/uportal-dev