From: <ap...@vh...> - 2006-05-22 22:11:38
|
Author: apevec Date: 2006-05-23 00:07:59 +0200 (Tue, 23 May 2006) New Revision: 1143 Modified: trunk/ccm-ldn-exporter/src/com/arsdigita/london/exporter/CategoryExporter.java Log: make CategoryExporter usable with Terms importer tool Modified: trunk/ccm-ldn-exporter/src/com/arsdigita/london/exporter/CategoryExporter.java =================================================================== --- trunk/ccm-ldn-exporter/src/com/arsdigita/london/exporter/CategoryExporter.java 2006-05-22 21:29:35 UTC (rev 1142) +++ trunk/ccm-ldn-exporter/src/com/arsdigita/london/exporter/CategoryExporter.java 2006-05-22 22:07:59 UTC (rev 1143) @@ -122,12 +122,13 @@ Category cat = (Category)cats.getDomainObject(); int id = idMap.size() + 1; idMap.put(cat, new Integer(id)); - - Element term = domain.newChildElement("terms:term", - TERMS_XML_NS); - term.addAttribute("id", new Integer(id).toString()); - term.addAttribute("name", cat.getName()); - term.addAttribute("inAtoZ", "false"); + if (!cat.equals(root)) { + Element term = domain.newChildElement("terms:term", + TERMS_XML_NS); + term.addAttribute("id", new Integer(id).toString()); + term.addAttribute("name", cat.getName()); + term.addAttribute("inAtoZ", "false"); + } } save(domain, @@ -200,10 +201,11 @@ dstTerm.addAttribute("id", idMap.get(dstCat).toString()); if (dstCat.getDefaultParentCategory().equals(srcCat)) { - src.addAttribute("isDefault", "true"); + dst.addAttribute("isDefault", "true"); } else { - src.addAttribute("isDefault", "false"); + dst.addAttribute("isDefault", "false"); } + dst.addAttribute("isPreferred", "true"); } private void exportItems(Category root, |