com.jalios.jcmsplugin.virtualdesktop
Class DesktopManager

java.lang.Object
  extended by com.jalios.jcms.ChannelListener
      extended by com.jalios.jcmsplugin.virtualdesktop.DesktopManager
All Implemented Interfaces:
PluginComponent, AlarmListener, JPropertiesListener, Comparable

public class DesktopManager
extends ChannelListener
implements PluginComponent, JPropertiesListener, AlarmListener

Singleton class used to manage all virtual desktop properties an such.

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

Field Summary
static String DEFAULT_DESKTOP_XML_PATH_PROP
          Property name of the default desktop xml path to use for Virtual Desktop
static String DESKTOP_EXTRAINFO_EXPIRATIONDELAY_PROP
          Property name for the expiration delay of Desktop storage in extrainfo.
static String DESKTOP_ICONS_LABEL_PROP
          Property name for the icons translation prefix
static String DESKTOP_ICONS_PROP
          Property name for the list of icons
static String DESKTOP_POLICY_FILTER_CLASS_PROP
          Property name of the desktop policy filter to be instanciated and used by Virtual Desktop
static String DESKTOP_THEMES_LABEL_PROP
          Property name for the css/theme translation prefix
static String DESKTOP_THEMES_PROP
          Property name for the list of css/theme
static String PORTLET_RSS_VIRTUAL_ID
          Default Portlet RSS virtual id.
static String SERVICE_COLORS_PROP
          Property name for the list of service colors
 
Fields inherited from class com.jalios.jcms.ChannelListener
order, REVISION
 
Fields inherited from interface com.jalios.jcms.plugin.PluginComponent
REVISION
 
Fields inherited from interface com.jalios.util.JPropertiesListener
REVISION
 
Fields inherited from interface com.jalios.jdring.AlarmListener
REVISION
 
Constructor Summary
DesktopManager()
           
 
Method Summary
static DesktopManager getDesktopManager()
           
 DesktopPolicyFilter getDesktopPolicyFilter()
          Retrieve the DesktopPolicyFilter in use.
 String getIconCss(String iconName)
          Return the css classnames to use for the specified icon.
 String getIconLabel(String lang, String iconName)
          Return the label to use for the specified icon, in the specified language.
 SortedSet<String> getIcons()
          Return the icons available for the desktop.
static org.apache.log4j.Logger getLogger()
           
 List<String> getServiceColors()
          Retrieve the list of css color scheme name that can be used for Services.
 String getThemeCss(String themeName)
          Return the StyleSheet to use with the specified theme.
 String getThemeLabel(String lang, String themeName)
          Return the label to use for the specified theme, in the specified language.
 String getThemePreview(String themeName)
          Return the Preview image to use with the specified theme.
 Set<String> getThemes()
          Return the themes available for the desktop.
 void handleAlarm(AlarmEntry entry)
          Invoked when an alarm is triggered.
 void handleFinalize()
          Called when the channel is finalized
 boolean init(Plugin plugin)
          Initialize the component with the given plugin configuration
 void initAfterStoreLoad()
          Called just after the store has been loaded and the channel has been initialized.
 void initBeforeStoreLoad()
          Called just before the store has been loaded.
 boolean isInitialized()
          Check if the Desktop Manager and its plugin have been initialized correctly.
 void propertiesChange(JProperties properties)
           
protected  void reloadProperties()
          Load properties used by DesktopManager.
 void setDesktopPolicyFilter(String policyClassName)
          Instanciate the DesktopPolicyFilter to be use (reset it on null or invalid classname).
 boolean useDesktopPolicyFilter()
          Check if a valid DesktopPolicyFilter has been defined and can be used.
 
Methods inherited from class com.jalios.jcms.ChannelListener
compareTo, equals
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DESKTOP_XML_PATH_PROP

public static final String DEFAULT_DESKTOP_XML_PATH_PROP
Property name of the default desktop xml path to use for Virtual Desktop

See Also:
Constant Field Values

DESKTOP_POLICY_FILTER_CLASS_PROP

public static final String DESKTOP_POLICY_FILTER_CLASS_PROP
Property name of the desktop policy filter to be instanciated and used by Virtual Desktop

See Also:
Constant Field Values

DESKTOP_THEMES_PROP

public static final String DESKTOP_THEMES_PROP
Property name for the list of css/theme

See Also:
Constant Field Values

DESKTOP_THEMES_LABEL_PROP

public static final String DESKTOP_THEMES_LABEL_PROP
Property name for the css/theme translation prefix

See Also:
Constant Field Values

DESKTOP_ICONS_PROP

public static final String DESKTOP_ICONS_PROP
Property name for the list of icons

See Also:
Constant Field Values

DESKTOP_ICONS_LABEL_PROP

public static final String DESKTOP_ICONS_LABEL_PROP
Property name for the icons translation prefix

See Also:
Constant Field Values

SERVICE_COLORS_PROP

public static final String SERVICE_COLORS_PROP
Property name for the list of service colors

See Also:
Constant Field Values

PORTLET_RSS_VIRTUAL_ID

public static final String PORTLET_RSS_VIRTUAL_ID
Default Portlet RSS virtual id.
$jcmsplugin.virtualdesktop.rss-portlet

See Also:
Constant Field Values

DESKTOP_EXTRAINFO_EXPIRATIONDELAY_PROP

public static final String DESKTOP_EXTRAINFO_EXPIRATIONDELAY_PROP
Property name for the expiration delay of Desktop storage in extrainfo. Duration (in minutes) above which a Desktop is removed from member's extrainfo if not accessed. For performance reason, the value CANNOT be less than 30 minutes.

See Also:
Constant Field Values
Constructor Detail

DesktopManager

public DesktopManager()
Method Detail

getDesktopManager

public static DesktopManager getDesktopManager()

getLogger

public static org.apache.log4j.Logger getLogger()

init

public boolean init(Plugin plugin)
Description copied from interface: PluginComponent
Initialize the component with the given plugin configuration

Specified by:
init in interface PluginComponent
Overrides:
init in class ChannelListener
Parameters:
plugin - the calling plugin
Returns:
true if the conponent has been correctly initialized.
See Also:
PluginComponent.init(Plugin)

isInitialized

public boolean isInitialized()
Check if the Desktop Manager and its plugin have been initialized correctly.

Returns:
true if the plugin was initialized, false otherwise.
Since:
virtualdesktop-1.0

initBeforeStoreLoad

public void initBeforeStoreLoad()
                         throws Exception
Description copied from class: ChannelListener
Called just before the store has been loaded. If for any reason you want to interrupt JCMS startup, you can throw an exception. The exception's message will be displayed in JCMS status page (to any user!).

Specified by:
initBeforeStoreLoad in class ChannelListener
Throws:
Exception - any exception you may want to throw if a problem occurs needing to interrupt JCMS startup.

initAfterStoreLoad

public void initAfterStoreLoad()
                        throws Exception
Description copied from class: ChannelListener
Called just after the store has been loaded and the channel has been initialized. If for any reason you want to interrupt JCMS startup, you can throw an exception. The exception's message will be displayed in JCMS status page (to any user!).

Specified by:
initAfterStoreLoad in class ChannelListener
Throws:
Exception - any exception you may want to throw if a problem occurs needing to interrupt JCMS startup.

handleFinalize

public void handleFinalize()
Description copied from class: ChannelListener
Called when the channel is finalized

Specified by:
handleFinalize in class ChannelListener

propertiesChange

public void propertiesChange(JProperties properties)
Specified by:
propertiesChange in interface JPropertiesListener
Parameters:
properties - the JProperties which have changed
Since:
virtualdesktop-1.0
See Also:
JPropertiesListener.propertiesChange(JProperties)

handleAlarm

public void handleAlarm(AlarmEntry entry)
Invoked when an alarm is triggered.

Specified by:
handleAlarm in interface AlarmListener
Parameters:
entry - the AlarmEntry which has been triggered.

reloadProperties

protected void reloadProperties()
Load properties used by DesktopManager.

Since:
virtualdesktop-1.0

getThemes

public Set<String> getThemes()
Return the themes available for the desktop.

As of current implementation, themes are find from all properties starting with "jcmsplugins.virtualdesktop.themes.".

Returns:
a Set of theme name, e.g. {"blueberry", "raspberry"}, never return null.
Since:
virtualdesktop-1.0

getThemeCss

public String getThemeCss(String themeName)
Return the StyleSheet to use with the specified theme.

Parameters:
themeName - a theme value as returned by getThemes(), e.g: "blueberry".
Returns:
a relative path of a css "custom/blueberry.css" *without begining slash* or an empty String if css path could not be found.
Since:
virtualdesktop-1.0

getThemePreview

public String getThemePreview(String themeName)
Return the Preview image to use with the specified theme.

Parameters:
themeName - a theme value as returned by getThemes(), e.g: "blueberry".
Returns:
a relative path of a image "custom/blueberry.jpg" *without begining slash* or an empty String if image path could not be found.
Since:
virtualdesktop-1.0

getThemeLabel

public String getThemeLabel(String lang,
                            String themeName)
Return the label to use for the specified theme, in the specified language.

Parameters:
lang - the language in which to retrieve the label
themeName - a theme name as returned by getThemes(), e.g: "blueberry".
Returns:
an I18N string.
Since:
virtualdesktop-1.0

getIcons

public SortedSet<String> getIcons()
Return the icons available for the desktop.

As of current implementation, icons are find from all properties starting with "jcmsplugins.virtualdesktop.icons.".

Returns:
a Set of icon name, e.g. {"fff-bell", "fff-bell"}, never return null.
Since:
virtualdesktop-1.0

getIconCss

public String getIconCss(String iconName)
Return the css classnames to use for the specified icon.

Parameters:
iconName - an icon name as returned by getIcons(), e.g: "fff-bell".
Returns:
a css classname, "ss_sprite ss_bell".
Since:
virtualdesktop-1.0

getIconLabel

public String getIconLabel(String lang,
                           String iconName)
Return the label to use for the specified icon, in the specified language.

Parameters:
lang - the language in which to retrieve the label
iconName - an icon name as returned by getIcons(), e.g: "fff-bell".
Returns:
an I18N string.
Since:
virtualdesktop-1.0

getServiceColors

public List<String> getServiceColors()
Retrieve the list of css color scheme name that can be used for Services.

As of current implementation, icons are find from property "jcmsplugins.virtualdesktop.services.colors".

Returns:
a list of color scheme name
Since:
virtualdesktop-1.0

setDesktopPolicyFilter

public void setDesktopPolicyFilter(String policyClassName)
Instanciate the DesktopPolicyFilter to be use (reset it on null or invalid classname).

Parameters:
policyClassName - a fully qualified class name to be instancianted
Since:
virtualdesktop-1.0

getDesktopPolicyFilter

public DesktopPolicyFilter getDesktopPolicyFilter()
Retrieve the DesktopPolicyFilter in use.

Returns:
a new instance of DesktopPolicyFilter or null if none was declared.
Since:
virtualdesktop-1.0

useDesktopPolicyFilter

public boolean useDesktopPolicyFilter()
Check if a valid DesktopPolicyFilter has been defined and can be used.

Returns:
true if the DesktopPolicyFilter has been defined and can be used through getDesktopPolicyFilter()
Since:
virtualdesktop-1.0


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