Récupérer la liste des métadonnées d'un aspect

cancel
Showing results for 
Search instead for 
Did you mean: 
christophes
Member II

Récupérer la liste des métadonnées d'un aspect

Bonjour,

Je cherche à récupérer la liste des métadonnées liées à un aspect particulier via l'API Java. J'ai regardé du côté du DictionaryService, il y a 5 méthodes get(All)Property(ies) mais aucune ne semble correspondre à mon besoin.

Ci-dessous un extrait de la classe DictionaryService contenant les dites méthodes :
/**
     * Gets the definition of the property as defined by the specified Class.
     *
     * Note: A sub-class may override the definition of a property that's
     *       defined in a super-class.
     *
     * @param className the class name
     * @param propertyName the property name
     * @return the property definition (or null, if it doesn't exist)
     */
    @NotAuditable
    PropertyDefinition getProperty(QName className, QName propertyName);

    /**
     * Gets the definition of the property as defined by its owning Class.
     *
     * @param propertyName the property name
     * @return the property definition (or null, if it doesn't exist)
     */
    @NotAuditable
    PropertyDefinition getProperty(QName propertyName);

    /**
     * Get all properties defined across all models with the given data type.
     *
     * Note that DataTypeDefinition.ANY will only match this type and can not be used as get all properties.
     *
     * If dataType is null then this method will return *ALL* properties regardless of data type.
     *
     * @param dataType
     * @return
     */
    @NotAuditable
    Collection<QName> getAllProperties(QName dataType);
   
    /**
     * Get all properties defined for the given model with the given data type.
     *
     * Note that DataTypeDefinition.ANY will only match this type and can not be used as get all properties.
     *
     * If dataType is null then this method will return *ALL* properties regardless of data type.
     *
     * @param dataType
     * @return
     */
    @NotAuditable
    Collection<QName> getProperties(QName model, QName dataType);
   
    /**
     * Get all poroperties for the specified model
     *
     * @param model
     * @return
     */
    Collection<QName> getProperties(QName model);
Est-ce que quelqu'un connaitrait une telle fonction ou aurait une idée sur comment la développer si besoin?

Merci d'avance,

Christophe
2 Replies
rivarola
Active Member

Re: Récupérer la liste des métadonnées d'un aspect

Bonjour,

On commence par récupérer la définition de l'aspect par cette méthode du DictionaryService :
    /**
     * @param name the name of the aspect to retrieve
     * @return the aspect definition (or null, if it doesn't exist)
     */
    @NotAuditable
    AspectDefinition getAspect(QName name);

Ensuite on récupère les propriétés définies sur l'aspect en appelant cette méthode directement sur l'aspect retourné :

    /**
     * @return the properties of the class, including inherited properties
     */
    public Map<QName, PropertyDefinition> getProperties();
christophes
Member II

Re: Récupérer la liste des métadonnées d'un aspect

Merci beaucoup de ton aide, ça fonctionne.

Christophe