use of org.apereo.portal.groups.pags.dao.IPersonAttributesGroupDefinition in project uPortal by Jasig.
the class PersonAttributesGroupStoreDataFunction method apply.
@Override
public Iterable<? extends IPortalData> apply(IPortalDataType input) {
final Set<IPersonAttributesGroupDefinition> personAttributesGroupDefinitions = this.personAttributesGroupDefinitionDao.getPersonAttributesGroupDefinitions();
List<IPersonAttributesGroupDefinition> pagsDefs = new ArrayList<IPersonAttributesGroupDefinition>();
for (IPersonAttributesGroupDefinition pagsDef : personAttributesGroupDefinitions) {
pagsDefs.add(pagsDef);
}
final List<IPortalData> portalData = Lists.transform(pagsDefs, new Function<IPersonAttributesGroupDefinition, IPortalData>() {
@Override
public IPortalData apply(IPersonAttributesGroupDefinition personAttributesGroup) {
return new SimpleStringPortalData(personAttributesGroup.getName(), null, personAttributesGroup.getDescription());
}
});
return portalData;
}
use of org.apereo.portal.groups.pags.dao.IPersonAttributesGroupDefinition in project uPortal by Jasig.
the class JpaPersonAttributesGroupDefinitionDao method createPersonAttributesGroupDefinition.
@PortalTransactional
@Override
public IPersonAttributesGroupDefinition createPersonAttributesGroupDefinition(String name, String description) {
final IPersonAttributesGroupDefinition personAttributesGroupDefinition = new PersonAttributesGroupDefinitionImpl(name, description);
this.getEntityManager().persist(personAttributesGroupDefinition);
return personAttributesGroupDefinition;
}
use of org.apereo.portal.groups.pags.dao.IPersonAttributesGroupDefinition in project uPortal by Jasig.
the class JpaPersonAttributesGroupDefinitionDao method updatePersonAttributesGroupDefinition.
@PortalTransactional
@Override
public IPersonAttributesGroupDefinition updatePersonAttributesGroupDefinition(IPersonAttributesGroupDefinition personAttributesGroupDefinition) {
Validate.notNull(personAttributesGroupDefinition, "personAttributesGroupDefinition can not be null");
final IPersonAttributesGroupDefinition persistentDefinition;
final EntityManager entityManager = this.getEntityManager();
if (entityManager.contains(personAttributesGroupDefinition)) {
persistentDefinition = personAttributesGroupDefinition;
} else {
persistentDefinition = entityManager.merge(personAttributesGroupDefinition);
}
this.getEntityManager().persist(persistentDefinition);
return persistentDefinition;
}
Aggregations