Highlighted

Code snippets - XML Add-On | AEM Community Blog Seeding

Avatar

Avatar

kautuk_sahni

Community Manager

Total Posts

5.5K

Likes

959

Correct Answer

1.1K

Avatar

kautuk_sahni

Community Manager

Total Posts

5.5K

Likes

959

Correct Answer

1.1K
kautuk_sahni
Community Manager

11-09-2020

BlogImage.jpg

Code snippets - XML Add-On by Techrevel Blog - Aanchal Sikka

Abstract

Get allowed Document State transitions for an asset. The API will return next allowed document state transitions for the user identified by userID attribute

JSONObject jsonResponse = ProfileService.getdocstateinfo(new String[] { assetPath }, userID, resourceResolver);
LOG.debug("Profile service response: {} for asset: {}", jsonResponse, assetPath);

JSONArray jsonArray = jsonResponse.getJSONObject(assetPath).getJSONArray(DOCSTATEJSON_ALLOWEDSTATES_KEY);

for (int i = 0; i < jsonArray.length(); i++) {
LOG.info("Valid transition: {}", jsonArray.getString(i));
}

Read Full Blog

Code snippets - XML Add-On

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager