Read jcr:created from dam asset json file
This is part of my jcr content json
{
"jcr:primaryType": "dam:Asset",
"jcr:createdBy": "admin",
"jcr:created": "Thu Oct 03 2024 20:15:12 GMT+0530",
"jcr:uuid": "bb43bafd-099d-425b-a0af-a748489a7e98",
"jcr:content": {
"jcr:primaryType": "dam:AssetContent",
"jcr:lastModifiedBy": "admin",
"dam:assetState": "processed",
"jcr:lastModified": "Thu Oct 31 2024 16:23:48 GMT+0530"
}
}This is how I wrote the query to fetch the assets
QueryBuilder queryBuilder = resourceResolver.adaptTo(QueryBuilder.class);
Map<String, String> queryMap = new HashMap<>();
queryMap.put(SearchConstants.PATH, path);
queryMap.put(SearchConstants.TYPE, DamConstants.NT_DAM_ASSET);
queryMap.put(SearchConstants.PROPERTY, SearchConstants.DAM_SCENE7_FILE_STATUS);
queryMap.put(SearchConstants.PROPERTY_VALUE, Scene7Constants.PV_S7_PUBLISH_COMPLETE);
SearchUtils.addExcludePaths(queryMap, lennoxDocumentLibraryService);
queryMap.put(SearchConstants.P_LIMIT, SearchConstants.MINUS_ONE);
queryMap.put(SearchConstants.P_HITS, SearchConstants.FULL);
Query query = queryBuilder.createQuery(PredicateGroup.create(queryMap), resourceResolver.adaptTo(Session.class));
return query.getResult();
post query search, i tried to iterate the results and read jcr:created property through assetResource.getValueMap(); it always shows "jcr:uuid": "bb43bafd-099d-425b-a0af-a748489a7e98", and "jcr:primaryType": "dam:Asset". i could not read jcr:created
for (Hit hit : searchResult.getHits()) {
Resource assetResource = resourceResolver.getResource(hit.getPath());
assetResource.getValueMap();
}
I need to read this jcr:created and add it to my search result response. Could somebody help me on this.
Thanks in Advance.