fr.cnes.sitools.dataset.database.common
Class DataSetExplorerUtil

java.lang.Object
  extended by fr.cnes.sitools.dataset.database.common.DataSetExplorerUtil

public class DataSetExplorerUtil
extends java.lang.Object

DBExplorerResource using DataSource for pooled connections

Author:
AKKA Technologies [#3355053]
2011/07/06 d.arpin {Rename the method getColumnFromQuery -> getColumnFromDistinctQuery. Rename getColumnVisible -> getSQLColumnVisible. Add getAllColumnVisible}

Constructor Summary
DataSetExplorerUtil(DataSetApplication application, org.restlet.Request request, org.restlet.Context context)
          Constructor with minimal arguments to build a Database Request parameters
 
Method Summary
static void addDatasetExplorerGetFilterInfo(org.restlet.ext.wadl.MethodInfo info, FilterChained filterChained)
          Add the Dataset Filter info to the MethodInfo
static void addDatasetExplorerGetRequestInfo(org.restlet.ext.wadl.MethodInfo info)
          Add the DatasetExplorer info to the MethodInfo
 java.util.List<Column> getAllColumnVisible()
          Get the list of All visible column Warning : don't use this method to build SQL request, it will fail if there is some virtual columns
 DataSetApplication getApplication()
          Gets the application value
 java.util.List<Predicat> getArrayPredicatsPostFilters()
          Gets the arrayPredicatsPostFilters value
 java.lang.String getBaseRef()
          Get the base reference
 java.util.List<Column> getColumnFromDataset()
          Get the list of column defined in the DataSet
 Column getColumnFromDistinctQuery()
          Get a Column of the specified ColumnALias
 java.util.List<Column> getColumnModel()
          Get the model of columns
 org.restlet.Context getContext()
          Gets the context value
 boolean getCountIsDone()
          Read extend request parameter -> integer - 0 by default
 DatabaseRequestParameters getDatabaseParams()
          Gets the databaseParams value
 DataSet getDataSet()
          Get the DataSet associated to that resource
 SitoolsDataSource getDataSource()
          Gets the SQL DataSource
 java.lang.Boolean getDistinct()
          Get distinct
 int getFetchSize()
          Gets the fetchSize value
 org.restlet.representation.Representation getFile(java.lang.String fileUrl, org.restlet.security.User user)
          Gets the representation of a File
 org.restlet.data.Form getForm()
          Get the form with pagination
 java.lang.String getFromTableName(int i)
          Get the reference from table
 int getMaxrows()
          Gets the maxrows value
 Multisort getOrderBy()
          Read extend request parameter -> integer - 0 by default
 int getPaginationExtend()
          Read extend request parameter -> integer - 0 by default
 int getPaginationStartRecord()
          Read startRecord request parameter -> integer - 0 by default
 java.util.ArrayList<Predicat> getPredicats()
          Convert the request parameters to the list of predicates
 java.lang.String getQueryDistinct()
          Get the QueryDistinct
 java.lang.String getRecordName()
          Gets the recordName value
 org.restlet.Request getRequest()
          Gets the request value
 java.lang.String getSchemaName(int i)
          Gets the schemaName value
 java.util.List<Column> getSQLColumnVisible()
          Get the list of the SQL visible column
 java.util.List<Structure> getStructures()
          Gets the structure value
 java.lang.String getTableName(int i)
          Gets the tableName value
static java.lang.String getTemplateForm()
          Gets the templateForm value
 void setApplication(DataSetApplication application)
          Sets the value of application
 void setBaseRef(java.lang.String bref)
          Set the base reference of the resource
 void setContext(org.restlet.Context context)
          Sets the value of context
 void setDatabaseParams(DatabaseRequestParameters databaseParams)
          Sets the value of databaseParams
 void setRecordName(java.lang.String recordName)
          Sets the value of recordName
 void setRequest(org.restlet.Request request)
          Sets the value of request
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSetExplorerUtil

public DataSetExplorerUtil(DataSetApplication application,
                           org.restlet.Request request,
                           org.restlet.Context context)
Constructor with minimal arguments to build a Database Request parameters

Parameters:
application - the DataSetApplication
request - the Request
context - the Context
Method Detail

getRecordName

public java.lang.String getRecordName()
Gets the recordName value

Returns:
the recordName

setRecordName

public void setRecordName(java.lang.String recordName)
Sets the value of recordName

Parameters:
recordName - the recordName to set

getRequest

public org.restlet.Request getRequest()
Gets the request value

Returns:
the request

setRequest

public void setRequest(org.restlet.Request request)
Sets the value of request

Parameters:
request - the request to set

getDataSource

public final SitoolsDataSource getDataSource()
Gets the SQL DataSource

Returns:
SitoolsDataSource

getTableName

public final java.lang.String getTableName(int i)
Gets the tableName value

Parameters:
i - index
Returns:
the tableName

getQueryDistinct

public final java.lang.String getQueryDistinct()
Get the QueryDistinct

Returns:
String Value of the filter for Distinct results

getColumnFromDistinctQuery

public final Column getColumnFromDistinctQuery()
Get a Column of the specified ColumnALias

Returns:
a column

getSQLColumnVisible

public final java.util.List<Column> getSQLColumnVisible()
Get the list of the SQL visible column

Returns:
a list of column set to visible or Asked by the request

getAllColumnVisible

public final java.util.List<Column> getAllColumnVisible()
Get the list of All visible column Warning : don't use this method to build SQL request, it will fail if there is some virtual columns

Returns:
a list of all columns set to visible or Asked by the request

getColumnFromDataset

public final java.util.List<Column> getColumnFromDataset()
Get the list of column defined in the DataSet

Returns:
The list of column defined in the DataSet

getSchemaName

public final java.lang.String getSchemaName(int i)
Gets the schemaName value

Parameters:
i - index
Returns:
the schemaName

getFromTableName

public final java.lang.String getFromTableName(int i)
Get the reference from table

Parameters:
i - index
Returns:
the reference

getStructures

public final java.util.List<Structure> getStructures()
Gets the structure value

Returns:
the structure

getBaseRef

public final java.lang.String getBaseRef()
Get the base reference

Returns:
the base reference

getForm

public final org.restlet.data.Form getForm()
Get the form with pagination

Returns:
the form

getPaginationStartRecord

public final int getPaginationStartRecord()
Read startRecord request parameter -> integer - 0 by default

Returns:
startRecord

getPaginationExtend

public final int getPaginationExtend()
Read extend request parameter -> integer - 0 by default

Returns:
extend

getCountIsDone

public final boolean getCountIsDone()
Read extend request parameter -> integer - 0 by default

Returns:
extend

getOrderBy

public final Multisort getOrderBy()
Read extend request parameter -> integer - 0 by default

Returns:
extend

getPredicats

public final java.util.ArrayList<Predicat> getPredicats()
Convert the request parameters to the list of predicates

Returns:
the list of predicates

getColumnModel

public final java.util.List<Column> getColumnModel()
Get the model of columns

Returns:
a list of columns

getArrayPredicatsPostFilters

public final java.util.List<Predicat> getArrayPredicatsPostFilters()
Gets the arrayPredicatsPostFilters value

Returns:
the arrayPredicatsPostFilters

getDistinct

public final java.lang.Boolean getDistinct()
Get distinct

Returns:
true if distinct

getDataSet

public final DataSet getDataSet()
Get the DataSet associated to that resource

Returns:
the DataSet associated to that resource

getDatabaseParams

public final DatabaseRequestParameters getDatabaseParams()
Gets the databaseParams value

Returns:
the databaseParams

setDatabaseParams

public final void setDatabaseParams(DatabaseRequestParameters databaseParams)
Sets the value of databaseParams

Parameters:
databaseParams - the databaseParams to set

getFile

public final org.restlet.representation.Representation getFile(java.lang.String fileUrl,
                                                               org.restlet.security.User user)
Gets the representation of a File

Parameters:
fileUrl - the url of the file
user - the user
Returns:
the Representation of a File

addDatasetExplorerGetRequestInfo

public static void addDatasetExplorerGetRequestInfo(org.restlet.ext.wadl.MethodInfo info)
Add the DatasetExplorer info to the MethodInfo

Parameters:
info - the MethodInfo

addDatasetExplorerGetFilterInfo

public static void addDatasetExplorerGetFilterInfo(org.restlet.ext.wadl.MethodInfo info,
                                                   FilterChained filterChained)
Add the Dataset Filter info to the MethodInfo

Parameters:
info - the MethodInfo
filterChained - the FilterChained

getApplication

public final DataSetApplication getApplication()
Gets the application value

Returns:
the application

setApplication

public void setApplication(DataSetApplication application)
Sets the value of application

Parameters:
application - the application to set

setBaseRef

public final void setBaseRef(java.lang.String bref)
Set the base reference of the resource

Parameters:
bref - the new base reference

getFetchSize

public final int getFetchSize()
Gets the fetchSize value

Returns:
the fetchSize

getMaxrows

public final int getMaxrows()
Gets the maxrows value

Returns:
the maxrows

getTemplateForm

public static java.lang.String getTemplateForm()
Gets the templateForm value

Returns:
the templateForm

setContext

public void setContext(org.restlet.Context context)
Sets the value of context

Parameters:
context - the context to set

getContext

public org.restlet.Context getContext()
Gets the context value

Returns:
the context


Copyright © 2010-2013 CNES. All Rights Reserved.