Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/de/intevation/artifactdatabase/rest/FactoriesResource.java @ 32:c2d53bd30ab8
Re-factored artifact API for better integration of background processing.
artifacts/trunk@78 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 13 Sep 2009 14:50:53 +0000 |
parents | ccc6aae25585 |
children | af22d4de275c |
comparison
equal
deleted
inserted
replaced
31:c4d85a8532d1 | 32:c2d53bd30ab8 |
---|---|
51 root.appendChild(type); | 51 root.appendChild(type); |
52 | 52 |
53 Element factories = ec.create("factories"); | 53 Element factories = ec.create("factories"); |
54 root.appendChild(factories); | 54 root.appendChild(factories); |
55 | 55 |
56 String [] factoryNames = db.getArtifactFactoryNames(); | 56 String [][] factoryNames = db.artifactFactoryNamesAndDescriptions(); |
57 | 57 |
58 for (int i = 0; i < factoryNames.length; ++i) { | 58 for (int i = 0; i < factoryNames.length; ++i) { |
59 String [] nd = factoryNames[i]; | |
59 Element factoryElement = ec.create("factory"); | 60 Element factoryElement = ec.create("factory"); |
60 ec.addAttr(factoryElement, "name", factoryNames[i]); | 61 ec.addAttr(factoryElement, "name", nd[0]); |
62 ec.addAttr(factoryElement, "description", nd[1]); | |
61 factories.appendChild(factoryElement); | 63 factories.appendChild(factoryElement); |
62 } | 64 } |
63 | 65 |
64 return new DomRepresentation( | 66 return new DomRepresentation( |
65 MediaType.APPLICATION_XML, document); | 67 MediaType.APPLICATION_XML, document); |