Package io.vertigo.ui.core
Class ViewContext
java.lang.Object
io.vertigo.ui.core.ViewContext
- All Implemented Interfaces:
Serializable
Liste des couples (clé, object) enregistrés.
- Author:
- npiedeloup
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ViewContextKey<String>Clée de l'id de context dans le context.static final ViewContextKey<String>Clée de l'instant de creation de context dans le context.static final ViewContextKey<FormMode>Clé de context du mode.static final ViewContextKey<Boolean>Clé de context du mode Create.static final ViewContextKey<Boolean>Clé de context du mode Edit.static final ViewContextKey<Boolean>Clé de context du mode ReadOnly. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasMap()<O extends io.vertigo.datamodel.structure.model.DtObject>
voidcheckDtListErrors(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) Vérifie les erreurs de la liste.<O extends io.vertigo.datamodel.structure.model.DtObject>
voidcheckDtoErrors(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) Vérifie les erreurs de l'objet.booleancontainsKey(Object key) findKey(io.vertigo.datamodel.structure.model.DtObject dtObject) getBoolean(ViewContextKey<Boolean> key) Optional<io.vertigo.datastore.filestore.model.FileInfoURI>getFileInfoURI(ViewContextKey<io.vertigo.datastore.filestore.model.FileInfoURI> contextKey) Get UI file uri.ArrayList<io.vertigo.datastore.filestore.model.FileInfoURI>getFileInfoURIs(ViewContextKey<io.vertigo.datastore.filestore.model.FileInfoURI> contextKey) Get UI file info uri list.getId()getInteger(ViewContextKey<Integer> key) getLong(ViewContextKey<Long> key) <O extends io.vertigo.datamodel.structure.model.DtObject>
SelectedFacetValuesgetSelectedFacetValues(ViewContextKey<FacetedQueryResult<O, FacetedQuery>> contextKey) Returns selectedFacetValues of a given facetedQuery.getString(ViewContextKey<String> key) <O extends io.vertigo.datamodel.structure.model.DtObject>
UiList<O>getUiList(ViewContextKey<O> key) <O extends io.vertigo.datamodel.structure.model.DtObject>
BasicUiListModifiable<O>getUiListModifiable(ViewContextKey<O> key) <O extends io.vertigo.datamodel.structure.model.DtObject>
UiObject<O>getUiObject(ViewContextKey<O> key) booleanisDirty()booleanbooleanbooleanvoidGénère un nouvel Id et passe le context en modifiable.voidpasse le context en non-modifiable.voidMark this context as Dirty : shouldn't be stored and keep old id.voidmarkModifiedKeys(ViewContextKey... newModifiedKeys) voidmarkModifiedKeys(String... newModifiedKeys) <O extends io.vertigo.datamodel.structure.model.DtObject>
ViewContextpublishDtList(ViewContextKey<O> contextKey, io.vertigo.datamodel.structure.definitions.DtFieldName<O> keyFieldName, io.vertigo.datamodel.structure.model.DtList<O> dtList) Ajoute une liste au context.<O extends io.vertigo.datamodel.structure.model.DtObject>
ViewContextpublishDtList(ViewContextKey<O> contextKey, io.vertigo.datamodel.structure.model.DtList<O> dtList) Ajoute une liste au context.<O extends io.vertigo.datamodel.structure.model.DtObject>
ViewContextpublishDtListModifiable(ViewContextKey<O> contextKey, io.vertigo.datamodel.structure.model.DtList<O> dtList) Ajoute une liste au context.<O extends io.vertigo.datamodel.structure.model.DtObject>
ViewContextpublishDto(ViewContextKey<O> contextKey, O dto) Ajoute un objet de type form au context.<O extends io.vertigo.datamodel.structure.model.DtObject>
ViewContextpublishFacetedQueryResult(ViewContextKey<FacetedQueryResult<O, SearchQuery>> contextKey, io.vertigo.datamodel.structure.definitions.DtFieldName<O> keyFieldName, FacetedQueryResult<O, SearchQuery> facetedQueryResult, ViewContextKey<?> criteriaContextKey) Publie une FacetedQueryResult.publishFileInfoURI(ViewContextKey<io.vertigo.datastore.filestore.model.FileInfoURI> contextKey, io.vertigo.datastore.filestore.model.FileInfoURI fileInfoURI) Publish file's info.publishFileInfoURIs(ViewContextKey<io.vertigo.datastore.filestore.model.FileInfoURI> contextKey, ArrayList<io.vertigo.datastore.filestore.model.FileInfoURI> fileInfoURIs) Publish list of file's info.<E extends io.vertigo.datamodel.structure.model.Entity>
ViewContextpublishMdl(ViewContextKey<E> contextKey, Class<E> entityClass, String code) Publie une liste de référence.<O extends Serializable>
ViewContextpublishRef(ViewContextKey<O> key, O value) <O extends Serializable>
voidpublishTypedRef(ViewContextKey<O> key, O value, Type paramType) <O extends io.vertigo.datamodel.structure.model.DtObject>
io.vertigo.datamodel.structure.model.DtList<O>readDtList(ViewContextKey<O> contextKey, DtObjectValidator<O> validator, UiMessageStack uiMessageStack) <O extends io.vertigo.datamodel.structure.model.DtObject>
io.vertigo.datamodel.structure.model.DtList<O>readDtList(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) <O extends io.vertigo.datamodel.structure.model.DtObject>
io.vertigo.datamodel.structure.model.DtList<O>readDtListModifiable(ViewContextKey<O> contextKey, DtObjectValidator<O> validator, UiMessageStack uiMessageStack) <O extends io.vertigo.datamodel.structure.model.DtObject>
io.vertigo.datamodel.structure.model.DtList<O>readDtListModifiable(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) <O extends io.vertigo.datamodel.structure.model.DtObject>
OreadDto(ViewContextKey<O> contextKey, DtObjectValidator<O> validator, UiMessageStack uiMessageStack) <O extends io.vertigo.datamodel.structure.model.DtObject>
OreadDto(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) voidsetCtxId()voidsetInputCtxId(String ctxId) voidPasse en mode creation.voidPasse en mode edition.voidPasse en mode readonly.
-
Field Details
-
MODE_CONTEXT_KEY
Clé de context du mode. -
MODE_EDIT_CONTEXT_KEY
Clé de context du mode Edit. -
MODE_READ_ONLY_CONTEXT_KEY
Clé de context du mode ReadOnly. -
MODE_CREATE_CONTEXT_KEY
Clé de context du mode Create. -
CTX
Clée de l'id de context dans le context. -
CTX_CREATION_INSTANT
Clée de l'instant de creation de context dans le context.
-
-
Constructor Details
-
ViewContext
-
-
Method Details
-
getId
- Returns:
- Clé de ce context
-
setInputCtxId
-
setCtxId
public void setCtxId() -
makeModifiable
public void makeModifiable()Génère un nouvel Id et passe le context en modifiable. -
makeUnmodifiable
public void makeUnmodifiable()passe le context en non-modifiable. -
markDirty
public void markDirty()Mark this context as Dirty : shouldn't be stored and keep old id. -
isDirty
public boolean isDirty()- Returns:
- if context dirty : shouldn't be stored and keep old id
-
asMap
-
asUpdatesMap
-
getFilteredViewContextAsJson
-
markModifiedKeys
-
markModifiedKeys
-
get
-
containsKey
-
findKey
- Parameters:
uiObject- UiObject recherché- Returns:
- Clé de context de l'élément (null si non trouvé)
-
findKey
- Parameters:
dtObject- DtObject recherché- Returns:
- Clé de context de l'élément (null si non trouvé)
-
publishRef
- Parameters:
key- Clé de context- Returns:
- UiObject du context
-
publishTypedRef
public <O extends Serializable> void publishTypedRef(ViewContextKey<O> key, O value, Type paramType) - Parameters:
key- Clé de context
-
getUiObject
public <O extends io.vertigo.datamodel.structure.model.DtObject> UiObject<O> getUiObject(ViewContextKey<O> key) - Parameters:
key- Clé de context- Returns:
- UiObject du context
-
getUiList
public <O extends io.vertigo.datamodel.structure.model.DtObject> UiList<O> getUiList(ViewContextKey<O> key) - Parameters:
key- Clé de context- Returns:
- UiList du context
-
getUiListModifiable
public <O extends io.vertigo.datamodel.structure.model.DtObject> BasicUiListModifiable<O> getUiListModifiable(ViewContextKey<O> key) - Parameters:
key- Clé de context- Returns:
- UiListModifiable du context
-
getString
- Parameters:
key- Clé de context- Returns:
- String du context
-
getLong
- Parameters:
key- Clé de context- Returns:
- Long du context
-
getInteger
- Parameters:
key- Clé de context- Returns:
- Integer du context
-
getBoolean
- Parameters:
key- Clé de context- Returns:
- Boolean du context
-
publishDto
public <O extends io.vertigo.datamodel.structure.model.DtObject> ViewContext publishDto(ViewContextKey<O> contextKey, O dto) Ajoute un objet de type form au context.- Parameters:
dto- Objet à publier
-
checkDtoErrors
public <O extends io.vertigo.datamodel.structure.model.DtObject> void checkDtoErrors(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) Vérifie les erreurs de l'objet. Celles-ci sont ajoutées à l'uiMessageStack si nécessaire. -
readDto
public <O extends io.vertigo.datamodel.structure.model.DtObject> O readDto(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) - Returns:
- objet métier valid�. Lance une exception si erreur.
-
readDto
public <O extends io.vertigo.datamodel.structure.model.DtObject> O readDto(ViewContextKey<O> contextKey, DtObjectValidator<O> validator, UiMessageStack uiMessageStack) - Returns:
- objet métier validé. Lance une exception si erreur.
-
publishDtList
public <O extends io.vertigo.datamodel.structure.model.DtObject> ViewContext publishDtList(ViewContextKey<O> contextKey, io.vertigo.datamodel.structure.definitions.DtFieldName<O> keyFieldName, io.vertigo.datamodel.structure.model.DtList<O> dtList) Ajoute une liste au context.- Parameters:
dtList- List à publier
-
publishDtList
public <O extends io.vertigo.datamodel.structure.model.DtObject> ViewContext publishDtList(ViewContextKey<O> contextKey, io.vertigo.datamodel.structure.model.DtList<O> dtList) Ajoute une liste au context.- Parameters:
dtList- List à publier
-
readDtList
public <O extends io.vertigo.datamodel.structure.model.DtObject> io.vertigo.datamodel.structure.model.DtList<O> readDtList(ViewContextKey<O> contextKey, DtObjectValidator<O> validator, UiMessageStack uiMessageStack) - Returns:
- List des objets métiers validée. Lance une exception si erreur.
-
readDtList
public <O extends io.vertigo.datamodel.structure.model.DtObject> io.vertigo.datamodel.structure.model.DtList<O> readDtList(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) - Returns:
- List des objets métiers validée. Lance une exception si erreur.
-
publishDtListModifiable
public <O extends io.vertigo.datamodel.structure.model.DtObject> ViewContext publishDtListModifiable(ViewContextKey<O> contextKey, io.vertigo.datamodel.structure.model.DtList<O> dtList) Ajoute une liste au context.- Parameters:
dtList- List à publier
-
checkDtListErrors
public <O extends io.vertigo.datamodel.structure.model.DtObject> void checkDtListErrors(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) Vérifie les erreurs de la liste. Celles-ci sont ajoutées à l'uiMessageStack si nécessaire. -
readDtListModifiable
public <O extends io.vertigo.datamodel.structure.model.DtObject> io.vertigo.datamodel.structure.model.DtList<O> readDtListModifiable(ViewContextKey<O> contextKey, UiMessageStack uiMessageStack) - Returns:
- List des objets métiers validée. Lance une exception si erreur.
-
readDtListModifiable
public <O extends io.vertigo.datamodel.structure.model.DtObject> io.vertigo.datamodel.structure.model.DtList<O> readDtListModifiable(ViewContextKey<O> contextKey, DtObjectValidator<O> validator, UiMessageStack uiMessageStack) - Returns:
- List des objets métiers validée. Lance une exception si erreur.
-
publishMdl
public <E extends io.vertigo.datamodel.structure.model.Entity> ViewContext publishMdl(ViewContextKey<E> contextKey, Class<E> entityClass, String code) Publie une liste de référence.- Parameters:
contextKey- Context keyentityClass- Class associéecode- Code
-
getFileInfoURI
public Optional<io.vertigo.datastore.filestore.model.FileInfoURI> getFileInfoURI(ViewContextKey<io.vertigo.datastore.filestore.model.FileInfoURI> contextKey) Get UI file uri.- Parameters:
contextKey- Context key
-
getFileInfoURIs
public ArrayList<io.vertigo.datastore.filestore.model.FileInfoURI> getFileInfoURIs(ViewContextKey<io.vertigo.datastore.filestore.model.FileInfoURI> contextKey) Get UI file info uri list.- Parameters:
contextKey- Context key
-
publishFileInfoURI
public ViewContext publishFileInfoURI(ViewContextKey<io.vertigo.datastore.filestore.model.FileInfoURI> contextKey, io.vertigo.datastore.filestore.model.FileInfoURI fileInfoURI) Publish file's info.- Parameters:
contextKey- Context keyfileInfo- file's info
-
publishFileInfoURIs
public ViewContext publishFileInfoURIs(ViewContextKey<io.vertigo.datastore.filestore.model.FileInfoURI> contextKey, ArrayList<io.vertigo.datastore.filestore.model.FileInfoURI> fileInfoURIs) Publish list of file's info.- Parameters:
contextKey- Context keyfileInfos- list of file's info.
-
publishFacetedQueryResult
public <O extends io.vertigo.datamodel.structure.model.DtObject> ViewContext publishFacetedQueryResult(ViewContextKey<FacetedQueryResult<O, SearchQuery>> contextKey, io.vertigo.datamodel.structure.definitions.DtFieldName<O> keyFieldName, FacetedQueryResult<O, SearchQuery> facetedQueryResult, ViewContextKey<?> criteriaContextKey) Publie une FacetedQueryResult.- Parameters:
contextKey- Context keykeyFieldName- Id's fieldNamefacetedQueryResult- Result
-
getSelectedFacetValues
public <O extends io.vertigo.datamodel.structure.model.DtObject> SelectedFacetValues getSelectedFacetValues(ViewContextKey<FacetedQueryResult<O, FacetedQuery>> contextKey) Returns selectedFacetValues of a given facetedQuery.- Parameters:
contextKey- Context key- Returns:
- selectedFacetValues
-
toModeEdit
public void toModeEdit()Passe en mode edition. -
toModeCreate
public void toModeCreate()Passe en mode creation. -
toModeReadOnly
public void toModeReadOnly()Passe en mode readonly. -
isModeEdit
public boolean isModeEdit()- Returns:
- Si on est en mode edition
-
isModeRead
public boolean isModeRead()- Returns:
- Si on est en mode readOnly
-
isModeCreate
public boolean isModeCreate()- Returns:
- Si on est en mode create
-