Class ViewContext

    • Method Detail

      • getId

        public String getId()
        Returns:
        Clé de ce context
      • setInputCtxId

        public void setInputCtxId​(String ctxId)
      • 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
      • getFilteredViewContextAsJson

        public String getFilteredViewContextAsJson()
      • markModifiedKeys

        public void markModifiedKeys​(ViewContextKey... newModifiedKeys)
      • markModifiedKeys

        public void markModifiedKeys​(String... newModifiedKeys)
      • containsKey

        public boolean containsKey​(Object key)
      • findKey

        public String findKey​(UiObject<?> uiObject)
        Parameters:
        uiObject - UiObject recherché
        Returns:
        Clé de context de l'élément (null si non trouvé)
      • findKey

        public String findKey​(io.vertigo.datamodel.structure.model.DtObject dtObject)
        Parameters:
        dtObject - DtObject recherché
        Returns:
        Clé de context de l'élément (null si non trouvé)
      • publishRef

        public <O extends Serializable> void publishRef​(ViewContextKey<O> key,
                                                        O value)
        Parameters:
        key - Clé de 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

        public String getString​(ViewContextKey<String> key)
        Parameters:
        key - Clé de context
        Returns:
        String du context
      • getLong

        public Long getLong​(ViewContextKey<Long> key)
        Parameters:
        key - Clé de context
        Returns:
        Long du context
      • publishDto

        public <O extends io.vertigo.datamodel.structure.model.DtObject> void 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> void 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> void 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> void 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> void publishMdl​(ViewContextKey<E> contextKey,
                                                                                       Class<E> entityClass,
                                                                                       String code)
        Publie une liste de référence.
        Parameters:
        contextKey - Context key
        entityClass - Class associée
        code - 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 void publishFileInfoURI​(ViewContextKey<io.vertigo.datastore.filestore.model.FileInfoURI> contextKey,
                                       io.vertigo.datastore.filestore.model.FileInfoURI fileInfoURI)
        Publish file's info.
        Parameters:
        contextKey - Context key
        fileInfo - file's info
      • publishFileInfoURIs

        public void 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 key
        fileInfos - list of file's info.
      • publishFacetedQueryResult

        public <O extends io.vertigo.datamodel.structure.model.DtObject> void 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 key
        keyFieldName - Id's fieldName
        facetedQueryResult - 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