Search in sources :

Example 1 with MemberPanelStorage

use of com.evolveum.midpoint.web.session.MemberPanelStorage in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method createMemberSearch.

private <AH extends AssignmentHolderType> Search<AH> createMemberSearch(Class<AH> type) {
    MemberPanelStorage memberPanelStorage = getMemberPanelStorage();
    if (memberPanelStorage == null) {
        // normally, this should not happen
        return SearchFactory.createSearch(new ContainerTypeSearchItem<>(type), null, null, null, getPageBase(), null, true, true, Search.PanelType.MEMBER_PANEL);
    }
    if (memberPanelStorage.getSearch() != null) {
        return memberPanelStorage.getSearch();
    }
    Search<AH> search = SearchFactory.createSearch(createSearchTypeItem(getSearchBoxConfiguration()), null, null, null, getPageBase(), null, true, true, Search.PanelType.MEMBER_PANEL);
    search.addCompositedSpecialItem(createMemberSearchPanel(search, memberPanelStorage));
    if (additionalPanelConfig != null && additionalPanelConfig.getSearchBoxConfiguration() != null) {
        search.setCanConfigure(!Boolean.FALSE.equals(additionalPanelConfig.getSearchBoxConfiguration().isAllowToConfigureSearchItems()));
    }
    return search;
}
Also used : MemberPanelStorage(com.evolveum.midpoint.web.session.MemberPanelStorage)

Example 2 with MemberPanelStorage

use of com.evolveum.midpoint.web.session.MemberPanelStorage in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method getMemberPanelStorage.

protected MemberPanelStorage getMemberPanelStorage() {
    String storageKey = createStorageKey();
    if (StringUtils.isEmpty(storageKey)) {
        return null;
    }
    PageStorage storage = getSession().getSessionStorage().getPageStorageMap().get(storageKey);
    if (storage == null) {
        SearchBoxConfigurationHelper searchBoxCofig = new SearchBoxConfigurationHelper(additionalPanelConfig);
        searchBoxCofig.setDefaultSupportedRelations(getSupportedRelations());
        searchBoxCofig.setDefaultSupportedObjectTypes(getDefaultSupportedObjectTypes(false));
        searchBoxCofig.setDefaultObjectType(WebComponentUtil.classToQName(getPrismContext(), getDefaultObjectType()));
        storage = getSession().getSessionStorage().initMemberStorage(storageKey, searchBoxCofig);
    }
    return (MemberPanelStorage) storage;
}
Also used : MemberPanelStorage(com.evolveum.midpoint.web.session.MemberPanelStorage) PageStorage(com.evolveum.midpoint.web.session.PageStorage)

Example 3 with MemberPanelStorage

use of com.evolveum.midpoint.web.session.MemberPanelStorage in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method createMemberSearch.

private <AH extends AssignmentHolderType> Search<AH> createMemberSearch(Class<AH> type) {
    MemberPanelStorage memberPanelStorage = getMemberPanelStorage();
    if (memberPanelStorage == null) {
        // normally, this should not happen
        return SearchFactory.createSearch(new ContainerTypeSearchItem<>(type), null, null, null, getPageBase(), null, true, true, Search.PanelType.MEMBER_PANEL);
    }
    if (memberPanelStorage.getSearch() != null) {
        return memberPanelStorage.getSearch();
    }
    SearchBoxConfigurationHelper searchBoxConfig = getSearchBoxConfiguration();
    Search<AH> search = SearchFactory.createSearch(createSearchTypeItem(searchBoxConfig), null, null, null, getPageBase(), null, true, true, Search.PanelType.MEMBER_PANEL);
    search.addCompositedSpecialItem(createMemberSearchPanel(search, searchBoxConfig));
    if (additionalPanelConfig != null) {
        search.setCanConfigure(!Boolean.FALSE.equals(additionalPanelConfig.isAllowToConfigureSearchItems()));
    }
    memberPanelStorage.setSearch(search);
    return search;
}
Also used : SearchBoxConfigurationHelper(com.evolveum.midpoint.web.page.admin.roles.SearchBoxConfigurationHelper) MemberPanelStorage(com.evolveum.midpoint.web.session.MemberPanelStorage)

Example 4 with MemberPanelStorage

use of com.evolveum.midpoint.web.session.MemberPanelStorage in project midpoint by Evolveum.

the class AbstractRoleMemberPanel method getMemberPanelStorage.

protected MemberPanelStorage getMemberPanelStorage() {
    String storageKey = createStorageKey();
    if (StringUtils.isEmpty(storageKey)) {
        return null;
    }
    PageStorage storage = getPageStorage(storageKey);
    if (storage == null) {
        storage = getSessionStorage().initMemberStorage(storageKey);
    }
    return (MemberPanelStorage) storage;
}
Also used : MemberPanelStorage(com.evolveum.midpoint.web.session.MemberPanelStorage) PageStorage(com.evolveum.midpoint.web.session.PageStorage)

Aggregations

MemberPanelStorage (com.evolveum.midpoint.web.session.MemberPanelStorage)4 PageStorage (com.evolveum.midpoint.web.session.PageStorage)2 SearchBoxConfigurationHelper (com.evolveum.midpoint.web.page.admin.roles.SearchBoxConfigurationHelper)1