Package org.openbravo.service.datasource
Class NoteDataSource
- java.lang.Object
-
- org.openbravo.service.datasource.BaseDataSourceService
-
- org.openbravo.service.datasource.DefaultDataSourceService
-
- org.openbravo.service.datasource.NoteDataSource
-
- All Implemented Interfaces:
DataSourceService
public class NoteDataSource extends DefaultDataSourceService
A data source for the notes which manages the security. Checks if a user has access to the record of the note.- Author:
- NaroaIriarte
-
-
Constructor Summary
Constructors Constructor Description NoteDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
add(Map<String,String> parameters, String content)
Execute an insert action.void
checkEditDatasourceAccess(Map<String,String> parameter)
This method allows to implement a security access to a DataSource when it is used add(), update() or remove() methods.void
checkFetchDatasourceAccess(Map<String,String> parameter)
This method allows to implement a security access to a DataSource when it is used fetch() method.String
fetch(Map<String,String> parameters)
Execute a query request and return the result as a json string.String
remove(Map<String,String> parameters)
Execute a delete action.-
Methods inherited from class org.openbravo.service.datasource.DefaultDataSourceService
add, addFetchParameters, fetch, fetch, getDataSourceProperties, getInitialProperties, remove, update
-
Methods inherited from class org.openbravo.service.datasource.BaseDataSourceService
getDataSource, getDataUrl, getEntity, getName, getTemplate, getWhereAndFilterClause, getWhereClause, handleExceptionUnsecuredDSAccess, setDataSource, setDataUrl, setEntity, setName, setWhereClause
-
-
-
-
Method Detail
-
fetch
public String fetch(Map<String,String> parameters)
Description copied from interface:DataSourceService
Execute a query request and return the result as a json string.- Specified by:
fetch
in interfaceDataSourceService
- Overrides:
fetch
in classDefaultDataSourceService
- Parameters:
parameters
- the parameters often coming from the HTTP request- Returns:
- the json result string
-
add
public String add(Map<String,String> parameters, String content)
Description copied from interface:DataSourceService
Execute an insert action.- Specified by:
add
in interfaceDataSourceService
- Overrides:
add
in classDefaultDataSourceService
- Parameters:
parameters
- the parameters often coming from the HTTP requestcontent
- , the request content, is assumed to be a json string- Returns:
- the result message as a json string
-
remove
public String remove(Map<String,String> parameters)
Description copied from interface:DataSourceService
Execute a delete action. The id of the deleted record is present in the parameters.- Specified by:
remove
in interfaceDataSourceService
- Overrides:
remove
in classDefaultDataSourceService
- Parameters:
parameters
- the parameters often coming from the HTTP request- Returns:
- the result message as a json string
-
checkEditDatasourceAccess
public void checkEditDatasourceAccess(Map<String,String> parameter)
Description copied from interface:DataSourceService
This method allows to implement a security access to a DataSource when it is used add(), update() or remove() methods. It can be overridden in specific DataSources to apply a particular security mechanism.- Specified by:
checkEditDatasourceAccess
in interfaceDataSourceService
- Overrides:
checkEditDatasourceAccess
in classBaseDataSourceService
-
checkFetchDatasourceAccess
public void checkFetchDatasourceAccess(Map<String,String> parameter)
Description copied from interface:DataSourceService
This method allows to implement a security access to a DataSource when it is used fetch() method. It can be overridden in specific DataSources to apply a particular security mechanism.- Specified by:
checkFetchDatasourceAccess
in interfaceDataSourceService
- Overrides:
checkFetchDatasourceAccess
in classBaseDataSourceService
-
-