public abstract class AbstractController<S extends CrudWriteService> extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
FACESREDIRECTTRUE
can be appended to an outcome of an action is a redirect is desired.
|
| Constructor and Description |
|---|
AbstractController() |
| Modifier and Type | Method and Description |
|---|---|
String |
diacriticsKeyBoard()
for use in primefaces keyboard layoutTemplate
|
S |
getCrudWriteService() |
protected abstract void |
initCrudWriteService(S crudWriteService)
implement, annotate with @Inject (@EJB should work but no success yet)
and call
setCrudWriteService(org.fryske_akademy.ejb.CrudWriteService) |
protected <T extends EntityInterface> |
persist(T edited,
JsfUtil.PersistAction persistAction)
Call
persist(org.fryske_akademy.jpa.EntityInterface, org.fryske_akademy.jsf.util.JsfUtil.PersistAction, java.lang.String)
with persisAction + " success" |
protected <T extends EntityInterface> |
persist(T edited,
JsfUtil.PersistAction persistAction,
String successMessage)
Calls
CrudWriteService.create(java.io.Serializable), update or
delete, calls JsfUtil.addSuccessMessage(java.lang.String) with
the succesMessage appended with the entity id, and in case of an exception calls JsfUtil.handleException(java.lang.Exception, java.lang.String). |
protected void |
setCrudWriteService(S crudWriteService)
call this from your Inject annotated set method
|
public static final String FACESREDIRECTTRUE
public final S getCrudWriteService()
protected <T extends EntityInterface> T persist(T edited, JsfUtil.PersistAction persistAction)
persist(org.fryske_akademy.jpa.EntityInterface, org.fryske_akademy.jsf.util.JsfUtil.PersistAction, java.lang.String)
with persisAction + " success"T - edited - persistAction - protected <T extends EntityInterface> T persist(T edited, JsfUtil.PersistAction persistAction, String successMessage)
CrudWriteService.create(java.io.Serializable), update or
delete, calls JsfUtil.addSuccessMessage(java.lang.String) with
the succesMessage appended with the entity id, and in case of an exception calls JsfUtil.handleException(java.lang.Exception, java.lang.String).edited - persistAction - successMessage - the message with the entity id appendedpublic String diacriticsKeyBoard()
protected final void setCrudWriteService(S crudWriteService)
crudWriteService - protected abstract void initCrudWriteService(S crudWriteService)
setCrudWriteService(org.fryske_akademy.ejb.CrudWriteService)crudWriteService - Copyright © 2018 Fryske Akademy. All rights reserved.