com.atlassian.jira.portal
Interface PortletConfiguration

All Superinterfaces:
java.lang.Comparable<PortletConfiguration>, ObjectConfigurable
All Known Implementing Classes:
PortletConfigurationImpl

public interface PortletConfiguration
extends java.lang.Comparable<PortletConfiguration>, ObjectConfigurable

A representation of a configuration for a Portlet on a page. In addition to the ObjectConfigurable properties of the Portlet, the row and column are available as well as the id of the dashboard page. The interface is a bit bogus - partially a dashboard page position bean with some other stuff on it.

Only the main implementation, PortletConfigurationImpl, properly uses the full interface.

If we ever remove support for Legacy Portlets this should probably be converted into a final class and no longer implement ObjectConfigurable. However with the current model where we still need to support the older style portlets ti will remain as is.


Method Summary
 com.atlassian.gadgets.dashboard.Color getColor()
          Returns the color to use when rendering the Chrome of this gadget.
 java.lang.Integer getColumn()
          Represents the column that the configured portlet resides in.
 java.lang.Long getDashboardPageId()
          Provides the dashboard page id.
 java.net.URI getGadgetURI()
          Returns the URI pointing to the Gadget XML for this particular portlet.
 java.lang.Long getId()
          Return the id of the PortletConfiguration.
 Portlet getPortlet()
          Deprecated. This is only needed for legacy portlets now. Gadgets should no longer use this.
 java.lang.Integer getRow()
          Represents the row that the configured portlet resides in.
 java.util.Map<java.lang.String,java.lang.String> getUserPrefs()
          An unmodifiable map of user preferences stored for this gadget.
 boolean isResourcesProvided()
          Declares whether the portlet should expect to have resources such as CSS and JavaScript files included in the page.
 void setColor(com.atlassian.gadgets.dashboard.Color color)
          Set the color of the chrome for a gadget.
 void setColumn(java.lang.Integer column)
          Sets the column for the Portlet, effectively moving the portlet left or right on the page.
 void setDashboardPageId(java.lang.Long portalPageId)
          Sets the dashboard page id.
 void setRow(java.lang.Integer row)
          Sets the row for the Portlet, effectively moving the portlet up or down on the page.
 void setUserPrefs(java.util.Map<java.lang.String,java.lang.String> userPrefs)
          Sets the userPreferences for this portletconfig.
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.atlassian.configurable.ObjectConfigurable
getDefaultProperty, getKey, getLongProperty, getObjectConfiguration, getProperties, getProperty, getTextProperty, hasProperty
 

Method Detail

getId

java.lang.Long getId()
Return the id of the PortletConfiguration.

Returns:
the id of the PortletConfiguration.

getPortlet

Portlet getPortlet()
Deprecated. This is only needed for legacy portlets now. Gadgets should no longer use this.

Returns the portlet implementation that this PortletConfiguration is for.

Returns:
the portlet.

getColumn

java.lang.Integer getColumn()
Represents the column that the configured portlet resides in.

Returns:
the column number starting from 1.

setColumn

void setColumn(java.lang.Integer column)
Sets the column for the Portlet, effectively moving the portlet left or right on the page.

Parameters:
column - the column number starting from 1.

getRow

java.lang.Integer getRow()
Represents the row that the configured portlet resides in.

Returns:
the row number starting from 1.

setRow

void setRow(java.lang.Integer row)
Sets the row for the Portlet, effectively moving the portlet up or down on the page.

Parameters:
row - the row number starting from 1.

getDashboardPageId

java.lang.Long getDashboardPageId()
Provides the dashboard page id.

Returns:
the dashboard page id.

setDashboardPageId

void setDashboardPageId(java.lang.Long portalPageId)
Sets the dashboard page id.

Parameters:
portalPageId - the dashboard page id.

isResourcesProvided

boolean isResourcesProvided()
Declares whether the portlet should expect to have resources such as CSS and JavaScript files included in the page. If false, the portlet should assume that these resources are unavailable and not render any tricky sexy magic that relies on JavaScript functions defined in these files. The RunPortlet action will most likely provide an implementaion which returns false to this method and Portlets rendered there will therefore need to work without their resource files.

Returns:
true only if the CSS and JavaScript files etc. will be available on the rendered page.

getGadgetURI

java.net.URI getGadgetURI()
Returns the URI pointing to the Gadget XML for this particular portlet. May return null for legacy portlets (that don't implement the Gadget spec).

Returns:
URI pointing to the Gadget XML or null
See Also:
http://code.google.com/apis/gadgets/docs/reference.html

getColor

com.atlassian.gadgets.dashboard.Color getColor()
Returns the color to use when rendering the Chrome of this gadget.

Returns:
color to use when rendering the Chrome of this gadget

setColor

void setColor(com.atlassian.gadgets.dashboard.Color color)
Set the color of the chrome for a gadget.

Parameters:
color - the color of the chrome for a gadget.

getUserPrefs

java.util.Map<java.lang.String,java.lang.String> getUserPrefs()
An unmodifiable map of user preferences stored for this gadget. Will return an empty map in the case of a legacy gadget.

Returns:
map of user preferences stored for this gadget.
See Also:
http://code.google.com/apis/gadgets/docs/reference.html#Userprefs_Ref

setUserPrefs

void setUserPrefs(java.util.Map<java.lang.String,java.lang.String> userPrefs)
Sets the userPreferences for this portletconfig.

Parameters:
userPrefs - A map of key value pairs


Copyright © 2002-2010 Atlassian. All Rights Reserved.