Examples of WidgetConfig


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

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

    }
    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

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

  }

  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

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

        final ByteArrayOutputStream outstr = new ByteArrayOutputStream();
        final GenericResponseWrapper wrapper = new GenericResponseWrapper(response, outstr);
        chain.doFilter(request, wrapper);
        wrapper.flush();
        //
        WidgetConfig widgetConfig = (WidgetConfig) request
        .getAttribute(WidgetConfig.KEY);
        Long timeToLiveSeconds = parseTimeToLiveSeconds(widgetConfig.getCache());
        // Return the page info
        return new PageInfo(wrapper.getStatus(), wrapper.getContentType(),
                wrapper.getCookies(),
                outstr.toByteArray(), false, timeToLiveSeconds, wrapper.getAllHeaders());
  }
View Full Code Here

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

  protected WidgetConfig getWidgetConfig(HttpServletRequest request) {
    return (WidgetConfig) request.getAttribute(WidgetConfig.KEY);
  }
 
  protected String prepareCache(HttpServletRequest request) {
    WidgetConfig widgetConfig =getWidgetConfig(request);
    //
    StringBuffer keyBuffer = new StringBuffer(request.getRequestURI());
    if(request.getQueryString()!=null) {
      keyBuffer.append("?").append(request.getQueryString());
    }
    keyBuffer.append("T").append(widgetConfig.getId());
    Set<String> widgetIds = widgets.get(widgetConfig.getName());
    if(widgetIds==null) {
      widgetIds = new HashSet<String>();
    }
    widgetIds.add(keyBuffer.toString());
    widgets.put(widgetConfig.getName(), widgetIds);
    //
    return keyBuffer.toString();
  }
View Full Code Here

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

    Element element = new Element(key, value, false, getCacheTime(key), getCacheTime(key));
    getCache().put(element);
  }
 
  protected Integer getCacheTime(Object key) {
    WidgetConfig widgetConfig = (WidgetConfig) key;
    String cache = StringUtils.isNotBlank(widgetConfig.getCache()) ? widgetConfig.getCache() : "-1";
    return Integer.parseInt(cache);
  }
View Full Code Here

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

      for(Element widgetEle : widgetEles) {
        String nameW = XMLUtil.getAttribute(widgetEle, "name");
        String pathW = XMLUtil.getAttribute(widgetEle, "path");
        String cssClassW = XMLUtil.getAttribute(widgetEle, "cssClass");
        String cacheW = XMLUtil.getAttribute(widgetEle, "cache");
        WidgetConfig widgetConfig = new WidgetConfig(nameW, pathW, cssClassW, cacheW);
        //
        Element titleEle = XMLUtil.getChildElement(widgetEle, "title");
        if(titleEle!=null) {
          String titleW = XMLUtil.getValue(titleEle);
          widgetConfig.setTitle(titleW);
        }
        //
        Element prefsEle = XMLUtil.getChildElement(widgetEle, "prefs");
        if(prefsEle!=null) {
        List<Element> prefEles = XMLUtil.getChildElements(prefsEle);
          for(Element prefEle : prefEles) {
            String key = XMLUtil.getName(prefEle);
            String value = XMLUtil.getValue(prefEle);
            widgetConfig.addPref(key, value);
          }
        }
        pageConfig.add(nameP, widgetConfig);
      }
    }
View Full Code Here

Examples of org.sgx.yuigwt.yui.widget.WidgetConfig

    yuiWidget = yuiWidget.toLowerCase();
    // System.out.println(yuiWidget);

    // if (n.hasClass(CLASS_TABVIEW)) {
    if (yuiWidget != null && yuiWidget.equals("tabview")) {
      WidgetConfig config = TabViewConfig.create().srcNode(n);
      config = y.merge(config, nodeConfig).cast();
      w = y.newTabView(config).render();
    }

    // else if (n.hasClass(CLASS_BUTTON)) {
    else if (yuiWidget != null && yuiWidget.equals("button")) {
      Element e = n.getDOMNode();
      NodeList prevChildren = n.children();
     
      String prevId = n.get("id");
      String prevClass = e.getClassName();
     
      WidgetConfig config = ButtonConfig.create().srcNode(n);
      config = y.merge(config, nodeConfig).cast();
      w = y.newButton(config).render();
      e = w.contentBox().getDOMNode();
     
      //fix - re set previous id and class attributes - http://jsfiddle.net/cancerbero_sgx/MPc4g/3/
      e.setClassName(e.getClassName()+" "+prevClass);
      y.one(e).prepend(prevChildren);
      n.set("id", prevId);
    }
   
    else if (yuiWidget != null && yuiWidget.equals("togglebutton")) {
      Element e = n.getDOMNode();
      NodeList prevChildren = n.children();
     
      String prevId = n.get("id");
      String prevClass = e.getClassName();
     
      WidgetConfig config = ButtonConfig.create().srcNode(n);
      config = y.merge(config, nodeConfig).cast();
      w = y.newToggleButton(config).render();
     
      e = w.contentBox().getDOMNode();
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.