public abstract class AbstractController<S extends CrudWriteService> extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractController.PersistAction |
| 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 javax.security.enterprise.SecurityContext |
getSecurityContext() |
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) |
<T extends EntityInterface> |
persist(T edited,
AbstractController.PersistAction persistAction)
Call
#persist(org.fryske_akademy.jpa.EntityInterface, org.fryske_akademy.jsf.util.PersistAction, java.lang.String)
with persisAction + " success" |
<T extends EntityInterface> |
persist(T edited,
AbstractController.PersistAction persistAction,
String successMessage)
|
<T extends EntityInterface> |
persist(T edited,
AbstractController.PersistAction persistAction,
String successMessage,
boolean callHandle)
Calls
CrudWriteService.create(java.io.Serializable), update or
delete, calls JsfUtil.addSuccessMessage(java.lang.String) with
the succesMessage appended with the entity (either converted by
Converter or toString. |
protected void |
setCrudWriteService(S crudWriteService)
call this from your Inject annotated set method
|
public static final String FACESREDIRECTTRUE
public final S getCrudWriteService()
public <T extends EntityInterface> T persist(T edited, AbstractController.PersistAction persistAction) throws Exception
#persist(org.fryske_akademy.jpa.EntityInterface, org.fryske_akademy.jsf.util.PersistAction, java.lang.String)
with persisAction + " success"T - edited - persistAction - Exceptionpublic <T extends EntityInterface> T persist(T edited, AbstractController.PersistAction persistAction, String successMessage) throws Exception
persist(org.fryske_akademy.jpa.EntityInterface, org.fryske_akademy.jsf.AbstractController.PersistAction, java.lang.String, boolean)
with trueT - edited - persistAction - successMessage - Exceptionpublic <T extends EntityInterface> T persist(T edited, AbstractController.PersistAction persistAction, String successMessage, boolean callHandle) throws Exception
CrudWriteService.create(java.io.Serializable), update or
delete, calls JsfUtil.addSuccessMessage(java.lang.String) with
the succesMessage appended with the entity (either converted by
Converter or toString. In case of an exception, when callHandle
is true, call
JsfUtil.handleException(java.lang.Exception, java.lang.String).edited - persistAction - successMessage - the message with the entity id appendedcallHandle - when true call JsfUtil.handleException(java.lang.Exception, java.lang.String).Exceptionpublic String diacriticsKeyBoard()
protected final void setCrudWriteService(S crudWriteService)
crudWriteService - protected abstract void initCrudWriteService(S crudWriteService)
setCrudWriteService(org.fryske_akademy.ejb.CrudWriteService)crudWriteService - protected javax.security.enterprise.SecurityContext getSecurityContext()
Copyright © 2018 Fryske Akademy. All rights reserved.