public class WebCmsUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
combineUrlSegments(@NonNull String baseUrl,
@NonNull String path)
Create a full url by combining a base with a path segment.
|
static WebCmsDataAction |
convertImportActionToDataAction(Object existing,
WebCmsDataImportAction requested) |
static String |
generateCanonicalPath(@NonNull WebCmsPage page)
Generates a unique canonical path for a
WebCmsPage. |
static String |
generateObjectId(@NonNull String collectionId)
Generate a unique object id for the given collection.
|
static String |
generateUrlPathSegment(@NonNull String text)
Convert text into a valid path segment for url.
|
static boolean |
isObjectIdForCollection(String objectId,
@NonNull String collectionId)
Checks if an object id is for a given collection.
|
static boolean |
isPublishedOnDate(@NonNull WebCmsAsset asset,
@NonNull Date date)
Is the given asset published on a particular date.
|
static String |
prefixObjectIdForCollection(@NonNull String objectId,
@NonNull String collectionId)
Ensures a unique id is for a given collection.
|
public static boolean isPublishedOnDate(@NonNull
@NonNull WebCmsAsset asset,
@NonNull
@NonNull Date date)
WebCmsAsset#isPublished() returns true and the WebCmsAsset#getPublicationDate()
is either null or before the date parameter.asset - to checkdate - to check forpublic static String generateObjectId(@NonNull @NonNull String collectionId)
collectionId - the key should havepublic static String prefixObjectIdForCollection(@NonNull @NonNull String objectId, @NonNull @NonNull String collectionId)
objectId - requestedcollectionId - the key should havepublic static boolean isObjectIdForCollection(String objectId, @NonNull @NonNull String collectionId)
objectId - to checkcollectionId - the object id should havepublic static String generateUrlPathSegment(@NonNull @NonNull String text)
text - to convertpublic static String generateCanonicalPath(@NonNull @NonNull WebCmsPage page)
WebCmsPage.
The canonical path is the canonical path of its (optional) parent joined together with its own
path segment using a / character (forward slash).page - to generate the path forpublic static String combineUrlSegments(@NonNull @NonNull String baseUrl, @NonNull @NonNull String path)
baseUrl - that may or may not contain a * markerpath - to inject into the base urlpublic static WebCmsDataAction convertImportActionToDataAction(Object existing, WebCmsDataImportAction requested)
Copyright © 2020. All rights reserved.