A many to many page extends com.manydesigns.portofino.pageactions.m2m.ManyToManyAction, you can override any method of it.
ManyToManyAction defines the following hooks, predefined methods to extend its behavior.
void prepareSave(Object newRelation)
This method is called before saving a new relationship and can be customized to manage pre conditions.
Object saveNewRelation(Object pk, PropertyAccessor onePropertyAccessor, PropertyAccessor manyPropertyAccessor)
This method is responsible to persist the new relationship on the db.
- pk, the primary of the Relation
- onePropertyAccessor, accessor to the one property
- manyPropertyAccessor, accessor to the many property
void deleteRelation(Object rel)
This method is responsible to delete the relationship. E.g. you can customize this method for notification.
Parameter: rel, the relationship
The action give to you the following objects that you can use in your methods:
The Stripes context, e.g. you can obtain the request from it.
A string with the current path.
A com.manydesigns.portofino.model.Model, which stores all the information about the databases (e.g. tables, columns, ...).
This object stores all the configuration properties.
The Application object which store all common data of your application(e.g. all Hibernate sessions).
The org.slf4j.Logger that you can use to log your activities.