Package com.day.cq.dam.api.s7dam.set
Interface SetHelper
-
@NotNullApi public interface SetHelper
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clearMembers(Resource setResource)
Delete all member relations from the Set.Resource
createSet(Resource parent, java.lang.String desiredName, java.lang.String setType)
Create the new instance of Set and put it into JCR.void
updateSet(Resource setResource, @Nullable java.lang.String title, @Nullable java.lang.String description, @Nullable java.lang.String manualThumbnail, @Nullable java.util.Map<java.lang.String,java.lang.Object> contentProps, @Nullable java.util.Map<java.lang.String,java.lang.Object> metadataProps, @Nullable java.util.Map<java.lang.String,java.lang.String> userdataProps, @Nullable java.util.List<java.util.List<java.lang.String>> members, @Nullable java.util.Map<java.lang.String,java.lang.String> swatches, boolean generateThumbnail)
Update properties of existing Set in JCR.
-
-
-
Method Detail
-
createSet
Resource createSet(Resource parent, java.lang.String desiredName, java.lang.String setType)
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 java.lang.String title, @Nullable @Nullable java.lang.String description, @Nullable @Nullable java.lang.String manualThumbnail, @Nullable @Nullable java.util.Map<java.lang.String,java.lang.Object> contentProps, @Nullable @Nullable java.util.Map<java.lang.String,java.lang.Object> metadataProps, @Nullable @Nullable java.util.Map<java.lang.String,java.lang.String> userdataProps, @Nullable @Nullable java.util.List<java.util.List<java.lang.String>> members, @Nullable @Nullable java.util.Map<java.lang.String,java.lang.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 inmanualThumbnail
property.
-
clearMembers
void clearMembers(Resource setResource)
Delete all member relations from the Set.- Parameters:
setResource
- Resource pointing to existing Set to update
-
-