Package com.ideo.jso.conf

Examples of com.ideo.jso.conf.Group


  }
 
  public void process(Group group, List resourcesName, List excludeResources, ServletContext servletContext, Writer out, String location) throws IOException {
    LOG.debug("Merging content of group : "+group.getName());
    for (Iterator iterator = group.getSubgroups().iterator(); iterator.hasNext();) {
      Group subGroup = (Group)iterator.next();
      String subLocation = subGroup.getBestLocation(location);
      ResourcesProcessor subGroupProcessor = null;
      if(subGroup.isMinimize()==null)
        subGroupProcessor = this;
      else
        subGroupProcessor = subGroup.getJSProcessor();
      subGroupProcessor.process(subGroup, subGroup.getJsNames(), excludeResources, servletContext, out, subLocation);
    }   
   
    for(Iterator it = resourcesName.iterator() ; it.hasNext();){
      URL url = null;
      String path = (String) it.next();
View Full Code Here


    excludeResources = null;
  }
 
  public void process(Group group, List resourcesName, List excludeResources, ServletContext servletContext, Writer out, String location) throws IOException {
    for (Iterator iterator = group.getSubgroups().iterator(); iterator.hasNext();) {
      Group subGroup = (Group)iterator.next();
      String subLocation = subGroup.getBestLocation(location);
      ResourcesProcessor subGroupProcessor = null;
      if(subGroup.isMinimize()==null)
        subGroupProcessor = this;
      else
        subGroupProcessor = subGroup.getCSSProcessor();
      subGroupProcessor.process(subGroup, subGroup.getJsNames(), excludeResources, servletContext, out, subLocation);
    }
   
    for(Iterator it = resourcesName.iterator() ; it.hasNext();){
      URL url = null;
      String path = (String) it.next();
View Full Code Here

 
  public void process(Group group, List resourcesName, List excludeResources, ServletContext servletContext, Writer out, String location) throws IOException {
   
    // Recursive call for sub groups.
    for (Iterator iterator = group.getSubgroups().iterator(); iterator.hasNext();) {
      Group subGroup = (Group)iterator.next();
      String subLocation = subGroup.getBestLocation(location);
      ResourcesProcessor subGroupProcessor = null;
      if(subGroup.isMinimize()==null)
        subGroupProcessor = this;
      else
        subGroupProcessor = subGroup.getJSProcessor();
      subGroupProcessor.process(subGroup, subGroup.getJsNames(), excludeResources, servletContext, out, subLocation);
    }

    // Appends
    for(Iterator it = resourcesName.iterator() ; it.hasNext();){
      URL url = null;
View Full Code Here

    List includeGroups = new ArrayList();
    StringTokenizer st = new StringTokenizer(groupNames, ",;", false);
    while (st.hasMoreTokens()) {
      String groupName = st.nextToken().trim();

      Group g = (Group) groups.get(groupName);
      if (g == null)
        throw new RuntimeException("Group '" + groupName + "' not found in any " + AbstractConfigurationLoader.getInstance().getConfigurationFileName());

      log.debug("Loading group : "+groupName);

      includeGroups.add(g);
    }

    for (int i = 0; i < includeGroups.size(); i++) {
      Group group = (Group) includeGroups.get(i);
      includeGroup(group, pageContext, out, exploded);
    }
  }
View Full Code Here

      AbstractGroupBuilder groupBuilder = AbstractGroupBuilder.getInstance();
      Map mapGroups = confLoader.getGroups();
      List alreadyIncludedResources = new ArrayList();
     
      for(int i=0;i<groups.length;++i){
        Group group = (Group) mapGroups.get(groups[i]);
       
        if (group == null) {
          throw new Exception("Group '" + groups[i] + "' isn't loaded.");
        }
        groupBuilder.buildGroupJsIfNeeded(group, out, null);
View Full Code Here

    // filename requested is a minimized js file and its strict name correspond to a group name.
    String grpName = URLUtils.getStrictFileName(fileName);
   
    Map groups = AbstractConfigurationLoader.getInstance().getUpdatedGroups();
   
    Group group = (Group)groups.get(grpName);
   
    // Starting to build js-minimized
    if (group != null) {
      ByteArrayOutputStream bufferOut = new ByteArrayOutputStream(OUT_BUFFER_SIZE);
      try {
        if( AbstractGroupBuilder.getInstance().buildGroupJsIfNeeded(group, bufferOut, getServletContext()) ){
          group.getJsBuffer().update(bufferOut.toByteArray(), timestamp);
        }
        bufferOut.flush();
      } finally {
        bufferOut.close();
      }
    }
   
    // Add content-type to response flow
    response.setContentType(URLUtils.getMimeTypeByExtension(extension) + "; CHARSET=" + URLUtils.DEFAULT_ENCODING);
   
    ResourcesBuffer buffer = null;
    if(extension != null && extension.toLowerCase().equals("js"))
      buffer = group.getJsBuffer();
    else
      buffer = group.getCssBuffer();
   
    response.getOutputStream().write(buffer.getData(), 0, buffer.getData().length);
  }
View Full Code Here

    checkConfigFileName("com/ideo/jso/junit/minimize/jso1.xml", 1, properties);
   
    Map groups = AbstractConfigurationLoader.getInstance().getUpdatedGroups();
   
    Group group = (Group) groups.get("group1m");
   
    // test if file is correctly merged
    checkMergedJSFiles(group, "group1_minimized.txt", "ISO-8859-1");
    // 2nd call without reseting group last load time should return empty file.
    checkMergedJSFilesAreEmpty(group, "ISO-8859-1");
   
    // 3rd call after reseting group last load time should return merged file.
    group.setLastLoadTime(0);
    checkMergedJSFiles(group, "group1_minimized.txt", "ISO-8859-1");
   
  }
View Full Code Here

    checkConfigFileName("com/ideo/jso/junit/minimize/jso1.xml", 1, properties);
   
    Map groups = AbstractConfigurationLoader.getInstance().getUpdatedGroups();
   
    Group group = (Group) groups.get("group3m");
   
    // test if file is correctly merged
    checkMergedJSFiles(group, "group3_minimized.txt", "ISO-8859-1");
    // 2nd call without reseting group last load time should return empty file.
    checkMergedJSFilesAreEmpty(group, "ISO-8859-1");
   
    // 3rd call after reseting group last load time should return merged file.
    group.setLastLoadTime(0);
    checkMergedJSFiles(group, "group3_minimized.txt", "ISO-8859-1");
   
    group = (Group) groups.get("group4m");
   
    // test if file is correctly merged
    checkMergedJSFiles(group, "group4_minimized.txt", "ISO-8859-1");
    // 2nd call without reseting group last load time should return empty file.
    checkMergedJSFilesAreEmpty(group, "ISO-8859-1");
   
    // 3rd call after reseting group last load time should return merged file.
    group.setLastLoadTime(0);
    checkMergedJSFiles(group, "group4_minimized.txt", "ISO-8859-1");
   
   
  }
View Full Code Here

    checkConfigFileName("com/ideo/jso/junit/minimize/jso2.xml", 1, properties);
   
    Map groups = AbstractConfigurationLoader.getInstance().getUpdatedGroups();
   
    Group group = (Group) groups.get("group3m");
    URLConf.setMockWebUrl("http://mocksite/MockContext/");
   
    // test if file is correctly merged
    checkMergedJSFiles(group, "group3_minimized.txt", "ISO-8859-1");
    // 2nd call without reseting group last load time should return empty file.
    checkMergedJSFilesAreEmpty(group, "ISO-8859-1");
   
    // 3rd call after reseting group last load time should return merged file.
    group.setLastLoadTime(0);
    checkMergedJSFiles(group, "group3_minimized.txt", "ISO-8859-1");
  }
View Full Code Here

    checkConfigFileName("com/ideo/jso/junit/minimize/jso2.xml", 1, properties);
   
    Map groups = AbstractConfigurationLoader.getInstance().getUpdatedGroups();
   
    Group group = (Group) groups.get("group3m");
    URLConf.setMockWebUrl("http://mocksite/MockContext/");
   
    // test if file is correctly merged
    checkMergedJSFiles(group, "group3_minimized.txt", "ISO-8859-1");
    // 2nd call without reseting group last load time should return empty file.
    checkMergedJSFilesAreEmpty(group, "ISO-8859-1");
   
    // 3rd call after reseting group last load time should return merged file.
    group.setLastLoadTime(0);
    checkMergedJSFiles(group, "group3_minimized.txt", "ISO-8859-1");
  }
View Full Code Here

TOP

Related Classes of com.ideo.jso.conf.Group

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.