*/
public class OODTProcesses {
public Map<String, Map<String, String>> getAllProducts(OODTConfig config, String productTypeName) throws Exception {
XmlRpcFileManagerClient client = config.getXMLRpcClient();
ProductType type = client.getProductTypeByName(productTypeName);
if (type == null) {
throw new Exception("FileManager returned null ProductType");
}
ProductPage firstPage = client.getFirstPage(type);
if (firstPage == null) {
throw new Exception("FileManager returned null product page");
}
Map<String, Map<String, String>> o = new HashMap<String, Map<String, String>>();
for (int pid = 0; pid < firstPage.getTotalPages(); pid++) {
if (pid > 0) {
firstPage = client.getNextPage(type, firstPage);
}
for (Product p : firstPage.getPageProducts()) {
Metadata met = client.getMetadata(p);
Map<String, String> h = new HashMap<String, String>();
h.put("name", p.getProductName());
h.put("type", p.getProductType().getName());
h.put("structure", p.getProductStructure());