fr.cnes.sitools.project
Class AbstractProjectResource

java.lang.Object
  extended by ExtendedWadlServerResource
      extended by fr.cnes.sitools.common.resource.AbstractSitoolsResource
          extended by fr.cnes.sitools.common.SitoolsResource
              extended by fr.cnes.sitools.project.AbstractProjectResource
Direct Known Subclasses:
ActivationProjectResource, ProjectCollectionResource, ProjectDatasetCollectionResource, ProjectExpositionResource, ProjectGraphExpositionResource, ProjectListDatasetsResource, ProjectListDatasetViewsResource, ProjectListFeedsResource, ProjectListFormsProjectResource, ProjectListFormsResource, ProjectListGuiServicesResource, ProjectListOpensearchResource, ProjectListProjectModulesResource, ProjectNotificationResource, ProjectResource

public abstract class AbstractProjectResource
extends SitoolsResource

Abstract Resource class for Projects management

Author:
jp.boignard (AKKA Technologies)

Field Summary
 
Fields inherited from class fr.cnes.sitools.common.SitoolsResource
DEFAULT_MEDIATYPE
 
Constructor Summary
AbstractProjectResource()
          Default constructor
 
Method Summary
 Response checkUnicity(Project projectInput, boolean includeProjectInput)
          Check that the name and the sitoolsUserAttachment are unique over the project collection includeProjectInput is used to specify whether or not to include projectInput in the verification process ( for example when updating a project )
 void doInit()
          Initiate the resource
 DataSet getDataset(java.lang.String id)
          Get the dataset object with the given id
 Project getObject(org.restlet.representation.Representation representation, org.restlet.representation.Variant variant)
          Get the object from the representation
 Resource getObjectResource(org.restlet.representation.Representation representation, org.restlet.representation.Variant variant)
          Get the object from the representation
 AbstractProjectApplication getProjectApplication()
          Get the project application object
 java.lang.String getProjectId()
          Get the project identifier
 org.restlet.representation.Representation getRepresentation(Response response, org.restlet.data.MediaType media)
          Response to Representation
 SitoolsStore<Project> getStore()
          Get the store associated to the application
 void registerObserver(Project input)
          Register an observer
 void unregisterObserver(Project input)
          Unregister an observer
 
Methods inherited from class fr.cnes.sitools.common.SitoolsResource
addStandardGetRequestInfo, addStandardInternalServerErrorInfo, addStandardNotificationInfo, addStandardObjectResponseInfo, addStandardPostOrPutRequestInfo, addStandardResourceCollectionFilterInfo, addStandardResponseInfo, addStandardSimpleResponseInfo, configure, getNotificationObject, getRepresentation, getSettings, getSitoolsApplication, getSitoolsSetting, trace, trace
 
Methods inherited from class fr.cnes.sitools.common.resource.AbstractSitoolsResource
getMediaType, sitoolsDescribe
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractProjectResource

public AbstractProjectResource()
Default constructor

Method Detail

doInit

public final void doInit()
Description copied from class: SitoolsResource
Initiate the resource


getRepresentation

public org.restlet.representation.Representation getRepresentation(Response response,
                                                                   org.restlet.data.MediaType media)
Response to Representation

Overrides:
getRepresentation in class SitoolsResource
Parameters:
response - the response to treat
media - the media to use
Returns:
Representation

getObject

public final Project getObject(org.restlet.representation.Representation representation,
                               org.restlet.representation.Variant variant)
Get the object from the representation

Parameters:
representation - the representation to use
variant - the variant to use
Returns:
a project

getObjectResource

public final Resource getObjectResource(org.restlet.representation.Representation representation,
                                        org.restlet.representation.Variant variant)
                                 throws java.io.IOException
Get the object from the representation

Parameters:
representation - the representation to use
variant - the variant to use
Returns:
a project
Throws:
java.io.IOException - if there is an error while deserializing a Java Object

registerObserver

public final void registerObserver(Project input)
Register an observer

Parameters:
input - the project as input

unregisterObserver

public final void unregisterObserver(Project input)
Unregister an observer

Parameters:
input - the project to unregister

getDataset

public final DataSet getDataset(java.lang.String id)
Get the dataset object with the given id

Parameters:
id - the id of the dataset
Returns:
a dataset object corresponding to the given id

getProjectId

public final java.lang.String getProjectId()
Get the project identifier

Returns:
the project ID

getStore

public final SitoolsStore<Project> getStore()
Get the store associated to the application

Returns:
the store available for this resource

getProjectApplication

public final AbstractProjectApplication getProjectApplication()
Get the project application object

Returns:
the project application

checkUnicity

public final Response checkUnicity(Project projectInput,
                                   boolean includeProjectInput)
Check that the name and the sitoolsUserAttachment are unique over the project collection includeProjectInput is used to specify whether or not to include projectInput in the verification process ( for example when updating a project )

Parameters:
projectInput - the project to check with the collection
includeProjectInput - true to include the project in the verification, false otherwise
Returns:
a Response with the error message if the checking fail, null otherwise


Copyright © 2010-2013 CNES. All Rights Reserved.