I am working on a project using ISIS 1.16.2. I have a superclass, called ConfigurationItem
, which has some common properties (name
, createdTimestamp
etc.).
For example it has a delete action method, annotated with @Action(invokeOn = InvokeOn.OBJECT_AND_COLLECTION, ...)
, which I need to be callable from entitys detail view as well as from collection views with selection boxes.
Example:
public class ConfigurationItem {
@Action(
invokeOn = InvokeOn.OBJECT_AND_COLLECTION,
semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE,
domainEvent = DeletedDomainEvent.class)
public Object delete() {
repositoryService.remove(this);
return null;
}
// ...
}
public class ConfigurationItems {
@Action(semantics = SemanticsOf.SAFE)
public List<T> listAll() {
return repositoryService.allInstances(<item-subclass>.class);
}
// ...
}
This works pretty well but the "invokeOn" annotation is now deprecated. The JavaDoc says that one should switch to @Action(associateWith="...")
but I don't know how to transfer the semantics of 'InvokeOn' since I have no collection field for reference.
Instead I only have the collection of objects returned by the database retrieve action.
My question is: How do I transfer the deprecated @Action(invokeOn=...)
semantics to the new @Action(associateWith="...")
concept for collection return values with no backed property field?
Thanks in advance!