Get the gadget at a particular index's personalization value, which can then be bitmasked with to a type in PT_GADGETPERSONALIZATION_ROLES.
int - personalization value
IPTMyPortalGadgetContent Interface | com.plumtree.server Namespace