Package com.axelor.rpc
Class Resource<T extends Model>
java.lang.Object
com.axelor.rpc.Resource<T>
This class defines CRUD like interface.
-
Constructor Summary
ConstructorsConstructorDescriptionResource
(TypeLiteral<T> typeLiteral, jakarta.inject.Provider<JpaSecurity> security, Event<PreRequest> preRequest, Event<PostRequest> postRequest) -
Method Summary
Modifier and TypeMethodDescriptionaction
(ActionRequest request) copy
(long id) fields()
protected String[]
filterPermitted
(Object bean, String... names) Filters given field names so that only base fields and readable related fields remains.protected void
filterPermitted
(Consumer<String> permitted, Consumer<String> notPermitted, Object bean, String... names) Class
<?> getModel()
Returns the resource class.getRecordName
(Request request) Get the name of the record.boolean
isPermitted
(JpaSecurity.AccessType accessType, Long id) static Response
perms()
read
(long id) protected void
removeNotPermitted
(Map<String, Object> map, String... names) Removes not permitted fields in specified map.toMapCompact
(Object bean) updateMass
(Request request)
-
Constructor Details
-
Resource
@Inject public Resource(TypeLiteral<T> typeLiteral, jakarta.inject.Provider<JpaSecurity> security, Event<PreRequest> preRequest, Event<PostRequest> postRequest)
-
-
Method Details
-
getModel
Returns the resource class. -
fields
-
models
-
perms
-
perms
-
perms
-
search
-
export
-
export
-
read
-
fetch
-
verify
-
save
-
updateMass
-
remove
-
remove
-
copy
-
action
-
getRecordName
Get the name of the record. This method should be used to get the value of name field if it's a function field.- Parameters:
request
- the request containing the current values of the record- Returns:
- response with the updated values with record name
-
isPermitted
-
removeNotPermitted
Removes not permitted fields in specified map.- Parameters:
map
- datanames
- field names
-
filterPermitted
Filters given field names so that only base fields and readable related fields remains.- Parameters:
bean
- objectnames
- field names- Returns:
- readable field names
-
filterPermitted
-
toMap
-
toMapCompact
-