use of org.olat.core.id.context.StateMapped in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
the class OrdersSearchForm method setStateEntry.
public boolean setStateEntry(StateEntry state) {
boolean changed = false;
if (state instanceof StateMapped) {
StateMapped map = (StateMapped) state;
String refNo = map.getDelegate().get("refNo");
if (StringHelper.containsNonWhitespace(refNo)) {
refNoEl.setValue(refNo);
changed = true;
}
String fromStr = map.getDelegate().get("from");
if (StringHelper.containsNonWhitespace(fromStr)) {
fromEl.setValue(fromStr);
changed = true;
}
String toStr = map.getDelegate().get("to");
if (StringHelper.containsNonWhitespace(toStr)) {
toEl.setValue(toStr);
changed = true;
}
}
return changed;
}
use of org.olat.core.id.context.StateMapped in project OpenOLAT by OpenOLAT.
the class OrdersSearchForm method getStateEntry.
public StateEntry getStateEntry() {
StateMapped entry = new StateMapped();
Long refNo = getRefNo();
if (refNo != null) {
entry.getDelegate().put("refNo", refNo.toString());
}
String fromStr = fromEl.getValue();
if (StringHelper.containsNonWhitespace(fromStr)) {
entry.getDelegate().put("from", fromStr);
}
String toStr = toEl.getValue();
if (StringHelper.containsNonWhitespace(toStr)) {
entry.getDelegate().put("to", toStr);
}
return entry;
}
use of org.olat.core.id.context.StateMapped in project OpenOLAT by OpenOLAT.
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));
}
}
}
use of org.olat.core.id.context.StateMapped in project openolat by klemens.
the class OrdersSearchForm method getStateEntry.
public StateEntry getStateEntry() {
StateMapped entry = new StateMapped();
Long refNo = getRefNo();
if (refNo != null) {
entry.getDelegate().put("refNo", refNo.toString());
}
String fromStr = fromEl.getValue();
if (StringHelper.containsNonWhitespace(fromStr)) {
entry.getDelegate().put("from", fromStr);
}
String toStr = toEl.getValue();
if (StringHelper.containsNonWhitespace(toStr)) {
entry.getDelegate().put("to", toStr);
}
return entry;
}
Aggregations