/** * Gets the parameter map to apply from wherever appropriate * * @param ac The action context * @return The parameter map to apply */ protected Map<String, Object> retrieveParameters(ActionContext ac) { return ac.getParameters(); }
public String intercept(ActionInvocation invocation) throws Exception { final ActionContext context = invocation.getInvocationContext(); Map<String, Object> parameters = context.getParameters(); String[] values = (String[]) parameters.get("csrfPreventionSalt"); String salt = values[0]; ...
ActionContext context = ActionContext.getContext(); Map<String, Object> params = context.getParameters(); String userId = findParam("idUser", params); public String findParam(String key, Map<String, Object> params) { Object obj = params.get(key); if(obj != null) { String[] values = (String[])obj; return values.length > 0 ? values[0] : null; } return null; }
private Map<String, Object> getScopedMap(int scope) { switch (scope) { case SCOPE_REQUEST: return _context.getParameters(); case SCOPE_SESSION: return _context.getSession(); case SCOPE_GLOBAL_SESSION: return _context.getApplication(); default: throw new IllegalStateException("unknown scope=" + scope); } }
private void createApsActionParam(String entandoActionName, ActionInvocation invocation) { String[] blocks = entandoActionName.split("[?]"); if (blocks.length == 2) { String paramBlock = blocks[1]; String[] params = paramBlock.split(";"); for (int i=0; i<params.length; i++) { Map parameters = invocation.getInvocationContext().getParameters(); HttpServletRequest request = ServletActionContext.getRequest(); String[] parameter = params[i].split("="); if (parameter.length == 2) { request.setAttribute(parameter[0], parameter[1]); parameters.put(parameter[0], parameter[1]); } } } }
private Map<String, Object> getScopedMap(int scope) { switch (scope) { case SCOPE_REQUEST: return _context.getParameters(); case SCOPE_SESSION: return _context.getSession(); case SCOPE_GLOBAL_SESSION: return _context.getApplication(); default: throw new IllegalStateException("unknown scope=" + scope); } }
protected String getNextActionOrSuccess() { List<NextAction> stack = getNextActionStack(false); if (stack == null || stack.isEmpty()) return SUCCESS; NextAction next = stack.remove(stack.size() - 1); Map<String, String[]> params = next.getParameters(); if (params != null && !params.isEmpty()) { ActionContext context = ActionContext.getContext(); Map<String, Object> contextParameters = context.getParameters(); contextParameters.putAll(params); } return next.getAction(); }
private int getBackCount(ActionContext context) { int count = 1; Object value = context.get("count"); if (value != null) count = Integer.parseInt(value.toString()); Map<String, Object> params = context.getParameters(); value = params.get("count"); if (value != null) count = Integer.parseInt(value.toString()); ValueStack stack = context.getValueStack(); value = stack.findValue("count"); if (value != null) count = Integer.parseInt(value.toString()); return count; } }
Map<String, Object> previousParams = ac.getParameters();
protected String getNextActionOrSuccess() { List<NextAction> stack = getNextActionStack(false); if (stack == null || stack.isEmpty()) return SUCCESS; NextAction next = stack.remove(stack.size() - 1); Map<String, String[]> params = next.getParameters(); if (params != null && !params.isEmpty()) { ActionContext context = ActionContext.getContext(); Map<String, Object> contextParameters = context.getParameters(); contextParameters.putAll(params); } return next.getAction(); }
@Override public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); AgiRequest request = AgiEntryPoint.getAgiRequest(context); Map<?, ?> r = request.getRequest(); /** * This interceptor will be called multiple times in the course of * processing the actions for a call, so we only check the reset user param * once */ Object value = r.remove(RESET_USER); if (value != null && value.equals("true")) context.getParameters().put(PhoneNumberLoginInterceptor.RESET_USER, Boolean.TRUE); return invocation.invoke(); }
@Override public String intercept(ActionInvocation invocation) throws Exception { Map<String, Object> parameters = invocation.getInvocationContext().getParameters(); HashSet<String> paramsToRemove = new HashSet<String>(); Map<String, Boolean> includesExcludesMap = getIncludesExcludesMap(); for (String param : parameters.keySet()) { boolean currentAllowed = !isDefaultBlock(); for (String currRule : includesExcludesMap.keySet()) { if (param.startsWith(currRule) && (param.length() == currRule.length() || isPropSeperator(param.charAt(currRule.length())))) { currentAllowed = includesExcludesMap.get(currRule).booleanValue(); } } if (!currentAllowed) { paramsToRemove.add(param); } } if (LOG.isDebugEnabled()) { LOG.debug("Params to remove: " + paramsToRemove); } for (Object aParamsToRemove : paramsToRemove) { parameters.remove(aParamsToRemove); } return invocation.invoke(); }
@SuppressWarnings("unchecked") public SavedActionInvocation( ActionInvocation invocation ) { namespace = invocation.getProxy().getNamespace(); actionName = invocation.getProxy().getActionName(); methodName = invocation.getProxy().getMethod(); parameterMap = new HashMap<String, Object>(); parameterMap.putAll( invocation.getInvocationContext().getParameters() ); }
&& (null != this.paramNames)) { ActionContext ac = invocation.getInvocationContext(); final Map<String, Object> parameters = ac.getParameters();
@Override public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); Map<String, Object> params = context.getParameters(); String phoneNumber = getPhoneNumber(params); phoneNumber = PhoneNumberLibrary.normalizePhoneNumber(phoneNumber); if (phoneNumber != null && phoneNumber.length() > 0) { UserIndexKey key = new UserIndexKey(UserIndexTypes.PHONE_NUMBER, phoneNumber); if( params.containsKey(RESET_USER)) _indexedUserDetailsService.resetUserForIndexKey(key); // Ensure that we have authentication, even if it's anonymous if (!isCurrentUserLoggedInWithKey(key)) { IndexedUserDetails userDetails = _indexedUserDetailsService.getOrCreateUserForIndexKey( key, "", false); DefaultUserAuthenticationToken token = new DefaultUserAuthenticationToken( userDetails); SecurityContextHolder.getContext().setAuthentication(token); } } return invocation.invoke(); }
protected void find() { //get requested locale Map<String, Object> params = actionInvocation.getInvocationContext().getParameters(); storage = Storage.SESSION.toString(); requestedLocale = findLocaleParameter(params, parameterName); if (requestedLocale != null) { return; } requestedLocale = findLocaleParameter(params, requestOnlyParameterName); if (requestedLocale != null) { storage = Storage.NONE.toString(); } }
@Override public String intercept(ActionInvocation invocation) throws Exception { ActionContext context = invocation.getInvocationContext(); Map<String, Object> params = context.getParameters(); String phoneNumber = getPhoneNumber(params); phoneNumber = PhoneNumberLibrary.normalizePhoneNumber(phoneNumber); if (phoneNumber != null && phoneNumber.length() > 0) { UserIndexKey key = new UserIndexKey(UserIndexTypes.PHONE_NUMBER, phoneNumber); if( params.containsKey(RESET_USER)) _indexedUserDetailsService.resetUserForIndexKey(key); // Ensure that we have authentication, even if it's anonymous if (!isCurrentUserLoggedInWithKey(key)) { IndexedUserDetails userDetails = _indexedUserDetailsService.getOrCreateUserForIndexKey( key, "", false); DefaultUserAuthenticationToken token = new DefaultUserAuthenticationToken( userDetails); SecurityContextHolder.getContext().setAuthentication(token); } } return invocation.invoke(); }
extraContext.put(ActionContext.PARAMETERS, ActionContext.getContext().getParameters()); extraContext.put(CHAIN_HISTORY, ActionChainResult.getChainHistory());
protected String executeAction() throws Throwable { ActionContext ac = this.getActionContext(); ac.setParameters(HttpParameters.create(this.request.getParameterMap()).build()); ac.getParameters().appendAll(this.parameters); String result = this.proxy.execute(); return result; }
this.cleanupParamIds(actionContext.getParameters());