de.iai.ilcd.webgui.controller.ui
Class AbstractDataSetHandler<I extends de.fzk.iai.ilcd.service.model.IDataSetVO,T extends DataSet,D extends DataSetDao<T,?,I>>

java.lang.Object
  extended by de.iai.ilcd.webgui.controller.ui.AbstractDataSetHandler<I,T,D>
Type Parameters:
T - Type of model object that this handler provides
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ContactHandler, FlowHandler, FlowpropertyHandler, LCIAMethodHandler, ProcessHandler, SourceHandler, UnitgroupHandler

public abstract class AbstractDataSetHandler<I extends de.fzk.iai.ilcd.service.model.IDataSetVO,T extends DataSet,D extends DataSetDao<T,?,I>>
extends java.lang.Object
implements java.io.Serializable

Handler for DataSet view

See Also:
Serialized Form

Constructor Summary
AbstractDataSetHandler(D daoInstance, java.lang.String resourceDir)
          Initialize handler
 
Method Summary
protected  void datasetLoaded(T dataset)
          Called when a local data set was loaded successfully by postViewParamInit(ComponentSystemEvent).
protected  D getDaoInstance()
          Get the DAO instance of this handler
 I getDataSet()
          Get the data set
 java.lang.String getDataSetIdString()
          Get the data set id as string
 java.lang.String getDataSetUuidString()
          Get the data set uuid as string
 java.lang.String getDataSetVersionString()
          Get the data set version as string
 java.lang.String getForeignHTMLResourceURL()
          Get the foreign resource URL for HTML view of data set
 java.lang.String getForeignXMLResourceURL()
          Get the foreign resource URL for XML of data set
 java.lang.String getLocalHTMLResourceURL()
          Get the local resource URL for HTML view of data set
 java.lang.String getLocalXMLResourceURL()
          Get the local resource URL for XML of data set
 java.util.List<T> getOtherVersions()
          Get the other versions for this data set
 java.lang.String getSourceNodeIdString()
          Get the source node id as string
 boolean isForeignDataSet()
          Determine if the data set is a foreign data set
 boolean isOtherVersionPresent()
          Determine if at least one other version is present
protected  boolean isStringNullOrEmpty(java.lang.String s)
          Determine if string is null or empty.
 void postViewParamInit(javax.faces.event.ComponentSystemEvent event)
          Method to be called after view parameters have been initialized.
 void setConf(ConfigurationBean conf)
          Setter for managed property for configuration
 void setDataSet(I dataSet)
          Set the data set
 void setDataSetIdString(java.lang.String dataSetIdString)
          Set the data set id as string
 void setDataSetUuidString(java.lang.String dataSetUuidString)
          Set the data set uuid as string
 void setDataSetVersionString(java.lang.String dataSetVersionString)
          Set the data set version as string
 void setSourceNodeIdString(java.lang.String sourceNodeIdString)
          Set the source node id as string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDataSetHandler

public AbstractDataSetHandler(D daoInstance,
                              java.lang.String resourceDir)
Initialize handler

Parameters:
daoInstance - matching DAO
resourceDir - the directory for the RESTful service (e.g. processes)
Method Detail

datasetLoaded

protected void datasetLoaded(T dataset)
Called when a local data set was loaded successfully by postViewParamInit(ComponentSystemEvent). Override this method when this information is required in sub-classes.

Parameters:
dataset - loaded data set

postViewParamInit

public final void postViewParamInit(javax.faces.event.ComponentSystemEvent event)
                             throws javax.faces.event.AbortProcessingException
Method to be called after view parameters have been initialized. This is actually loading the data set! What happens:

Parameters:
event - event
Throws:
javax.faces.event.AbortProcessingException - in case of errors

isForeignDataSet

public boolean isForeignDataSet()
Determine if the data set is a foreign data set

Returns:
true is data set is a foreign data set, else false

getLocalXMLResourceURL

public java.lang.String getLocalXMLResourceURL()
Get the local resource URL for XML of data set

Returns:
local resource URL for XML of data set

getLocalHTMLResourceURL

public java.lang.String getLocalHTMLResourceURL()
Get the local resource URL for HTML view of data set

Returns:
local resource URL for HTML view of data set

getForeignXMLResourceURL

public java.lang.String getForeignXMLResourceURL()
Get the foreign resource URL for XML of data set

Returns:
foreign resource URL for XML of data set or null if this is not

getForeignHTMLResourceURL

public java.lang.String getForeignHTMLResourceURL()
Get the foreign resource URL for HTML view of data set

Returns:
foreign resource URL for HTML view of data set

setConf

public void setConf(ConfigurationBean conf)
Setter for managed property for configuration

Parameters:
conf - configuration bean to set

setDataSet

public void setDataSet(I dataSet)
Set the data set

Parameters:
dataSet - data set to set

getDataSet

public I getDataSet()
Get the data set

Returns:
data set

getDataSetIdString

public java.lang.String getDataSetIdString()
Get the data set id as string

Returns:
data set id as string

isOtherVersionPresent

public boolean isOtherVersionPresent()
Determine if at least one other version is present

Returns:
true if at least one other version is present, else false

setDataSetIdString

public void setDataSetIdString(java.lang.String dataSetIdString)
Set the data set id as string

Parameters:
dataSetIdString - id to set

getDataSetUuidString

public java.lang.String getDataSetUuidString()
Get the data set uuid as string

Returns:
data set uuid as string

setDataSetUuidString

public void setDataSetUuidString(java.lang.String dataSetUuidString)
Set the data set uuid as string

Parameters:
dataSetUuidString - uuid to set

getDataSetVersionString

public java.lang.String getDataSetVersionString()
Get the data set version as string

Returns:
data set version as string

setDataSetVersionString

public void setDataSetVersionString(java.lang.String dataSetVersionString)
Set the data set version as string

Parameters:
dataSetVersionString - version to set

getSourceNodeIdString

public java.lang.String getSourceNodeIdString()
Get the source node id as string

Returns:
source node id as string

setSourceNodeIdString

public void setSourceNodeIdString(java.lang.String sourceNodeIdString)
Set the source node id as string

Parameters:
sourceNodeIdString - id to set

getOtherVersions

public java.util.List<T> getOtherVersions()
Get the other versions for this data set

Returns:
other versions for this data set

getDaoInstance

protected final D getDaoInstance()
Get the DAO instance of this handler

Returns:
DAO instance of this handler

isStringNullOrEmpty

protected final boolean isStringNullOrEmpty(java.lang.String s)
Determine if string is null or empty. Please note that if string is not null, it is trimmed before empty check.

Parameters:
s - string to test
Returns:
true if null or empty, else false