Class UsersClass

    • Constructor Detail

      • UsersClass

        public UsersClass​(PropertyMetaClass metaClass)
        Creates a new Users List property that is described by the given meta class.
        Parameters:
        metaClass - the meta class that defines the list of meta properties associated with this property type
      • UsersClass

        public UsersClass()
        Default constructor.
    • Method Detail

      • isUsesList

        @Deprecated
        public boolean isUsesList()
        Deprecated.
        since 4.3M2 this meta property is not used anymore because we changed the default displayer
        Returns:
        true if the list box that is used to select the users should be filled with all the available users, false otherwise
      • setUsesList

        @Deprecated
        public void setUsesList​(boolean usesList)
        Deprecated.
        since 4.3M2 this meta property is not used anymore because we changed the default displayer
        Sets whether to list all the available users in the list box used to select the users. This property should not be set when the number of users is very large.
        Parameters:
        usesList - true to fill the list box that is used to select the users with all the available users, false otherwise
      • fromList

        public void fromList​(BaseProperty<?> property,
                             List<String> list)
        Description copied from class: ListClass
        Set the passed List into the passed property.
        Overrides:
        fromList in class ListClass
        Parameters:
        property - the property to modify
        list - the list to set
      • getText

        public String getText​(String value,
                              XWikiContext context)
        Parameters:
        value - a user name
        context - the XWiki context
        Returns:
        the real name of the specified user, that can be used for display
      • getListFromString

        public static List<String> getListFromString​(String value)
        Splits the given string into a list of user names.
        Parameters:
        value - a comma separate list of user names
        Returns:
        the list of user names
      • toList

        public List<String> toList​(BaseProperty<?> property)
        Description copied from class: ListClass
        ListClass does not produce only ListPropertys and this method allows to access the value as List whatever property is actually storing it.

        There is no guarantees the returned List will be modifiable.

        Overrides:
        toList in class ListClass
        Parameters:
        property - the property created by this class
        Returns:
        the List representation of this property
      • mergeProperty

        public <T extends EntityReference> void mergeProperty​(BaseProperty<T> currentProperty,
                                                              BaseProperty<T> previousProperty,
                                                              BaseProperty<T> newProperty,
                                                              MergeConfiguration configuration,
                                                              XWikiContext xcontext,
                                                              MergeResult mergeResult)
        Description copied from class: PropertyClass
        Apply a 3 ways merge on passed current, previous and new version of the same property. The passed current version is modified as result of the merge.
        Overrides:
        mergeProperty in class ListClass
        Parameters:
        currentProperty - the current version of the element and the one to modify
        previousProperty - the previous version of the element
        newProperty - the new version of the property
        configuration - the configuration of the merge Indicate how to deal with some conflicts use cases, etc.
        xcontext - the XWiki context
        mergeResult - the merge report