Import tools to register your portlet

To leverage the uPortal import tools to register your portlet try the following:

Step 1: Channel Definition XML File

You need a channel definition XML file for your portlet. The file can have any name, but it must have a .channel file extention.

Example

<channel-definition script="classpath://org/jasig/portal/io/import-channel_v3-1.crn">
    <title>My Classes</title>
    <name>My Classes</name>
    <fname>courses</fname>
    <desc>View your enrolled courses, access blackboard.</desc>
    <type>Portlet</type>
    <class>org.jasig.portal.channels.portlet.CSpringPortletAdaptor</class>
    <timeout>25000</timeout>
    <hasedit>N</hasedit>
    <hashelp>N</hashelp>
    <hasabout>N</hasabout>
    <secure>N</secure>
    <locale>en_US</locale>
    <categories>
        <category>General Interest</category>
    </categories>
    <groups>
        <group>Everyone</group>
    </groups>
    <users>
        <user>main-lo</user>
    </users>
    <parameters>
        <parameter>
            <name>portletApplicationId</name>
            <value>/CoursesPortlet</value>
            <description/>
            <ovrd>N</ovrd>
        </parameter>
        <parameter>
            <name>portletName</name>
            <value>Courses</value>
            <description/>
            <ovrd>N</ovrd>
        </parameter>
        <parameter>
            <name>disableDynamicTitle</name>
            <value>true</value>
            <description/>
            <ovrd>N</ovrd>
        </parameter>
    </parameters>
    <portletPreferences/>
</channel-definition>

Notable Fields

You may need to change these data points (from the example above) for your portlet.

Name

Description

title

Title of the portlet in the layout

name

Name of the portlet in Portlet Manager and user customization dialogs

fname

Programmatic, system-unique key for the portlet. We recommend you use only A-Z, a-z, 0-9, and underscores ('_') in this field

desc

Description of the portlet in Portlet Manager and user customization dialogs

timeout

Time, in milliseconds, the portlet will be allowed to render. Should be 5000 or higher, depending on the portlet

hasedit

Whether the portlet has and, as an administrator, you wish to offer EDIT mode in this portlet

hashelp

Whether the portlet has and, as an administrator, you wish to offer HELP mode in this portlet

categories

Channel categories in which this portlet will appear in the user customization dialogs. If no categories are listed, users will not be able to add the portlet to their layouts manually.

groups

Groups of users who may SUBSCRIBE to this portlet (add it to their layouts)

users

As groups, but for users

portletApplicationId

A slash ('/'), followed by the name of the portlet app that contains this portlet

portletName

Name of this portlet as defined in portlet.xml

disableDynamicTitle

Specify 'true' if you want the title to appear as you set it in this file; otherwise, the title will probably appear as set in portlet.xml

portletPreferences

(lightbulb) Use this area to set defaults and/or toggle advanced features of your portlet. You can get a lot of mileage and reuse out of your portlets, as well as Portlets from Jasig by using portlet preferences effectively. Consult the documentation for your portlet for further information.

Step 2: Import

Use the following Ant command to import the courses.channel portlet definition file in directory /data/dev/channel.

  >ant data-import -Ddir=/data/dev/channel -Dpattern=courses.channel

Use this Ant command to import portlet definition files in /data/dev/channel.

  >ant data-import -Ddir=/data/dev/channel

Add Feedback content box here.....