Package org.osforce.spring4me.web.widget

Examples of org.osforce.spring4me.web.widget.WidgetConfig


    //
    return validatePermissions(request);
  }
 
  protected boolean validatePermissions(HttpServletRequest request) {
    WidgetConfig widgetConfig = (WidgetConfig) request.getAttribute(WidgetConfig.KEY) ;
    if(widgetConfig!=null) {
      Project project = (Project) request.getAttribute(PROJECT_KEY);
      User user = (User) request.getAttribute(USER_KEY);
      String requestPath = widgetConfig.getPath();
      Permission permission = permissionMappings.get(requestPath);
      if(permission!=null) {
        // validate user
        if(permission.userRequired() && user==null) {
          return false;
View Full Code Here


    }
    return true;
  }

  protected void resolveHandlerMethodPermission(HttpServletRequest request, Object handler) {
    WidgetConfig widgetConfig = (WidgetConfig) request.getAttribute(WidgetConfig.KEY) ;
    if(widgetConfig!=null) {
      String requestPath = widgetConfig.getPath();
      if(!permissionMappings.containsKey(requestPath)) {
        HandlerMethodResolver handlerMethodResolver = new HandlerMethodResolver();
        handlerMethodResolver.init(handler.getClass());
        RequestMapping classRequestMapping = AnnotationUtils.findAnnotation(handler.getClass(), RequestMapping.class);
        String[] namespaces = classRequestMapping.value();
View Full Code Here

  }

  public Object resolveArgument(MethodParameter methodParameter,
      NativeWebRequest webRequest) throws Exception {
    Class<?> paramType = methodParameter.getParameterType();
    WidgetConfig widgetConfig = (WidgetConfig) webRequest
        .getAttribute(WidgetConfig.KEY, WebRequest.SCOPE_REQUEST);
    Object value = null;
    if(paramType.isAssignableFrom(Page.class)) {
      value = getPage(widgetConfig, webRequest.getNativeRequest(HttpServletRequest.class));
      return returnValue(webRequest, value, Page.class);
View Full Code Here

TOP

Related Classes of org.osforce.spring4me.web.widget.WidgetConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.