Class: Portlet

Source Location: /CORE/system/api/portlet/Portlet.php

Class Portlet

Class Overview

A Portlet is a small piece of Logic, normally displayed by a HTML snippet.

This class is the base class for all Portlets. The method

must always return all possible Parameter for your Portlet.
Therefor your implementation MUST call
  1. setParameter($key$value)
for each possible Parameter in its constructor!
Make sure to override
and return proper PortletType definitions:

Located in /CORE/system/api/portlet/Portlet.php [line 106]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: Portlet.php,v 1.2 2006/11/26 22:04:42 kpapst Exp $
Copyright:  Copyright (C) 2002-2006 Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Descendants
Child Class Description
TranslatedPortlet This is a base class for Portlets that use a ResourceBundle.
SkypeOnlinePortlet Shows a Skype Javascript, that displays the Status of the configured Person.

[ Top ]
Method Summary
Portlet   Portlet()  
boolean   displayPortlet()   OPTIONAL TO BE OVERWRITEN!
Return if this Portlet should be displayed or not.
array   getAllParameter()   Gets all configured Portlet Parameter.
String   getHtml()   REQIURED TO BE OVERWRITEN!
Return the HTML snippet that this Portlet represents.
String   getIdentifier()   Get the Identifier for this Portlet.
String   getJavascript()   OPTIONAL TO BE OVERWRITEN!
Overwrite if your Portlet needs a Javascript snippet to work.
mixed   getParameter()   Gets a Portlet Parameter.
String   getParameterName()   Returns the Name of the given Parameter.
mixed   getParameterType()   REQIURED TO BE OVERWRITEN!
Returns the PortletType for the given Key.
String   getTitle()   REQIURED TO BE OVERWRITEN!
Return the Title for this Portlet.
boolean   needsJavascript()   OPTIONAL TO BE OVERWRITEN!
This method defines if the Portlet needs a Javascript block to work.
void   setParameter()   Sets a Portlet Parameter.

[ Top ]
Methods
Constructor Portlet  [line 113]

  Portlet Portlet( )



[ Top ]
displayPortlet  [line 233]

  boolean displayPortlet( )

OPTIONAL TO BE OVERWRITEN!
Return if this Portlet should be displayed or not.

You might use this to display stateful Portlets, like a Login, that should only be diplayed to Anonymous User.
Default returns

  1. true
.


API Tags:
Return:  whether this Portlet should be displayed or not


Redefined in descendants as:

[ Top ]
getAllParameter  [line 142]

  array getAllParameter( )

Gets all configured Portlet Parameter.


Make sure this method always returns all possible Values, cause they are used for the dynamic Portlet Configuration.


API Tags:
Return:  an Array with all avialable Key-Value Parameter


[ Top ]
getHtml  [line 195]

  String getHtml( )

REQIURED TO BE OVERWRITEN!
Return the HTML snippet that this Portlet represents.


API Tags:
Return:  the HTML that should be displayed


Redefined in descendants as:

[ Top ]
getIdentifier  [line 150]

  String getIdentifier( )

Get the Identifier for this Portlet.


API Tags:
Return:  the Unique Identifier for this Portlet


Redefined in descendants as:

[ Top ]
getJavascript  [line 219]

  String getJavascript( )

OPTIONAL TO BE OVERWRITEN!
Overwrite if your Portlet needs a Javascript snippet to work.


API Tags:
Return:  the Javascript for this Portlet


Redefined in descendants as:

[ Top ]
getParameter  [line 129]

  mixed getParameter( $key, [ $fallback = '']  )

Gets a Portlet Parameter.

Parameters:
   $key: 
   $fallback: 

API Tags:
Return:  the Value for the Key or the Fallback


[ Top ]
getParameterName  [line 175]

  String getParameterName( $key  )

Returns the Name of the given Parameter.

The Name will be used in Administration Masks to increase the usability for End User.

Parameters:
   $key: 

API Tags:
Return:  the Name for the given Parameter


Redefined in descendants as:

[ Top ]
getParameterType  [line 166]

  mixed getParameterType( $key  )

REQIURED TO BE OVERWRITEN!
Returns the PortletType for the given Key.

Your implementation should use a switch to return proper PortletType.
The default implementation returns

.

Parameters:
   $key: 

API Tags:
Return:  one of the available Portlet Types


Redefined in descendants as:

[ Top ]
getTitle  [line 185]

  String getTitle( )

REQIURED TO BE OVERWRITEN!
Return the Title for this Portlet.


API Tags:
Return:  the Title for this Portlet


Redefined in descendants as:

[ Top ]
needsJavascript  [line 209]

  boolean needsJavascript( )

OPTIONAL TO BE OVERWRITEN!
This method defines if the Portlet needs a Javascript block to work.

The default implementation checks if

returns a String with length greater than zero.


API Tags:
Return:  whether this Portlet needs some Javascript to work


Redefined in descendants as:

[ Top ]
setParameter  [line 119]

  void setParameter( $key, $value  )

Sets a Portlet Parameter.

Parameters:
   $key: 
   $value: 


[ Top ]