fr.cnes.sitools.plugins.resources.model
Class ResourceModel

java.lang.Object
  extended by org.restlet.engine.Helper
      extended by fr.cnes.sitools.common.model.ExtensionModel<ResourceParameter>
          extended by fr.cnes.sitools.plugins.resources.model.ResourceModel
All Implemented Interfaces:
IResource, Validable
Direct Known Subclasses:
CartResourceModel, CommandLineServiceModel, CsvResourceModel, HtmlResourceModel, JeoSearchResourceMongoDBModel, JeoSearchResourcePostGisModel, ServicePropertiesSearchResourceModel, SitoolsAnalogServiceModel, TaskResourceModel, UlisseTalendJobResourceModel

public class ResourceModel
extends ExtensionModel<ResourceParameter>
implements Validable

Base class for Parameterized resources model

Author:
m.marseille (AKKA Technologies)

Constructor Summary
ResourceModel()
          Constructor Store the class name
 
Method Summary
 void addParam(ResourceParameter param)
          Method to add a parameter to the ResourceModel.
 void completeAttachUrlWith(java.lang.String path)
          Method to complete the initial default url attachment
 java.lang.String getApplicationClassName()
          Gets the applicationClassName value
 ResourceBehaviorType getBehavior()
          Gets the behavior value.It is use to tell the client interface behavior after calling the resource.
 DataSetSelectionType getDataSetSelection()
          Gets the dataSetSelection value
 java.lang.String getImage()
          Gets the image value
 ResourceParameter getParameterByName(java.lang.String name)
          Return a parameter by its name or null if the parameter cannot be found
 java.lang.String getParent()
          Gets the parent value
 java.lang.String getResourceClassName()
          Gets the name of the class implementing the Resource
 Validator<ResourceModel> getValidator()
          Get the Validator on a Object
 void initParametersForAdmin(org.restlet.Context context)
          Override this method to add parameters when the Context is needed Those parameters will be seen by the administrator when configuring a ResourceModel.
 void setApplicationClassName(java.lang.String applicationClassName)
          Sets the class name of the application to which the Resource can be attached The class name must be complete (with full package declaration)
 void setBehavior(ResourceBehaviorType behavior)
          Sets the value of behavior
 void setDataSetSelection(DataSetSelectionType dataSetSelection)
          Sets the value of dataSetSelection.
 void setImage(java.lang.String image)
          Sets the value of image
 void setParent(java.lang.String parent)
          Sets the value of parent
 void setResourceClassName(java.lang.String resourceClassName)
          Sets the name of the class implementing the Resource
 
Methods inherited from class fr.cnes.sitools.common.model.ExtensionModel
getClassAuthor, getClassName, getClassOwner, getClassVersion, getDescription, getDescriptionAction, getId, getName, getParametersMap, setClassAuthor, setClassName, setClassOwner, setClassVersion, setDescription, setDescriptionAction, setId, setName, setParametersMap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceModel

public ResourceModel()
Constructor Store the class name

Method Detail

initParametersForAdmin

public void initParametersForAdmin(org.restlet.Context context)
Override this method to add parameters when the Context is needed Those parameters will be seen by the administrator when configuring a ResourceModel. WARNING: This method is only called for administration purpose.

Parameters:
context - The Context contains some attributes : ContextAttributes.SETTINGS : The SitoolsSettings parent : the parent application id appClassName : the parent application class name

addParam

public final void addParam(ResourceParameter param)
Method to add a parameter to the ResourceModel. The name of the parameter in used as the Map's Key

Parameters:
param - the parameter to add

getParameterByName

public final ResourceParameter getParameterByName(java.lang.String name)
Return a parameter by its name or null if the parameter cannot be found

Parameters:
name - the parameter name
Returns:
the corresponding parameter or null if it cannot be found

setParent

public final void setParent(java.lang.String parent)
Sets the value of parent

Parameters:
parent - the parent to set

getParent

public final java.lang.String getParent()
Gets the parent value

Returns:
the parent

setResourceClassName

public final void setResourceClassName(java.lang.String resourceClassName)
Sets the name of the class implementing the Resource

Parameters:
resourceClassName - the resourceClassName to set

getResourceClassName

public final java.lang.String getResourceClassName()
Gets the name of the class implementing the Resource

Returns:
the name of the class implementing the Resource

getValidator

public Validator<ResourceModel> getValidator()
Description copied from interface: Validable
Get the Validator on a Object

Specified by:
getValidator in interface Validable
Returns:
the validator on a object

completeAttachUrlWith

public final void completeAttachUrlWith(java.lang.String path)
Method to complete the initial default url attachment

Parameters:
path - the path for completion

setApplicationClassName

public void setApplicationClassName(java.lang.String applicationClassName)
Sets the class name of the application to which the Resource can be attached The class name must be complete (with full package declaration)

Parameters:
applicationClassName - the applicationClassName to set

getApplicationClassName

public java.lang.String getApplicationClassName()
Gets the applicationClassName value

Returns:
the applicationClassName

setDataSetSelection

public void setDataSetSelection(DataSetSelectionType dataSetSelection)
Sets the value of dataSetSelection. It is use to tell whether or not this Resource can be applied on selection of records in the client interface.

It is only used for datasets resources and in the client interface. Only SINGLE, MULTIPLE, ALL resources are displayed in the client interface

Parameters:
dataSetSelection - the dataSetSelection to set

getDataSetSelection

public DataSetSelectionType getDataSetSelection()
Gets the dataSetSelection value

Returns:
the dataSetSelection

getBehavior

public ResourceBehaviorType getBehavior()
Gets the behavior value.It is use to tell the client interface behavior after calling the resource.

Returns:
the behavior

setBehavior

public void setBehavior(ResourceBehaviorType behavior)
Sets the value of behavior

Parameters:
behavior - the behavior to set

getImage

public java.lang.String getImage()
Gets the image value

Returns:
the image

setImage

public void setImage(java.lang.String image)
Sets the value of image

Parameters:
image - the image to set


Copyright © 2010-2013 CNES. All Rights Reserved.