com.jalios.jcmsplugin.virtualdesktop
Class Service

java.lang.Object
  extended by com.jalios.jcmsplugin.virtualdesktop.Service

public class Service
extends Object

Service of a virtual desktop. Used for virtual desktop's layout and serialization.

Since:
virtualdesktop-1.0
Version:
$Revision: 22537 $

Constructor Summary
Service()
           
 
Method Summary
 String getColor()
          Retrieve the current color scheme of this Service.
 String getEditJsp()
          Retrieves the jsp edit template to use to edit options of this Service.
 Map<String,String> getFieldsValuesMap()
          Retrieves the map of custom fields'values defined for this Service instance.
 String getFieldValue(String name)
          Retrieves the value associated to the specified field's name
static Service getFromRequest(javax.servlet.http.HttpServletRequest request)
          Retrieve the service available in the current request, if any.
 String getId()
          Retrieves the id of this desktopElement
 Portlet getPortlet()
          Retrieves the underlying portlet used by this Service.
 String getPortletId()
          Retrieves the id of the portlet used by this Service.
 String getShortName()
          Returns the short name of this class to use of all instance.
 String getTitle()
           
 void putInRequest(javax.servlet.http.HttpServletRequest request)
          Set this service in the current request for custom field overloading.
 void removeFromRequest(javax.servlet.http.HttpServletRequest request)
          Remove this service from request.
 void setColor(String color)
          Set the color scheme of this Service.
 void setFieldValue(String name, String value)
          Set the value of the specified field for this Service.
 void setPortlet(Portlet portlet)
          Set the portlet to use for this Service.
 void setPortlet(String portletId)
          Set the portlet to use for this Service.
 void setTitle(String title)
          Set the title of this Service
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Service

public Service()
Method Detail

getShortName

public String getShortName()
Returns the short name of this class to use of all instance. e.g. "desktop", "tab", "column", "service"

Returns:
a string, common to all instance of the same type

toString

public String toString()

getTitle

public String getTitle()

setTitle

public void setTitle(String title)
Set the title of this Service

Parameters:
title - any string.

getPortlet

public Portlet getPortlet()
Retrieves the underlying portlet used by this Service.

Returns:
a portlet (or null if has not been defined)

setPortlet

public void setPortlet(Portlet portlet)
Set the portlet to use for this Service.

Parameters:
portlet - any portlet

setPortlet

public void setPortlet(String portletId)
Set the portlet to use for this Service.

Parameters:
portletId - a portlet id (can be virtual id).

getPortletId

public String getPortletId()
Retrieves the id of the portlet used by this Service.

Returns:
a portlet id or virtual id (a virtual id is returned only if the portlet of this Service was set using setPortlet(String) with a virtual id).

getEditJsp

public String getEditJsp()
Retrieves the jsp edit template to use to edit options of this Service.

Returns:
a relative jsp path (e.g. "plugins/VirtualDesktopPlugin/jsp/serviceEdit.jsp"), never returns null.

setColor

public void setColor(String color)
Set the color scheme of this Service.

Parameters:
color - a color scheme css name

getColor

public String getColor()
Retrieve the current color scheme of this Service.

Returns:
a color scheme css name

getFieldsValuesMap

public Map<String,String> getFieldsValuesMap()
Retrieves the map of custom fields'values defined for this Service instance.

Returns:
a Map with field's name as the key and field's value as the value.

setFieldValue

public void setFieldValue(String name,
                          String value)
Set the value of the specified field for this Service.

Parameters:
name - the field's name (must not be null)
value - any value

getFieldValue

public String getFieldValue(String name)
Retrieves the value associated to the specified field's name

Parameters:
name - the field's name (must not be null)
Returns:
the associated value or null if could not be found

putInRequest

public void putInRequest(javax.servlet.http.HttpServletRequest request)
Set this service in the current request for custom field overloading.

Parameters:
request - the current HttpServletRequest

removeFromRequest

public void removeFromRequest(javax.servlet.http.HttpServletRequest request)
Remove this service from request.

Parameters:
request - the current HttpServletRequest

getFromRequest

public static Service getFromRequest(javax.servlet.http.HttpServletRequest request)
Retrieve the service available in the current request, if any.

Parameters:
request - the current HttpServletRequest
Returns:
the Service instance previously added with putInRequest(HttpServletRequest)

getId

public final String getId()
Retrieves the id of this desktopElement

Returns:
a unique identifier


Copyright © 2001-2007 Jalios SA. All Rights Reserved.