T
- public class ObjectSelectProvider<T extends Persistent> extends JsonDataAdapter<T> implements ReadWriteJsonData<T>
JsonDataAdapter
implementation also supports data manipulation via ReadWriteJsonData
Modifier and Type | Field and Description |
---|---|
protected List<String> |
displayFields |
protected Set<String> |
i18nFields |
protected Map<String,String> |
params |
config, objects, parameters, request, requestedId
Constructor and Description |
---|
ObjectSelectProvider() |
Modifier and Type | Method and Description |
---|---|
void |
delete(Map<String,Object> data)
called for DELETE requests
should delete the object provided in the
JsonData.init(javax.servlet.http.HttpServletRequest, String, String, com.groiss.gui.NavigationTreeNode) |
protected void |
delete(T object,
Map<String,Object> data) |
protected T |
get(String objectId) |
protected Class<? extends T> |
getBaseClass() |
protected Map<String,Object> |
getData(T p) |
protected List<String> |
getDisplayFields() |
protected List<String> |
getFields()
what object-properties should be used
may be called multiple times
|
protected List<T> |
getObjects()
get all required objects. basic filtering should be done here
is called once
|
protected String |
getRightId()
what right has to be checked when listing objects.
|
protected Object |
getValue(T object,
String field)
will be called for each object and each field
|
void |
init(HttpServletRequest req,
String par,
String id,
NavigationTreeNode configuration)
called once when initalizing the model
|
String |
insert(Map<String,Object> data)
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 |
protected void |
insert(T object,
Map<String,Object> data) |
protected boolean |
isCrudEnabled()
may be extended and crud-operations disabled
|
protected void |
setValues(T o,
Map<String,Object> data) |
void |
update(Map<String,Object> data)
called for PUT requests
update the object provided in the
JsonData.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 |
protected void |
update(T object,
Map<String,Object> data) |
getData, getFavorites, onRowComplete, supportsPaging
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getData, supportsPaging
protected boolean isCrudEnabled()
true
by defaultprotected String getRightId()
protected Map<String,Object> getData(T p) throws Exception
getData
in class JsonDataAdapter<T extends Persistent>
Exception
public void init(HttpServletRequest req, String par, String id, NavigationTreeNode configuration) throws Exception
JsonData
init
in interface JsonData
init
in class JsonDataAdapter<T extends Persistent>
req
- the current servlet-requestpar
- the trailing part of the REST-URLid
- the id when using single-object-requestsconfiguration
- configuration node holding more informationException
protected List<T> getObjects()
JsonDataAdapter
getObjects
in class JsonDataAdapter<T extends Persistent>
protected T get(String objectId)
get
in class JsonDataAdapter<T extends Persistent>
protected List<String> getFields()
JsonDataAdapter
getFields
in class JsonDataAdapter<T extends Persistent>
protected Object getValue(T object, String field) throws Exception
JsonDataAdapter
getValue
in class JsonDataAdapter<T extends Persistent>
Exception
public final String insert(Map<String,Object> data)
ReadWriteJsonData
JsonData.getData()
has to return a single row with the details for the new objectinsert
in interface ReadWriteJsonData<T extends Persistent>
data
- the parameters provided from the requestpublic final void update(Map<String,Object> data)
ReadWriteJsonData
JsonData.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 objectupdate
in interface ReadWriteJsonData<T extends Persistent>
public final void delete(Map<String,Object> data)
ReadWriteJsonData
JsonData.init(javax.servlet.http.HttpServletRequest, String, String, com.groiss.gui.NavigationTreeNode)
delete
in interface ReadWriteJsonData<T extends Persistent>
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.