use of com.evolveum.midpoint.web.session.PageStorage in project midpoint by Evolveum.
the class PageResources method initSearch.
private void initSearch(String text) {
PageStorage storage = getSessionStorage().getPageStorageMap().get(SessionStorage.KEY_RESOURCES);
if (storage == null) {
storage = getSessionStorage().initPageStorage(SessionStorage.KEY_RESOURCES);
}
Search search = SearchFactory.createSearch(ResourceType.class, this);
if (SearchBoxModeType.FULLTEXT.equals(search.getSearchType())) {
search.setFullText(text);
} else if (search.getItems() != null && search.getItems().size() > 0) {
SearchItem searchItem = search.getItems().get(0);
searchItem.getValues().add(new SearchValue<>(text));
}
storage.setSearch(search);
getSessionStorage().getPageStorageMap().put(SessionStorage.KEY_RESOURCES, storage);
}
use of com.evolveum.midpoint.web.session.PageStorage in project midpoint by Evolveum.
the class ObjectListPanel method initSearchModel.
private LoadableModel<Search> initSearchModel() {
return new LoadableModel<Search>(false) {
private static final long serialVersionUID = 1L;
@Override
public Search load() {
String storageKey = getStorageKey();
Search search = null;
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
search = storage.getSearch();
}
}
if (search == null) {
search = createSearch();
}
return search;
}
};
}
use of com.evolveum.midpoint.web.session.PageStorage in project midpoint by Evolveum.
the class ObjectListPanel method searchPerformed.
@SuppressWarnings("deprecation")
private void searchPerformed(ObjectQuery query, AjaxRequestTarget target) {
BaseSortableDataProvider<SelectableBean<O>> provider = getDataProvider();
// note: we ignore 'query' parameter, as the 'customQuery' already contains its content (MID-3271)
ObjectQuery customQuery = getQuery();
// if (customQuery == null){
// customQuery = query;
// } else {
// if (query != null){
// customQuery.addFilter(query.getFilter());
// }
// }
provider.setQuery(customQuery);
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
storage.setSearch(searchModel.getObject());
storage.setPaging(null);
}
}
Table table = getTable();
table.setCurrentPage(null);
target.add((Component) table);
target.add(parentPage.getFeedbackPanel());
}
use of com.evolveum.midpoint.web.session.PageStorage in project midpoint by Evolveum.
the class ObjectListPanel method saveSearchModel.
private void saveSearchModel() {
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
storage.setSearch(searchModel.getObject());
storage.setPaging(null);
}
}
}
use of com.evolveum.midpoint.web.session.PageStorage in project midpoint by Evolveum.
the class ObjectListPanel method initProvider.
protected BaseSortableDataProvider<SelectableBean<O>> initProvider() {
Set<O> selectedObjectsSet = selectedObjects == null ? null : new HashSet<O>(selectedObjects);
SelectableBeanObjectDataProvider<O> provider = new SelectableBeanObjectDataProvider<O>(parentPage, type, selectedObjectsSet) {
private static final long serialVersionUID = 1L;
@Override
protected void saveProviderPaging(ObjectQuery query, ObjectPaging paging) {
String storageKey = getStorageKey();
if (StringUtils.isNotEmpty(storageKey)) {
PageStorage storage = getPageStorage(storageKey);
if (storage != null) {
storage.setPaging(paging);
}
}
}
@Override
public SelectableBean<O> createDataObjectWrapper(O obj) {
SelectableBean<O> bean = super.createDataObjectWrapper(obj);
List<InlineMenuItem> inlineMenu = createInlineMenu();
if (inlineMenu != null) {
bean.getMenuItems().addAll(inlineMenu);
}
return bean;
}
};
if (options == null) {
if (ResourceType.class.equals(type)) {
options = SelectorOptions.createCollection(GetOperationOptions.createNoFetch());
}
} else {
if (ResourceType.class.equals(type)) {
GetOperationOptions root = SelectorOptions.findRootOptions(options);
root.setNoFetch(Boolean.TRUE);
}
provider.setOptions(options);
}
provider.setQuery(getQuery());
return provider;
}
Aggregations