String login=""; boolean pmanager = false; boolean architect = false; boolean analyst = false; boolean redactor = false;
	public Project buildProject(String projectName)	{		ArrayList userRights= new ArrayList();		ArrayList usersRights = new ArrayList();		ArrayList usersLogin= new ArrayList();				//Project projet;				XPath xpath = XPathFactory.newInstance().newXPath();		String expression = "//project[@name='"+projectName+"']";		String login="";		boolean pmanager = false;		boolean architect = false;		boolean analyst = false;		boolean redactor = false;				String exprRight="";		Element elem = null;		Element usersNode = null;		NodeList usersNodeList;				try {			usersNode = (Element)xpath.evaluate(expression, this.doc, XPathConstants.NODE);			if(usersNode.hasChildNodes()){				Node nodeAll = null;				Node nodeLogin = null;								NamedNodeMap map = null;				usersNodeList = usersNode.getChildNodes();				for (int i=0; i<usersNodeList.getLength(); i++)				{					nodeAll = usersNodeList.item(i);					map = nodeAll.getAttributes();										if(map!=null){												nodeLogin = map.getNamedItem(ATTR_LOGIN);												if(nodeLogin!=null){									login = nodeLogin.getNodeValue();														//on recupere eventuellement la balise pmanager							exprRight = "//project[@name='"+projectName+"']/user[@login='"+login+"']/rights/" + RIGHT_PMANAGER;							try {								elem = (Element)xpath.evaluate(exprRight, this.doc, XPathConstants.NODE);}							catch (XPathExpressionException e) {								e.printStackTrace(); }							if (elem != null) pmanager=true;														//on recupere eventuellement la balise architect							exprRight = "//project[@name='"+projectName+"']/user[@login='"+login+"']/rights/" + RIGHT_ARCHITECT;							try {								elem = (Element)xpath.evaluate(exprRight, this.doc, XPathConstants.NODE);}							catch (XPathExpressionException e) {								e.printStackTrace(); }							if (elem != null) architect=true;														//on recupere eventuellement la balise analyst							exprRight = "//project[@name='"+projectName+"']/user[@login='"+login+"']/rights/" + RIGHT_ANALYST;							try {								elem = (Element)xpath.evaluate(exprRight, this.doc, XPathConstants.NODE);}							catch (XPathExpressionException e) {								e.printStackTrace(); }							if (elem != null) analyst=true;														//on recupere eventuellement la balise redactor							exprRight = "//project[@name='"+projectName+"']/user[@login='"+login+"']/rights/" + RIGHT_REDACTOR;							try {								elem = (Element)xpath.evaluate(exprRight, this.doc, XPathConstants.NODE);}							catch (XPathExpressionException e) {								e.printStackTrace(); }							if (elem != null) redactor=true;													//on fixe les droit de l'utilisateur courant							userRights.add(new Boolean(pmanager));							userRights.add(new Boolean(architect));							userRights.add(new Boolean(analyst));							userRights.add(new Boolean(redactor));														//on ajoute simultanement dans les deux liste resultat le login de l'utilsateur et des droits							usersLogin.add(login);							usersRights.add(userRights);						}					}				}			}			else {				System.out.println("Pas de fils");			}					}		catch (XPathExpressionException e) {			System.out.println("buildProject: Le projet "+projectName+" n'existe pas.");			e.printStackTrace();		}		return new Project(projectName, usersRights, usersLogin);	}