Package com.groiss.smartclient
Class ObjectSelectProvider<T extends Persistent>
java.lang.Object
com.groiss.smartclient.JsonDataAdapter<T>
com.groiss.smartclient.ObjectSelectProvider<T>
- All Implemented Interfaces:
JsonData
,ReadWriteJsonData
public class ObjectSelectProvider<T extends Persistent>
extends JsonDataAdapter<T>
implements ReadWriteJsonData
default
JsonDataAdapter
implementation also supports data manipulation via ReadWriteJsonData
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Fields inherited from class com.groiss.smartclient.JsonDataAdapter
config, objects, parameters, request, requestedId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Can be defined in the XML configuration, default is false (no insert, update, delete allowed).final void
called for DELETE requests should delete the object provided in theJsonData.init(javax.servlet.http.HttpServletRequest, String, String, com.groiss.gui.NavigationTreeNode)
protected void
Delete an objectprotected T
what object-properties should be used may be called multiple timesget all required objects. basic filtering should be done here is called onceprotected String
what right has to be checked when listing objects.protected Object
will be called for each object and each fieldvoid
init
(HttpServletRequest req, String par, String id, NavigationTreeNode configuration) called once when initalizing the modelfinal String
called for POST requests should create a new object and return the new object's objectId after the successful operation,JsonData.getData()
has to return a single row with the details for the new objectprotected void
Insert a new objectprotected boolean
Deprecated, for removal: This API element is subject to removal in a future version.protected void
final void
called for PUT requests update the object provided in theJsonData.init(javax.servlet.http.HttpServletRequest, String, String, com.groiss.gui.NavigationTreeNode)
with the given data after the successful operation,JsonData.getData()
has to return a single row with the details for the new objectprotected void
Update an objectMethods inherited from class com.groiss.smartclient.JsonDataAdapter
getData, getFavorites, onRowComplete
-
Field Details
-
i18nFields
-
params
-
displayFields
-
allowModifications
protected boolean allowModifications
-
-
Constructor Details
-
ObjectSelectProvider
public ObjectSelectProvider()
-
-
Method Details
-
isCrudEnabled
Deprecated, for removal: This API element is subject to removal in a future version.useallowModifications()
instead -
allowModifications
protected boolean allowModifications()Can be defined in the XML configuration, default is false (no insert, update, delete allowed).- Returns:
- the defined value
-
getRightId
what right has to be checked when listing objects. "view" by default- Returns:
- id of right to be checked
-
getDisplayFields
-
getData
- Overrides:
getData
in classJsonDataAdapter<T extends Persistent>
- Throws:
Exception
-
getObjects
Description copied from class:JsonDataAdapter
get all required objects. basic filtering should be done here is called once- Specified by:
getObjects
in classJsonDataAdapter<T extends Persistent>
- Returns:
-
get
- Overrides:
get
in classJsonDataAdapter<T extends Persistent>
-
getFields
Description copied from class:JsonDataAdapter
what object-properties should be used may be called multiple times- Specified by:
getFields
in classJsonDataAdapter<T extends Persistent>
- Returns:
-
getValue
Description copied from class:JsonDataAdapter
will be called for each object and each field- Specified by:
getValue
in classJsonDataAdapter<T extends Persistent>
- Returns:
- Throws:
Exception
-
getBaseClass
-
setValues
-
insert
Description copied from interface:ReadWriteJsonData
called for POST requests should create a new object and return the new object's objectId after the successful operation,JsonData.getData()
has to return a single row with the details for the new object- Specified by:
insert
in interfaceReadWriteJsonData
- Parameters:
data
- the parameters provided from the request- Returns:
- the new objectId
-
insert
Insert a new object- Parameters:
object
- the new objectdata
- the parameters received from the request
-
update
Description copied from interface:ReadWriteJsonData
called for PUT requests update the object provided in theJsonData.init(javax.servlet.http.HttpServletRequest, String, String, com.groiss.gui.NavigationTreeNode)
with the given data after the successful operation,JsonData.getData()
has to return a single row with the details for the new object- Specified by:
update
in interfaceReadWriteJsonData
-
update
Update an object- Parameters:
object
- the object to updatedata
- the parameters received from the request
-
delete
Description copied from interface:ReadWriteJsonData
called for DELETE requests should delete the object provided in theJsonData.init(javax.servlet.http.HttpServletRequest, String, String, com.groiss.gui.NavigationTreeNode)
- Specified by:
delete
in interfaceReadWriteJsonData
-
delete
Delete an object- Parameters:
object
- the object to deletedata
- the parameters received from the request
-
allowModifications()
instead