Search in sources :

Example 1 with SimpleStringPortalData

use of org.apereo.portal.io.xml.SimpleStringPortalData in project uPortal by Jasig.

the class FragmentLayoutsDataFunction method apply.

@Override
public Iterable<? extends IPortalData> apply(IPortalDataType input) {
    final List<FragmentDefinition> fragments = this.configurationLoader.getFragments();
    final List<IPortalData> portalData = Lists.transform(fragments, new Function<FragmentDefinition, IPortalData>() {

        @Override
        public IPortalData apply(FragmentDefinition fragmentDefinition) {
            return new SimpleStringPortalData(fragmentDefinition.getOwnerId(), fragmentDefinition.getName(), fragmentDefinition.getDescription());
        }
    });
    return portalData;
}
Also used : FragmentDefinition(org.apereo.portal.layout.dlm.FragmentDefinition) SimpleStringPortalData(org.apereo.portal.io.xml.SimpleStringPortalData) IPortalData(org.apereo.portal.io.xml.IPortalData)

Example 2 with SimpleStringPortalData

use of org.apereo.portal.io.xml.SimpleStringPortalData in project uPortal by Jasig.

the class FragmentDefinitionDataFunction method apply.

@Override
public Iterable<? extends IPortalData> apply(IPortalDataType input) {
    final List<FragmentDefinition> fragmentDefinitions = this.fragmentDefinitionDao.getAllFragments();
    final List<IPortalData> portalData = Lists.transform(fragmentDefinitions, new Function<FragmentDefinition, IPortalData>() {

        @Override
        public IPortalData apply(FragmentDefinition fragmentDefinition) {
            return new SimpleStringPortalData(fragmentDefinition.getName(), null, fragmentDefinition.getDescription());
        }
    });
    return portalData;
}
Also used : FragmentDefinition(org.apereo.portal.layout.dlm.FragmentDefinition) SimpleStringPortalData(org.apereo.portal.io.xml.SimpleStringPortalData) IPortalData(org.apereo.portal.io.xml.IPortalData)

Example 3 with SimpleStringPortalData

use of org.apereo.portal.io.xml.SimpleStringPortalData in project uPortal by Jasig.

the class LayoutsDataFunction method apply.

@Override
public Iterable<? extends IPortalData> apply(IPortalDataType input) {
    final List<FragmentDefinition> fragments = this.configurationLoader.getFragments();
    final Set<String> fragmentOwners = new LinkedHashSet<String>();
    for (final FragmentDefinition fragmentDefinition : fragments) {
        fragmentOwners.add(fragmentDefinition.getOwnerId());
    }
    final List<String> userList = this.jdbcOperations.queryForList("SELECT USER_NAME FROM UP_USER WHERE USER_NAME NOT IN (:userNames)", Collections.singletonMap("userNames", fragmentOwners), String.class);
    return Lists.transform(userList, new Function<String, IPortalData>() {

        @Override
        public IPortalData apply(final String userName) {
            return new SimpleStringPortalData(userName, null, null);
        }
    });
}
Also used : LinkedHashSet(java.util.LinkedHashSet) FragmentDefinition(org.apereo.portal.layout.dlm.FragmentDefinition) SimpleStringPortalData(org.apereo.portal.io.xml.SimpleStringPortalData) IPortalData(org.apereo.portal.io.xml.IPortalData)

Example 4 with SimpleStringPortalData

use of org.apereo.portal.io.xml.SimpleStringPortalData 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;
}
Also used : IPersonAttributesGroupDefinition(org.apereo.portal.groups.pags.dao.IPersonAttributesGroupDefinition) SimpleStringPortalData(org.apereo.portal.io.xml.SimpleStringPortalData) ArrayList(java.util.ArrayList) IPortalData(org.apereo.portal.io.xml.IPortalData)

Aggregations

IPortalData (org.apereo.portal.io.xml.IPortalData)4 SimpleStringPortalData (org.apereo.portal.io.xml.SimpleStringPortalData)4 FragmentDefinition (org.apereo.portal.layout.dlm.FragmentDefinition)3 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1 IPersonAttributesGroupDefinition (org.apereo.portal.groups.pags.dao.IPersonAttributesGroupDefinition)1