Last active
September 13, 2020 05:36
-
-
Save beeTechMantra/44f7157ea85329ac15aa40334773aecf to your computer and use it in GitHub Desktop.
Get User's Category by userId Groovy script Liferay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List | |
import com.liferay.asset.kernel.model.AssetCategory | |
import com.liferay.asset.kernel.service.AssetCategoryLocalServiceUtil | |
import com.liferay.portal.kernel.model.User | |
try{ | |
// 123456 - here you have to pass userId | |
List<AssetCategory> assignedCaregories = AssetCategoryLocalServiceUtil.getCategories(User.class.getName(), 123456); | |
for(AssetCategory category : assignedCaregories) { | |
out.println("category Name : " + category.getName()); | |
out.println("=========================================="); | |
} | |
}catch(e) { | |
out.println(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment