de.iai.ilcd.services
Class AbstractDataSetResource<T extends DataSet>

java.lang.Object
  extended by de.iai.ilcd.services.AbstractDataSetResource<T>
Direct Known Subclasses:
ContactResource, FlowPropertyResource, FlowResource, LCIAMethodResource, ProcessResource, SourceResource, UnitGroupResource

public abstract class AbstractDataSetResource<T extends DataSet>
extends java.lang.Object

REST web service for data sets


Field Summary
static java.lang.String FORMAT_HTML
          URL parameter value for HTML format type
static java.lang.String FORMAT_XML
          URL parameter value for XML format type
static java.lang.String PARAM_FORMAT
          URL parameter key for format type
static java.lang.String PARAM_VIEW
          URL parameter key for view type
static java.lang.String VIEW_FULL
          URL parameter value for full view type
static java.lang.String VIEW_METADATA
          URL parameter value for meta data view type
static java.lang.String VIEW_OVERVIEW
          URL parameter value for overview view type
 
Constructor Summary
AbstractDataSetResource(DataSetType modelType, de.fzk.iai.ilcd.api.dataset.ILCDTypes apiType)
          Create an abstract data set resource
 
Method Summary
 javax.ws.rs.core.Response getDataSet(java.lang.String uuid)
          Get a data set by UUID string
 javax.ws.rs.core.StreamingOutput getDataSets(boolean search, int startIndex, int pageSize)
          Retrieves representation of an instance of de.iai.ilcd.services.ContactResource
protected abstract  java.lang.String getDataSetTypeName()
          Get the name of the data set type for the creation of error/info messages
protected abstract  DataSetDao<T,?> getFreshDaoInstance()
          Create a fresh data access object to work with
protected abstract  java.lang.String getHTMLFullViewTemplatePath()
          Get the path to the template for the HTML full view page This is typically something like /html/$datasettype$.vm
protected abstract  java.lang.String getHTMLOverviewTemplatePath()
          Get the path to the template for the HTML overview page This is typically something like /html/$datasettype$_overview.vm
protected abstract  java.lang.String getXMLListTemplatePath()
          Deprecated.  
protected abstract  java.lang.String getXMLTemplatePath()
          Deprecated.  
 javax.ws.rs.core.Response importByFileUpload(java.io.InputStream fileInputStream)
          POST method for importing new process data set sent by form
 javax.ws.rs.core.Response importByXml(java.io.InputStream fileInputStream)
          POST method for importing new process data set sent directly
 void putXml(java.lang.String content)
          PUT method for updating or creating an instance of ContactResource
protected abstract  boolean userRequiresFullViewRights()
          Flag to set, if full view rights shall be checked in user bean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_VIEW

public static final java.lang.String PARAM_VIEW
URL parameter key for view type

See Also:
Constant Field Values

PARAM_FORMAT

public static final java.lang.String PARAM_FORMAT
URL parameter key for format type

See Also:
Constant Field Values

FORMAT_HTML

public static final java.lang.String FORMAT_HTML
URL parameter value for HTML format type

See Also:
Constant Field Values

FORMAT_XML

public static final java.lang.String FORMAT_XML
URL parameter value for XML format type

See Also:
Constant Field Values

VIEW_OVERVIEW

public static final java.lang.String VIEW_OVERVIEW
URL parameter value for overview view type

See Also:
Constant Field Values

VIEW_FULL

public static final java.lang.String VIEW_FULL
URL parameter value for full view type

See Also:
Constant Field Values

VIEW_METADATA

public static final java.lang.String VIEW_METADATA
URL parameter value for meta data view type

See Also:
Constant Field Values
Constructor Detail

AbstractDataSetResource

public AbstractDataSetResource(DataSetType modelType,
                               de.fzk.iai.ilcd.api.dataset.ILCDTypes apiType)
Create an abstract data set resource

Parameters:
dao - the data access object to work with
Method Detail

getFreshDaoInstance

protected abstract DataSetDao<T,?> getFreshDaoInstance()
Create a fresh data access object to work with

Returns:
fresh data access object

getXMLListTemplatePath

@Deprecated
protected abstract java.lang.String getXMLListTemplatePath()
Deprecated. 

Get the path to the template for the XML data set list view This is typically something like /xml/$datasettype$s.vm

Returns:
path to the template for the XML data set list view

getXMLTemplatePath

@Deprecated
protected abstract java.lang.String getXMLTemplatePath()
Deprecated. 

Get the path to the template for the XML single data set view This is typically something like /xml/$datasettype$.vm

Returns:
path to the template for the XML single data set view

getHTMLFullViewTemplatePath

protected abstract java.lang.String getHTMLFullViewTemplatePath()
Get the path to the template for the HTML full view page This is typically something like /html/$datasettype$.vm

Returns:
path to the template for the HTML full view page

getHTMLOverviewTemplatePath

protected abstract java.lang.String getHTMLOverviewTemplatePath()
Get the path to the template for the HTML overview page This is typically something like /html/$datasettype$_overview.vm

Returns:
path to the template for the HTML overview page

getDataSetTypeName

protected abstract java.lang.String getDataSetTypeName()
Get the name of the data set type for the creation of error/info messages

Returns:
name of the data set type for the creation of error/info messages

userRequiresFullViewRights

protected abstract boolean userRequiresFullViewRights()
Flag to set, if full view rights shall be checked in user bean

Returns:
true if full view rights shall be checked, else false

getDataSets

public javax.ws.rs.core.StreamingOutput getDataSets(boolean search,
                                                    int startIndex,
                                                    int pageSize)
Retrieves representation of an instance of de.iai.ilcd.services.ContactResource

Returns:
an instance of javax.ws.rs.core.StreamingOutput

getDataSet

public javax.ws.rs.core.Response getDataSet(java.lang.String uuid)
Get a data set by UUID string

Parameters:
uuid - UUID string
Returns:
XML or HTML response for client

putXml

public void putXml(java.lang.String content)
PUT method for updating or creating an instance of ContactResource

Parameters:
content - representation for the resource

importByFileUpload

public javax.ws.rs.core.Response importByFileUpload(java.io.InputStream fileInputStream)
POST method for importing new process data set sent by form

Parameters:
fileInputStream - XML data to import (from form)
Returns:
response for client

importByXml

public javax.ws.rs.core.Response importByXml(java.io.InputStream fileInputStream)
POST method for importing new process data set sent directly

Parameters:
fileInputStream - XML data to import
Returns:
response for client