Package com.day.cq.dam.api.s7dam.set
Interface SetHelper
@NotNullApi
public interface SetHelper
-
Method Summary
Modifier and TypeMethodDescriptionvoidclearMembers(Resource setResource) Delete all member relations from the Set.Create the new instance of Set and put it into JCR.voidupdateSet(Resource setResource, @Nullable String title, @Nullable String description, @Nullable String manualThumbnail, @Nullable Map<String, Object> contentProps, @Nullable Map<String, Object> metadataProps, @Nullable Map<String, String> userdataProps, @Nullable List<List<String>> members, @Nullable Map<String, String> swatches, boolean generateThumbnail) Update properties of existing Set in JCR.
-
Method Details
-
createSet
Create the new instance of Set and put it into JCR. Attention: JCR changes are not persisted yet, you must save explicitly after calling this method! After this method,updateSet(org.apache.sling.api.resource.Resource, java.lang.String, java.lang.String, java.lang.String, java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.Object>, java.util.Map<java.lang.String, java.lang.String>, java.util.List<java.util.List<java.lang.String>>, java.util.Map<java.lang.String, java.lang.String>, boolean)usually should be called to set the rest of necessary properties.- Parameters:
parent- Resource of the Folder containing new SetdesiredName- desired name of the new Set (JCR node name), resulting name can differ to omit duplicationssetType- type of the new Set (defined in S7damConstants)- Returns:
- Resource pointing to the new valid Set, or throws RuntimeException
-
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 updatetitle- (optional) user-facing title of the new Set, skipped updating if nulldescription- (optional) free-text description of the Set, skipped updating if nullmanualThumbnail- (optional) JCR path for Asset used as thumbnail for the Set, skipped updating if nullcontentProps- (optional) properties to add to "jcr:content" subnode, skipped if nullmetadataProps- (optional) properties to add to "jcr:content/metadata" subnode, skipped if nulluserdataProps- (optional) properties to add to "jcr:content/userdata" subnode, skipped if nullmembers- (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 withclearMembers(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 membergenerateThumbnail- after updating, generate thumbnail Rendition from first few members, or from user- selected Asset inmanualThumbnailproperty.
-
clearMembers
Delete all member relations from the Set.- Parameters:
setResource- Resource pointing to existing Set to update
-