Interface SetHelper


  • @NotNullApi
    public interface SetHelper
    • Method Detail

      • updateSet

        void updateSet​(Resource setResource,
                       @Nullable
                       @Nullable String title,
                       @Nullable
                       @Nullable String description,
                       @Nullable
                       @Nullable String manualThumbnail,
                       @Nullable
                       @Nullable Map<String,​Object> contentProps,
                       @Nullable
                       @Nullable Map<String,​Object> metadataProps,
                       @Nullable
                       @Nullable Map<String,​String> userdataProps,
                       @Nullable
                       @Nullable List<List<String>> members,
                       @Nullable
                       @Nullable Map<String,​String> swatches,
                       boolean generateThumbnail)
        Update properties of existing Set in JCR. Attention: JCR changes are not persisted yet, you must save explicitly after calling this method!
        Parameters:
        setResource - Resource pointing to existing Set to update
        title - (optional) user-facing title of the new Set, skipped updating if null
        description - (optional) free-text description of the Set, skipped updating if null
        manualThumbnail - (optional) JCR path for Asset used as thumbnail for the Set, skipped updating if null
        contentProps - (optional) properties to add to "jcr:content" subnode, skipped if null
        metadataProps - (optional) properties to add to "jcr:content/metadata" subnode, skipped if null
        userdataProps - (optional) properties to add to "jcr:content/userdata" subnode, skipped if null
        members - (optional) 2-D list of JCR paths of Set members to add, skipped updating if null; Single-dimensional Set types (eg ImageSet) uses the first row only. Existing members array is not deleted: if you need the full replace of members array, you have to clear members with clearMembers(Resource) before calling this method, and set non-null "members" param (can be empty List for empty Set)
        swatches - (optional) contains the map of swatch images associated to Set members: key = path of member Asset, value = path of Asset used as swatch for that member
        generateThumbnail - after updating, generate thumbnail Rendition from first few members, or from user- selected Asset in manualThumbnail property.
      • clearMembers

        void clearMembers​(Resource setResource)
        Delete all member relations from the Set.
        Parameters:
        setResource - Resource pointing to existing Set to update