Combining Respondr and Universality fragment layouts into Respondr-only
Overview
With the addition of Respondr and its regions feature (Respondr Regions Feature), uPortal layouts became a bit more complicated because uPortal has to support both Respondr and Universality/mUniversality layouts.
The non-respondr fragments are present for sites that will upgrade to 4.1 for other reasons, but are not prepared to invest in switching from Universality to Respondr. It gives them a migration path. The community was not prepared to force adopters and say they *had* to use Respondr. Â Supporting both layouts also aids development by allowing a developer to fairly easily test a portlet to see how it looks in Respondr and Universality because you can pass a query string parameter to select the theme at login time.
Unfortunately in the default data set supporting both themes simultaneously makes the layout fragments a bit more complicated and confusing if you are using just Respondr and not Universality/mUniversality. If you are a Respondr user you have both fragment definitions apply:
Fragment/Layout file | Applies to Unversality user | Applies to Respondr User |
---|---|---|
guest-lo.fragment-definition.xml / guest-lo.fragment-layout.xml | X | X |
guest.respondr-lo.fragment-definition.xml / guest.respondr-lo.fragment-layout.xml | Â | X |
authenticated-lo.fragment-definition.xml / authenticated-lo.fragment-layout.xml | X | X |
authenticated.respondr-lo.fragment-definition.xml / authenticated.respondr-lo.fragment-layout.xml | Â | X |
Simplification
For a Respondr only site, these two sets can be collapsed into a single guest and authenticated view.  Move the Respondr-only content into the regular content; e.g. move the distinct content in guest.respondr-lo.fragment-layout.xml into guest-lo.fragment-layout.xml and authenticated.respondr-lo.fragment-layout.xml into authenticated-lo.fragment-layout.xml.  This allows you to simplify your layouts and delete the following files:
- src/main/data/quickstart_entities/fragment-definition: guest.respondr-lo.fragment-definition.xml, authenticated.respondr-lo.fragment-definition.xml
- src/main/data/quickstart_entities/fragment-layout:Â guest.respondr-lo.fragment-layout.xml, Â authenticated.respondr-lo.fragment-layout.xml
- src/main/data/quickstart_entities/user: guest.respondr-lo.user.xml, authenticated.respondr-lo.user.xml
When combining the layout files, do not have duplicates of the hidden="true" items.  The folders of type hidden="true" are not rendered for normal users, but are rendered for the layout owner to allow the layout owner to see the page and customize the page.  For example, both guest.respondr-lo.fragment-definition.xml and guest.respondr-lo.fragment-layout.xml have the following fragments:
<folder ID="s2" hidden="true" immutable="true" name="Page Top folder" type="page-top" unremovable="true"> <channel fname="dynamic-respondr-skin" unremovable="false" hidden="false" immutable="false" ID="n3"/> <channel fname="fragment-admin-exit" unremovable="false" hidden="false" immutable="false" ID="n4"/> </folder> <folder ID="s5" hidden="true" immutable="true" name="Customize folder" type="customize" unremovable="true"> <channel fname="personalization-gallery" unremovable="false" hidden="false" immutable="false" ID="n6"/> </folder>
If you combine guest.respondr-lo.fragment-layout.xml into guest.respondr-lo.fragment-definition.xml the resulting file should not include the hidden="true" items from the guest.respondr-lo.fragment-layout.xml file or they would be duplicated.
Note that the approach of combining files and deleting the *respondr* versions works best if you had copied the quickstart_entities folder to your own institution-specific folder (and update build.properties to point to your institution-specific folder) and made the changes in your institution-specific folder. Â This way merging in Apereo updates into your code base allows you to more easily inspect the changes made to the quickstart_entities in the code update and incorporate those you want in your version.