Package org.apache.tomcat.util

Examples of org.apache.tomcat.util.XMLTree


  reset();

  // Parse the input stream into an XMLTree
  XMLParser parser = new XMLParser();
  XMLTree config = parser.process(stream);
  if (!config.getName().equals(Constants.Element.TOMCAT_USERS))
      return;
  Enumeration e;

  // Process the defined users
  e = config.getElements(Constants.Element.USER).elements();
  while (e.hasMoreElements())
      readUser((XMLTree) e.nextElement());

  // Process the defined groups
  e = config.getElements(Constants.Element.GROUP).elements();
  while (e.hasMoreElements())
      readGroup((XMLTree) e.nextElement());

  // Process the defined roles
  e = config.getElements(Constants.Element.ROLE).elements();
  while (e.hasMoreElements())
      readRole((XMLTree) e.nextElement());

    }
View Full Code Here


  // Process the associated group memberships
  Enumeration e =
      element.getElements(Constants.Element.USER_MEMBER).elements();
  while (e.hasMoreElements()) {
      XMLTree um = (XMLTree) e.nextElement();
      String username =
    (String) um.getAttribute(Constants.Attribute.NAME);
      FileRealmUser user = getUser(username);
      if (user != null)
    user.addGroup(group);
  }
View Full Code Here

  Enumeration e = null;

  // Process the associated group memberships
  e = element.getElements(Constants.Element.GROUP_MEMBER).elements();
  while (e.hasMoreElements()) {
      XMLTree gm = (XMLTree) e.nextElement();
      String groupname =
    (String) gm.getAttribute(Constants.Attribute.NAME);
      FileRealmGroup group = getGroup(groupname);
      if (group != null)
    group.addRole(role);
  }

  // Process the associated user memberships
  e = element.getElements(Constants.Element.USER_MEMBER).elements();
  while (e.hasMoreElements()) {
      XMLTree um = (XMLTree) e.nextElement();
      String username =
    (String) um.getAttribute(Constants.Attribute.NAME);
      FileRealmUser user = getUser(username);
      if (user != null)
    user.addRole(role);
  }
View Full Code Here

  reset();

  // Parse the input stream into an XMLTree
  XMLParser parser = new XMLParser();
  XMLTree config = parser.process(stream);
  if (!config.getName().equals(Constants.Element.TOMCAT_USERS))
      return;
  Enumeration e;

  // Process the defined users
  e = config.getElements(Constants.Element.USER).elements();
  while (e.hasMoreElements())
      readUser((XMLTree) e.nextElement());

  // Process the defined groups
  e = config.getElements(Constants.Element.GROUP).elements();
  while (e.hasMoreElements())
      readGroup((XMLTree) e.nextElement());

  // Process the defined roles
  e = config.getElements(Constants.Element.ROLE).elements();
  while (e.hasMoreElements())
      readRole((XMLTree) e.nextElement());

    }
View Full Code Here

  // Process the associated group memberships
  Enumeration e =
      element.getElements(Constants.Element.USER_MEMBER).elements();
  while (e.hasMoreElements()) {
      XMLTree um = (XMLTree) e.nextElement();
      String username =
    (String) um.getAttribute(Constants.Attribute.NAME);
      FileRealmUser user = getUser(username);
      if (user != null)
    user.addGroup(group);
  }
View Full Code Here

  Enumeration e = null;

  // Process the associated group memberships
  e = element.getElements(Constants.Element.GROUP_MEMBER).elements();
  while (e.hasMoreElements()) {
      XMLTree gm = (XMLTree) e.nextElement();
      String groupname =
    (String) gm.getAttribute(Constants.Attribute.NAME);
      FileRealmGroup group = getGroup(groupname);
      if (group != null)
    group.addRole(role);
  }

  // Process the associated user memberships
  e = element.getElements(Constants.Element.USER_MEMBER).elements();
  while (e.hasMoreElements()) {
      XMLTree um = (XMLTree) e.nextElement();
      String username =
    (String) um.getAttribute(Constants.Attribute.NAME);
      FileRealmUser user = getUser(username);
      if (user != null)
    user.addRole(role);
  }
View Full Code Here

      this.webApplicationDescriptor.addSecurityConstraint(sc);
  }
    }
   
    private void processLoginConfig() {
  XMLTree flTree = this.config.getFirstElement(Constants.LOGIN_CONFIG);
  if (flTree != null) {
      LoginConfiguration lc = (LoginConfiguration) this.factory.createDescriptor(LoginConfiguration.class);
      if (flTree.getFirstElement(Constants.AUTH_METHOD) != null) {
    lc.setAuthenticationMethod(flTree.getFirstElement(Constants.AUTH_METHOD).getValue());
      }
      if (flTree.getFirstElement(Constants.REALM_NAME) != null) {
    lc.setRealmName(flTree.getFirstElement(Constants.REALM_NAME).getValue());
      }
      if (flTree.getFirstElement(Constants.FORM_LOGIN_CONFIG) != null) {
    XMLTree formTree = flTree.getFirstElement(Constants.FORM_LOGIN_CONFIG);
    lc.setFormLoginPage(formTree.getFirstElement(Constants.FORM_LOGIN_PAGE).getValue());
    lc.setFormErrorPage(formTree.getFirstElement(Constants.FORM_ERROR_PAGE).getValue());
      }
      this.webApplicationDescriptor.setLoginConfiguration(lc);
  }
 
    }
View Full Code Here

    private Vector parseWelcomeFiles(Enumeration welcomeFiles) {
        Vector welcomeFilesV = new Vector();

        while (welcomeFiles.hasMoreElements()) {
      XMLTree x = (XMLTree)welcomeFiles.nextElement();

            welcomeFilesV.addElement((String)x.getValue().trim());
  }

  return welcomeFilesV;
    }
View Full Code Here

    private int getSessionTimeOut(Enumeration sessionTimeOuts) {
        Integer sessionTimeOut = new Integer(-1);

  while (sessionTimeOuts.hasMoreElements()) {
      XMLTree x = (XMLTree)sessionTimeOuts.nextElement();

      try {
          sessionTimeOut = new Integer(x.getValue().trim());
      } catch (Exception e) {
      }
  }
 
  return sessionTimeOut.intValue();
View Full Code Here

      throw new Exception(msg);
  }
    }

    private void processIcon() {
        XMLTree iconTree = this.config.getFirstElement(Constants.ICON);

  if (iconTree != null) {
      // there is icon information

      XMLTree smallIconTree =
          iconTree.getFirstElement(Constants.SMALL_ICON);

      if (smallIconTree != null) {
          this.webApplicationDescriptor.setSmallIconUri(
        smallIconTree.getValue());
      }
     
      XMLTree largeIconTree =
          iconTree.getFirstElement(Constants.LARGE_ICON);

      if (largeIconTree != null) {
          webApplicationDescriptor.setLargeIconUri(
        largeIconTree.getValue());
      }
  }
    }
View Full Code Here

TOP

Related Classes of org.apache.tomcat.util.XMLTree

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.