use of org.olat.core.id.context.StateMapped in project OpenOLAT by OpenOLAT.
the class UsermanagerUserSearchForm method getStateEntry.
protected StateMapped getStateEntry() {
StateMapped state = new StateMapped();
if (items != null) {
for (Map.Entry<String, FormItem> itemEntry : items.entrySet()) {
String key = itemEntry.getKey();
FormItem f = itemEntry.getValue();
if (f instanceof TextElement) {
state.getDelegate().put(key, ((TextElement) f).getValue());
}
}
}
if (auth.isMultiselect()) {
// auth.
}
if (roles.isMultiselect()) {
//
}
if (status.isOneSelected()) {
//
}
return state;
}
use of org.olat.core.id.context.StateMapped in project OpenOLAT by OpenOLAT.
the class PaypalTransactionsController method addSearchToHistory.
protected void addSearchToHistory(UserRequest ureq) {
String transactionId = tableEl.getQuickSearchString();
StateMapped state = new StateMapped();
if (StringHelper.containsNonWhitespace(transactionId)) {
state.getDelegate().put("transactionId", transactionId);
}
ContextEntry currentEntry = getWindowControl().getBusinessControl().getCurrentContextEntry();
if (currentEntry != null) {
currentEntry.setTransientState(state);
}
addToHistory(ureq, getWindowControl());
}
use of org.olat.core.id.context.StateMapped in project openolat by klemens.
the class PaypalTransactionsController method addSearchToHistory.
protected void addSearchToHistory(UserRequest ureq) {
String transactionId = tableEl.getQuickSearchString();
StateMapped state = new StateMapped();
if (StringHelper.containsNonWhitespace(transactionId)) {
state.getDelegate().put("transactionId", transactionId);
}
ContextEntry currentEntry = getWindowControl().getBusinessControl().getCurrentContextEntry();
if (currentEntry != null) {
currentEntry.setTransientState(state);
}
addToHistory(ureq, getWindowControl());
}
use of org.olat.core.id.context.StateMapped in project openolat by klemens.
the class PaypalTransactionsController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (state instanceof StateMapped) {
StateMapped map = (StateMapped) state;
String transactionId = map.getDelegate().get("transactionId");
if (StringHelper.containsNonWhitespace(transactionId)) {
tableEl.quickSearch(ureq, transactionId);
}
}
if (entries == null || entries.isEmpty())
return;
Long trxId = entries.get(0).getOLATResourceable().getResourceableId();
PaypalTransaction trx = dataModel.getTransaction(trxId);
if (trx != null) {
doSelectTransaction(ureq, trx);
}
}
use of org.olat.core.id.context.StateMapped in project openolat by klemens.
the class UsermanagerUserSearchForm method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (state instanceof StateMapped) {
StateMapped searchState = (StateMapped) state;
searchform.setStateEntry(searchState);
if (entries != null && entries.size() > 0) {
String table = entries.get(0).getOLATResourceable().getResourceableTypeName();
if ("table".equals(table)) {
entries.remove(0);
event(ureq, searchform, Event.DONE_EVENT);
}
}
}
if (entries == null || entries.isEmpty())
return;
for (int i = 0; i < entries.size(); i++) {
String resourceType = entries.get(i).getOLATResourceable().getResourceableTypeName();
if ("Identity".equalsIgnoreCase(resourceType)) {
Long identityKey = entries.get(i).getOLATResourceable().getResourceableId();
Identity found = null;
if (tdm != null) {
for (Identity identity : tdm.getObjects()) {
if (identityKey.equals(identity.getKey())) {
found = identity;
}
}
}
if (found == null) {
found = securityManager.loadIdentityByKey(identityKey);
if (found == null)
return;
List<Identity> foundIdentites = new ArrayList<>();
foundIdentites.add(found);
initUserListCtr(ureq, foundIdentites, 0);
}
fireEvent(ureq, new SingleIdentityChosenEvent(found));
}
}
}
Aggregations