use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class AbstractTreeTablePanel method createOrgChildQuery.
protected ObjectQuery createOrgChildQuery() {
SelectableBeanImpl<OrgType> dto = selected.getObject();
String oid = dto != null && dto.getValue() != null ? dto.getValue().getOid() : getModel().getObject();
BasicSearchPanel<String> basicSearch = (BasicSearchPanel<String>) get(createComponentPath(ID_SEARCH_FORM, ID_BASIC_SEARCH));
String object = basicSearch.getModelObject();
DropDownChoice<String> searchScopeChoice = (DropDownChoice<String>) get(createComponentPath(ID_SEARCH_FORM, ID_SEARCH_SCOPE));
String scope = searchScopeChoice.getModelObject();
if (StringUtils.isBlank(object)) {
object = null;
}
PageBase page = getPageBase();
PrismContext context = page.getPrismContext();
S_AtomicFilterExit q;
if (object == null || SEARCH_SCOPE_ONE.equals(scope)) {
q = context.queryFor(OrgType.class).isDirectChildOf(oid);
} else {
q = context.queryFor(OrgType.class).isChildOf(oid);
}
if (object == null) {
return q.build();
}
PolyStringNormalizer normalizer = context.getDefaultPolyStringNormalizer();
String normalizedString = normalizer.normalize(object);
if (StringUtils.isEmpty(normalizedString)) {
return q.build();
}
ObjectQuery query = q.and().block().item(OrgType.F_NAME).containsPoly(normalizedString).matchingNorm().or().item(OrgType.F_DISPLAY_NAME).containsPoly(normalizedString).matchingNorm().build();
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Searching child orgs of org {} with query:\n{}", oid, query.debugDump());
}
return query;
}
use of com.evolveum.midpoint.gui.api.page.PageBase in project midpoint by Evolveum.
the class AbstractTreeTablePanel method refreshTabbedPanel.
protected void refreshTabbedPanel(AjaxRequestTarget target) {
PageBase page = getPageBase();
TabbedPanel<ITab> tabbedPanel = findParent(TabbedPanel.class);
IModel<List<ITab>> tabs = tabbedPanel.getTabs();
if (tabs instanceof LoadableModel) {
((LoadableModel) tabs).reset();
}
if (tabs.getObject() != null && tabs.getObject().size() > 0) {
tabbedPanel.setSelectedTab(0);
}
target.add(tabbedPanel);
target.add(page.getFeedbackPanel());
}
Aggregations