Package org.dom4j.tree

Examples of org.dom4j.tree.DefaultElement.addElement()


    if ( service != null ) {
      List users = service.getAllUsers();
      for ( Iterator usersIterator = users.iterator(); usersIterator.hasNext(); ) {
        String username = usersIterator.next().toString();
        if ( ( null != username ) && ( username.length() > 0 ) ) {
          rootElement.addElement( "user" ).addCDATA( username );
        }
      }
    }
    return doc;
  }
View Full Code Here


    if ( service != null ) {
      List roles = service.getAllRoles();
      for ( Iterator rolesIterator = roles.iterator(); rolesIterator.hasNext(); ) {
        String roleName = rolesIterator.next().toString();
        if ( ( null != roleName ) && ( roleName.length() > 0 ) ) {
          rootElement.addElement( "role" ).addCDATA( roleName );
        }
      }
    }
    return doc;
  }
View Full Code Here

        String aclName = aclsIterator.next().toString();
        String aclMask =
            null != validPermissionsNameMap.get( aclName ) ? validPermissionsNameMap.get( aclName ).toString() : null;

        if ( ( null != aclName ) && ( aclName.length() > 0 ) && ( null != aclMask ) && ( aclMask.length() > 0 ) ) {
          Element aclElement = rootElement.addElement( "acl" );
          aclElement.addElement( "name" ).addCDATA( aclName );
          aclElement.addElement( "mask" ).setText( aclMask );
        }

      }
View Full Code Here

public class WebServiceUtil {

  public static Document createErrorDocument( String errorMsg ) {
    Element rootElement = new DefaultElement( "web-service" );
    Document doc = DocumentHelper.createDocument( rootElement );
    rootElement.addElement( "error" ).addAttribute( "msg", StringEscapeUtils.escapeXml( errorMsg ) );
    return doc;
  }

  public static Document createStatusDocument( String statusMsg ) {
    Element rootElement = new DefaultElement( "web-service" );
View Full Code Here

  }

  public static Document createStatusDocument( String statusMsg ) {
    Element rootElement = new DefaultElement( "web-service" );
    Document doc = DocumentHelper.createDocument( rootElement );
    rootElement.addElement( "status" ).addAttribute( "msg", StringEscapeUtils.escapeXml( statusMsg ) );
    return doc;
  }
}
View Full Code Here

    if ( service != null ) {
      List<String> users = service.getAllUsers();
      for ( Iterator<String> usersIterator = users.iterator(); usersIterator.hasNext(); ) {
        String username = usersIterator.next().toString();
        if ( ( null != username ) && ( username.length() > 0 ) ) {
          rootElement.addElement( "user" ).setText( username ); //$NON-NLS-1$
        }
      }
    }
    return doc;
  }
View Full Code Here

    if ( service != null ) {
      List<String> roles = service.getAllRoles();
      for ( Iterator<String> rolesIterator = roles.iterator(); rolesIterator.hasNext(); ) {
        String roleName = rolesIterator.next().toString();
        if ( ( null != roleName ) && ( roleName.length() > 0 ) ) {
          rootElement.addElement( "role" ).setText( roleName ); //$NON-NLS-1$
        }
      }
    }
    return doc;
  }
View Full Code Here

    if ( service != null ) {
      List<String> roles = service.getRolesForUser( null, user );
      for ( Iterator<String> rolesIterator = roles.iterator(); rolesIterator.hasNext(); ) {
        String roleName = rolesIterator.next().toString();
        if ( ( null != roleName ) && ( roleName.length() > 0 ) ) {
          rootElement.addElement( "role" ).setText( roleName ); //$NON-NLS-1$
        }
      }
    }
    return doc;
  }
View Full Code Here

    if ( service != null ) {
      List<String> users = service.getUsersInRole( null, role );
      for ( Iterator<String> usersIterator = users.iterator(); usersIterator.hasNext(); ) {
        String username = usersIterator.next().toString();
        if ( ( null != username ) && ( username.length() > 0 ) ) {
          rootElement.addElement( "user" ).setText( username ); //$NON-NLS-1$
        }
      }
    }
    return doc;
  }
View Full Code Here

        String aclName = aclsIterator.next().toString();
        String aclMask =
            null != validPermissionsNameMap.get( aclName ) ? validPermissionsNameMap.get( aclName ).toString() : null;

        if ( ( null != aclName ) && ( aclName.length() > 0 ) && ( null != aclMask ) && ( aclMask.length() > 0 ) ) {
          Element aclElement = rootElement.addElement( "acl" ); //$NON-NLS-1$
          aclElement.addElement( "name" ).setText( aclName ); //$NON-NLS-1$
          aclElement.addElement( "mask" ).setText( aclMask ); //$NON-NLS-1$
        }

      }
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.