From: Mikael K. <mik...@gm...> - 2007-06-16 13:52:20
|
Hello, I'm still working on my xml output and I'd like to get mysql ids for each resource or person I print out. This way, I'll be able to create a temp table in mysql and use relations between existing datas and what come sin xml format. Is it possible ? Regards, -- Mikael Kermorgant PS : current code looks like this : public void allocatableToXML(Allocatable[] alls, boolean isPerson, java.io.PrintWriter out) { String blockName = (isPerson)? "person" : "resource"; if (alls.length > 0) { out.println(" <" + blockName + "s>"); for (int j=0;j< alls.length;j++) { Classification classification = alls[j].getClassification(); String allKey = classification.getType().getElementKey(); Attribute[] attributes = classification.getAttributes(); out.println(" <" + blockName + " key='" + allKey + "' >"); out.println(" <" + blockName + "Type>" + classification.getType().getName(getLocale()) + "</resourceType>"); out.println(" <displayName>" + alls[j].getName(getLocale()) + "</displayName>"); for (int k=0; k<attributes.length; k++) { String attributeKey = attributes[k].getKey(); if (attributes[k].getType() == AttributeType.CATEGORY ) { Category cat = (Category) classification.getValue (attributeKey); out.println(" <" + attributeKey + ">" + cat.getName(getLocale()) + "</" + attributeKey + ">"); } else { Object attributeValue = classification.getValue(attributeKey); out.println(" <" + attributeKey + ">" + attributeValue.toString() + "</" + attributeKey + ">"); } } out.println(" </" + blockName + ">"); } out.println(" </" + blockName + "s>"); } } |