Sidebar Content (through DLM fragment definitions)

Contribution written by Julien Gribonvald

This feature provides the possibility to push a sidebar content from DLM fragments definitions.

A such content can be defined only in fragment-layout.xml files descriptions and is available since uPortal version 4.0.12

 

This works like fragment definitions, you define the folders that will represents a group of elements and inside your organized channels. Like DLM, all sidebar elements will be merged and shown into the sidebar, but all folders with the same name will be merged into the same folder to avoid several group with same name, and the precedence will be used to order the groups of contents and the contents.

Step 1: Define the sidebar layout user

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user xmlns="https://source.jasig.org/schemas/uportal/io/user" xmlns:ns2="https://source.jasig.org/schemas/uportal/io/permission-owner" xmlns:ns3="https://source.jasig.org/schemas/uportal/io/stylesheet-descriptor" xmlns:ns4="https://source.jasig.org/schemas/uportal/io/portlet-definition" xmlns:ns5="https://source.jasig.org/schemas/uportal" xmlns:ns6="https://source.jasig.org/schemas/uportal/io/portlet-type" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" username="sidebar-lo" version="4.0" xsi:schemaLocation="https://source.jasig.org/schemas/uportal/io/user https://source.jasig.org/schemas/uportal/io/user/user-4.0.xsd">
    <default-user>defaultTemplateUser</default-user>
    <attribute>
        <name>givenName</name>
        <value>sidebar</value>
    </attribute>
    <attribute>
        <name>sn</name>
        <value>Layout Owner</value>
    </attribute>
</user>

Step 2: Define the content

To define, you only need to specify the folder type as ''sidebar'', the folder name will be used as id to show the name of the group's content. 

Example on how to define a sidebar content :

<?xml version="1.0" encoding="UTF-8"?>
<layout xmlns:dlm="http://www.uportal.org/layout/dlm" script="classpath://org/jasig/portal/io/import-layout_v3-2.crn" username="sidebar-lo">
  <folder ID="s1" hidden="false" immutable="false" name="Root folder" type="root" unremovable="true">
    <folder ID="s2" hidden="true" immutable="true" name="Header folder" type="header" unremovable="true">
      <channel fname="fragment-admin-exit" unremovable="false" hidden="false" immutable="false" ID="n3"/>
    </folder>
    <folder ID="s4" hidden="false" immutable="false" name="Footer folder" type="footer" unremovable="false"/>
    <folder ID="s5" dlm:addChildAllowed="false" dlm:deleteAllowed="false" dlm:editAllowed="false" dlm:moveAllowed="false"  hidden="false" immutable="false" name="Administration" type="sidebar" unremovable="false">
      <folder ID="s6" dlm:addChildAllowed="false" dlm:deleteAllowed="false" dlm:editAllowed="false" dlm:moveAllowed="false" hidden="false" immutable="false" name="Column" type="sidebar" unremovable="false">
        <channel fname="portlet-admin" unremovable="false" hidden="false" immutable="false" ID="n7" dlm:moveAllowed="false" dlm:deleteAllowed="false"/>
        <channel fname="fragment-admin" unremovable="false" hidden="false" immutable="false" ID="n8" dlm:moveAllowed="false" dlm:deleteAllowed="false"/>
        <channel fname="users-manager" unremovable="false" hidden="false" immutable="false" ID="n9" dlm:moveAllowed="false" dlm:deleteAllowed="false"/>
        <channel fname="groups-manager" unremovable="false" hidden="false" immutable="false" ID="n10" dlm:moveAllowed="false" dlm:deleteAllowed="false"/>
      </folder>
    </folder>
    <folder ID="s11" dlm:addChildAllowed="false" dlm:deleteAllowed="false" dlm:editAllowed="false" dlm:moveAllowed="false" hidden="false" immutable="false" name="Communication" type="sidebar" unremovable="false">
      <folder ID="s12" dlm:addChildAllowed="false" dlm:deleteAllowed="false" dlm:editAllowed="false" dlm:moveAllowed="false" hidden="false" immutable="false" name="Column" type="sidebar" unremovable="false">
        <channel fname="Annonces" unremovable="false" hidden="false" immutable="false" ID="n13" dlm:moveAllowed="false" dlm:deleteAllowed="false"/>
        <channel fname="DocENT" unremovable="false" hidden="false" immutable="false" ID="n14" dlm:moveAllowed="false" dlm:deleteAllowed="false"/>
      </folder>
    </folder>
    <folder ID="s15" dlm:addChildAllowed="false" dlm:deleteAllowed="false" dlm:editAllowed="false" dlm:moveAllowed="false" hidden="false" immutable="false" name="Liens rapides" type="sidebar" unremovable="false">
      <folder ID="s16" dlm:addChildAllowed="false" dlm:deleteAllowed="false" dlm:editAllowed="false" dlm:moveAllowed="false" hidden="false" immutable="false" name="Column" type="sidebar" unremovable="false">
        <channel fname="Courriel" unremovable="false" hidden="false" immutable="false" ID="n17" dlm:moveAllowed="false" dlm:deleteAllowed="false"/>
        <channel fname="PortailArenA" unremovable="false" hidden="false" immutable="false" ID="n18" dlm:moveAllowed="false" dlm:deleteAllowed="false"/>
      </folder>
    </folder>
  </folder>
</layout>

 

And this render a such sidebar content :

 

Step 3: Define a fragment definition

Below is an example of defining the fragment layout's audience (Authenticated Users).

<?xml version="1.0" encoding="UTF-8"?>
<fragment-definition xmlns:dlm="http://org.jasig.portal.layout.dlm.config" script="classpath://org/jasig/portal/io/import-fragment-definition_v3-1.crn">
  <dlm:fragment name="Sidebar" ownerID="sidebar-lo" precedence="1">
    <dlm:audience evaluatorFactory="org.jasig.portal.layout.dlm.providers.GroupMembershipEvaluatorFactory">
      <paren mode="OR">
        <attribute mode="deepMemberOf" name="Authenticated Users"/>
      </paren>
    </dlm:audience>
  </dlm:fragment>
</fragment-definition>

 

Step 4: Edit the template

For this example we edited the universality.xsl file, and edited the template ''content.sidebar.block'' :

<xsl:template name="content.sidebar.block">
    <!-- Links from DLM content with type='sidebar' -->
    <xsl:call-template name="dlm.sidebar.links"/>
    <!-- Links from DLM content with type='sidebar' -->
</xsl:template>

 

Step 5: Rebuild/Redeploy uPortal

For the changes to occur, you will need to rebuild/redeploy uportal using the command below:

ant clean deploy-war

Step 6: Restart tomcat

After the rebuilding/redeploying uPortal, restart your tomcat server

 

Additional References

  •   UP-3708 - Getting issue details... STATUS

Having problems with these instructions?

Please send us feedback at uportal-user@lists.ja-sig.org