Difference between revisions of "Zimlet Developers Guide:Portal"

(Enabling the Portal Feature)
(Portal Files)
Line 59: Line 59:
 
== Portal Files ==
 
== Portal Files ==
  
A portal consists primarily of a <code>manifest.xml</code> file that configures the portal "id" and defines which zimlets are used in the portal. The manifest also includes the base HTML layout for the portal page.
+
A portal consists primarily of a <code>manifest.xml</code> file that configures the portal "id" and defines which zimlets are used in the portal. The manifest also includes the base HTML layout for the portal page. The manifest is file should be located in a directory name that matches the portal id and placed in the <code>{zcs-install-dir}/jetty/webapps/zimbra/portals/{portal-id}</code> directory.
 
 
The manifest is file should be located in a directory name that matches the portal id and placed in the <code>{zcs-install-dir}/jetty/webapps/zimbra/portals/{portal-id}</code> directory.
 
  
 
An example portal (where id="example") is provided at:
 
An example portal (where id="example") is provided at:

Revision as of 17:32, 2 January 2010

Zdg-6-menu-icon-zimbra.jpg Introduction Zdg-6-menu-icon-green-flag.png Getting Started Zdg-6-menu-icon-terminal.png Dev Environment Setup Zdg-6-menu-icon-gear.png Developing Zimlets Zdg-6-menu-icon-advanced.jpg
Advanced Concepts
Application Context
Templates
Java & JSP
Portal
Internationalization
Zdg-6-menu-icon-library.jpg API Specifications Zdg-6-menu-icon-checkbox.jpg Example Zimlets


By enabling the Zimbra portal feature, a Home tab (is created that can be used as a portal landing-page in the Zimbra web client. This portal page can be configured to display zimlets as "portlets".

Enabling the Portal Feature

The portal feature can be enabled by setting the zimbraFeaturePortalEnabled CoS to TRUE using the zmprov command. Additionally, you can set the portal name to be used.

To enable portal for a specific user:

  1. Open a terminal and change to the zimbra user:
    su - zimbra
    
  2. Set the portal feature COS to TRUE:
    zmprov ma user@domain.com zimbraFeaturePortalEnabled TRUE
    
  3. Set the portal for the user to id "example":
    zmprov ma user@domain.com zimbraPortalName example
    

Portal Files

A portal consists primarily of a manifest.xml file that configures the portal "id" and defines which zimlets are used in the portal. The manifest also includes the base HTML layout for the portal page. The manifest is file should be located in a directory name that matches the portal id and placed in the {zcs-install-dir}/jetty/webapps/zimbra/portals/{portal-id} directory.

An example portal (where id="example") is provided at:

{zcs-install-dir}/jetty/webapps/zimbra/portals/example

Portal Manifest File Reference

The following provides a reference for the elements in the Portal Manifest File.

<portal>

The <portal> element is the enclosing element in the Manifest File. The <portal> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
id Required A valid portal id. N/A The id attribute is the portal id (or "portal name") and is a required attribute. This must be the same as the directory name for the portal. For example, {zcs-install-dir}/jetty/webapps/zimbra/portals/{portal-id}/manifest.xml.

The following table describes the elements you can define within a <portal> element.

Order Element Required / Optional Description
1 portlets Required (1 allowed) The element that describes the portlets to be used with the portal. See <portlets> for more information.
2 html Required (1 allowed) Describes the portal layout. See <html> for more information.

<portlets>

This element defines the list of portlets used with the portal.

The following table describes the elements you can define within a <portlets> element.

Order Element Required / Optional Description
1 portlet Required (1 or more allowed) The element that describes the portlets to be used with the portal. See <portlet> for more information.

Example:

<portlets>
  <portlet zimlet="com_zimbra_html">
    <panel id="portlet_panel_id_1" />
    <property name="url">/zimbra/portals/example/htmlpage.html</property>
    <property name="refresh">30000</property>
  </portlet>
  <portlet zimlet="com_zimbra_html">
    <panel id="portlet_panel_id_2" />
    <property name="url">/zimbra/portals/example/jsppage.jsp</property>
    <property name="refresh">30000</property>
  </portlet>
  <portlet zimlet="com_zimbra_html">
    <panel id="portlet_panel_id_3" />
    <property name="url">/zimbra/portals/example/mypage.html</property>
    <property name="refresh">30000</property>
  </portlet>
</portlets>

<portlet>

This element defines the zimlet, panel and properties (if applicable) for the portal. The <portlet> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
zimlet Required A valid zimlet name. N/A The name of the zimlet to use as this portlet.

The following table describes the elements you can define within a <portlet> element.

Order Element Required / Optional Description
1 panel Required (1 allowed) Defines the panel for the portal. See <panel> for more information.
2 property Optional (0 or more allowed) Properties for the zimlet. See <property> for more information.

Example:

<portlet zimlet="com_zimbra_html">
  <panel id="portlet_panel_id_1" />
  <property name="url">/zimbra/portals/example/dynamic.jsp</property>
  <property name="refresh">30000</property>
</portlet>

<panel>

This element defines the panel for the portlet. The <panel> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
id Required A valid id. N/A The id of the panel for this portlet. This id is used in the HTML layout for the portal page to designate where the portal displays.

Example:

<panel id="portlet_panel_id_1" />

<property>

The <property> element is used to define properties to pass to the zimlet. The content of the element is the value of the parameter.

The <property> element has the following attributes:

Attribute Required / Optional Range of Values Default Value Description
name Required A attribute name N/A Specifies the property name

Example:

<property name="myprop">thisismyprop</property>

<html>

The <html> element wraps the HTML code for the portal page layout.

    <html><![CDATA[

    ... insert your HTML code ...

    ]]></html>


Verified Against: Zimbra Collaboration Suite 6.0 Date Created: 12/29/2009
Article ID: https://wiki.zimbra.com/index.php?title=Zimlet_Developers_Guide:Portal Date Modified: 2010-01-02



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Jump to: navigation, search