use of org.apereo.portal.io.xml.IPortalDataType in project uPortal by Jasig.
the class PortalDataTypeTargetProviderImpl method init.
@PostConstruct
public void init() {
Iterable<IPortalDataType> dataTypes = portalDataHandlerService.getExportPortalDataTypes();
for (IPortalDataType type : dataTypes) {
final String typeId = type.getTypeId();
targetMap.put(typeId, new PermissionTargetImpl(typeId, typeId, IPermissionTarget.TargetType.DATA_TYPE));
}
}
use of org.apereo.portal.io.xml.IPortalDataType in project uPortal by Jasig.
the class ImportExportPortletController method getAllowedTypes.
/**
* Return a list of all permitted import/export types for the given permission and the current
* user.
*
* @param request
* @param activityName
* @return
*/
protected List<IPortalDataType> getAllowedTypes(PortletRequest request, String activityName, Iterable<IPortalDataType> dataTypes) {
// get the authorization principal representing the current user
final HttpServletRequest httpServletRequest = this.portalRequestUtils.getPortletHttpRequest(request);
final IPerson person = personManager.getPerson(httpServletRequest);
final EntityIdentifier ei = person.getEntityIdentifier();
final IAuthorizationPrincipal ap = AuthorizationService.instance().newPrincipal(ei.getKey(), ei.getType());
// filter the list of configured import/export types by user permission
final List<IPortalDataType> results = new ArrayList<IPortalDataType>();
for (IPortalDataType type : dataTypes) {
final String typeId = type.getTypeId();
if (ap.hasPermission(IPermission.PORTAL_SYSTEM, activityName, typeId)) {
results.add(type);
}
}
return results;
}
use of org.apereo.portal.io.xml.IPortalDataType in project uPortal by Jasig.
the class TemplateDataTenantOperationsListener method setDataTypeImportOrder.
/** Order in which data types should be imported. */
@javax.annotation.Resource(name = "dataTypeImportOrder")
public void setDataTypeImportOrder(List<IPortalDataType> dataTypeImportOrder) {
final ArrayList<PortalDataKey> dataKeyImportOrder = new ArrayList<PortalDataKey>(dataTypeImportOrder.size() * 2);
for (final IPortalDataType portalDataType : dataTypeImportOrder) {
final List<PortalDataKey> supportedDataKeys = portalDataType.getDataKeyImportOrder();
for (final PortalDataKey portalDataKey : supportedDataKeys) {
/*
* Special Handling: Need to prevent some keys from entering our
* sorted collection because they attempt to import both a group
* part and the membership parts of a group (either local or PAGS)
* in one go. We import several entities at once, so it's important
* to do these in 2 phases.
*/
if (!KEYS_TO_IGNORE.contains(portalDataKey)) {
dataKeyImportOrder.add(portalDataKey);
}
}
}
dataKeyImportOrder.trimToSize();
this.dataKeyImportOrder = Collections.unmodifiableList(dataKeyImportOrder);
}
Aggregations