Hi All,
I am using the assets API to return a list of Content Fragments. If this is called while someone has started to create a CF but hasn't saved it, the API returns the partial CF (e.g. an empty shell).
There is no saved date on the CF on the API so does anyone have any suggestions on how to overcome this please?
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
No worries @AEM_PARTY , thanks for further explanation. I think I understand your use case now, but I also think we're not using the correct terminology ('saved') which is causing the confusion.
When a blank CF is created, it is in a 'saved' state.
Maybe what you're after are the CFs which are not empty? If thats the case then maybe you can look under the 'elements' property for a property (say, 'value' correpsonding to a CF field) if its empty or has a value.
Or maybe you are after the CFs that are not 'finalised' yet, meaning the author user is still working on it and hasn't finished writing it up. This would be tricky, as it more sounds like a business process rather than product. However I do see a property in CRX which seems to exists for a newly created CF only. But I don't see it in coming in assets API:
If you're lookiong for the CF that is published (which I suppose also indicates that the CF is 'finalised'), then you can look for the published property:
I tried to reproduce the use case, but I'm able to get the create date of the content fragment. Below are my steps, let me know if any pf the steps are incorrect as per your use case:
1. Created a new blank content fragment called 'myCF1'.
2. No content is yet saved in the content fragment, and is currently empty:
3. Use asset API to get details of the content fragment:
http://localhost:4502/api/assets/myfolder/mycf1.json
The 'created' property is in epoch time.
Thanks a lot for this.
Sorry, if I wasn't clear
No worries @AEM_PARTY , thanks for further explanation. I think I understand your use case now, but I also think we're not using the correct terminology ('saved') which is causing the confusion.
When a blank CF is created, it is in a 'saved' state.
Maybe what you're after are the CFs which are not empty? If thats the case then maybe you can look under the 'elements' property for a property (say, 'value' correpsonding to a CF field) if its empty or has a value.
Or maybe you are after the CFs that are not 'finalised' yet, meaning the author user is still working on it and hasn't finished writing it up. This would be tricky, as it more sounds like a business process rather than product. However I do see a property in CRX which seems to exists for a newly created CF only. But I don't see it in coming in assets API:
If you're lookiong for the CF that is published (which I suppose also indicates that the CF is 'finalised'), then you can look for the published property:
Views
Likes
Replies
Views
Likes
Replies