Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-4899

Add Model API to get default Entity Reference values

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Minor
    • 2.2.3, 2.3 M1
    • 2.2 RC 2
    • {Unused} Core
    • None
    • Unit
    • Unknown

    Description

      This is useful for reduce code duplication in Resolver implementations and also to make it easy to get default reference values in code whenever needed.

      /**
       * Return default values for specified Entity Reference types. Useful when an Entity Reference value has not been
       * specified and we need to find a default value for it (the default value returned will depend on the implementations,
       * some will return default values defined in the XWiki configuration, others will return values taken from the
       * current document reference, etc).
       *
       * @version $Id$
       * @since 2.3M1
       */
      @ComponentRole
      public interface EntityReferenceValueProvider
      {
          /**
           * @param type the entity reference type for which to get the default value
           * @return the default value for the passed type
           */
          String getDefaultValue(EntityType type);
      }
      

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: