com.wewebu.ow.server.history
Class OwTouchConfiguration

java.lang.Object
  extended by com.wewebu.ow.server.history.OwTouchConfiguration

public class OwTouchConfiguration
extends Object

Class for holding the configuration information for in session History entries, and for the Touch plugin.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
2.5.2.0

Nested Class Summary
 class OwTouchConfiguration.OwEventID2IconMaping
          Convenient class for holding a pair of event ID and icon for a given event type
 
Field Summary
static String ALL_EVENT_IDS
          all event IDs, corresponding to "*" from XML configuration eventId
static int ALL_EVENT_TYPES
          all event types, corresponding with "*" from XML configuration event type
static int NOT_DEFINED
          constant for not defined event type
 
Constructor Summary
OwTouchConfiguration(boolean shouldReadIcons_p)
          Constructor
OwTouchConfiguration(boolean shouldReadIcons_p, Node touchConfigurationNode_p, Locale locale_p)
          Constructor
 
Method Summary
 Set getConfiguredEventTypes()
          Return the configured event types.
 List getConfiguredMappingForEventType(int eventType_p)
          Return a list of mappings for the given event type
 String[] getEventIdsForEventType(int eventType_p)
          Get configured event IDs for the given eventType.
 String getIconForEventType(int eventType_p, String eventId_p)
          Get the icon path for a given pair of eventType and event ID
 void init(Node touchConfigurationNode_p, Locale locale_p)
          Initialize this configuration element.
 boolean isConfigured(int eventType_p)
          Check if the given event type is configured.
 boolean isConfigured(int eventType_p, String strEventID_p)
          Check if a pair of event type and event ID is configured in XML.
 boolean isGenericEventId(String eventId_p)
          Check if the given event ID is a generic one.
 boolean isGenericEventType(Integer eventType_p)
          Check if the given event type is a generic event type
 boolean isTouchConfigurationInitialized()
          Check if this configuration was correctly initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_EVENT_TYPES

public static final int ALL_EVENT_TYPES
all event types, corresponding with "*" from XML configuration event type

See Also:
Constant Field Values

ALL_EVENT_IDS

public static final String ALL_EVENT_IDS
all event IDs, corresponding to "*" from XML configuration eventId

See Also:
Constant Field Values

NOT_DEFINED

public static final int NOT_DEFINED
constant for not defined event type

See Also:
Constant Field Values
Constructor Detail

OwTouchConfiguration

public OwTouchConfiguration(boolean shouldReadIcons_p)
Constructor

Parameters:
shouldReadIcons_p - - flag used to read or not the icon path from configuration.

OwTouchConfiguration

public OwTouchConfiguration(boolean shouldReadIcons_p,
                            Node touchConfigurationNode_p,
                            Locale locale_p)
                     throws OwConfigurationException
Constructor

Parameters:
shouldReadIcons_p - - flag used to read or not the icon path from configuration.
touchConfigurationNode_p - - the XML node (SessionEvents|TouchEvents)
Throws:
OwConfigurationException - thrown when the configuration is not valid.
Method Detail

init

public void init(Node touchConfigurationNode_p,
                 Locale locale_p)
          throws OwConfigurationException
Initialize this configuration element.

Parameters:
touchConfigurationNode_p - - the XML node (SessionEvents|TouchEvents)
locale_p - - the m_locale object
Throws:
OwConfigurationException - thrown when the configuration is not valid.

getIconForEventType

public String getIconForEventType(int eventType_p,
                                  String eventId_p)
Get the icon path for a given pair of eventType and event ID

Parameters:
eventType_p - - the event type
eventId_p - - the event ID.
Returns:
the path to the icon or null, in case that the combination of eventType and event ID cannot be resolved.

getEventIdsForEventType

public String[] getEventIdsForEventType(int eventType_p)
Get configured event IDs for the given eventType.

Parameters:
eventType_p - - the event type
Returns:
- the array of event IDs, or an empty array if no event ID was configured for the given event type

isConfigured

public boolean isConfigured(int eventType_p,
                            String strEventID_p)
Check if a pair of event type and event ID is configured in XML. Check also for generic event type.

Parameters:
eventType_p - - the event type
strEventID_p - - the event ID
Returns:
true - if the pair is configured in the XML.

isConfigured

public boolean isConfigured(int eventType_p)
Check if the given event type is configured.

Parameters:
eventType_p - - the event type
Returns:
true - if the given type is configured.

getConfiguredEventTypes

public Set getConfiguredEventTypes()
Return the configured event types.

Returns:
- the configured event types.

getConfiguredMappingForEventType

public List getConfiguredMappingForEventType(int eventType_p)
Return a list of mappings for the given event type

Parameters:
eventType_p - - the event type
Returns:
- the list of mappings

isTouchConfigurationInitialized

public boolean isTouchConfigurationInitialized()
Check if this configuration was correctly initialized.

Returns:
true if configuration was correctly initialized.

isGenericEventType

public boolean isGenericEventType(Integer eventType_p)
Check if the given event type is a generic event type

Parameters:
eventType_p -
Returns:
true - if the given event type is a generic one

isGenericEventId

public boolean isGenericEventId(String eventId_p)
Check if the given event ID is a generic one.

Parameters:
eventId_p - - the event ID.
Returns:
true - if the given event ID is generic.


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.