comparison flys-client/src/main/java/de/intevation/flys/client/server/CollectionHelper.java @ 3509:bb5edff31866

Cosmetics. flys-client/trunk@5279 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 28 Aug 2012 13:10:14 +0000
parents 5161e25392ea
children 953480be5543
comparison
equal deleted inserted replaced
3508:60984be9bcfa 3509:bb5edff31866
605 return list; 605 return list;
606 } 606 }
607 607
608 608
609 /** 609 /**
610 * 610 * From a document, parse the settings for an output and create an
611 * OutputSettings object.
611 */ 612 */
612 protected static Settings parseSettings(String outName, Element node) { 613 protected static Settings parseSettings(String outName, Element node) {
613 OutputSettings set = new OutputSettings(outName); 614 OutputSettings set = new OutputSettings(outName);
614 615
615 NodeList elements = node.getElementsByTagName("settings"); 616 NodeList elements = node.getElementsByTagName("settings");
618 return set; 619 return set;
619 } 620 }
620 621
621 Element settings = (Element)elements.item(0); 622 Element settings = (Element)elements.item(0);
622 623
623 // get the categories 624 // Get the categories
624 NodeList catNodes = settings.getChildNodes(); 625 NodeList catNodes = settings.getChildNodes();
625 for (int i = 0; i < catNodes.getLength(); i++) { 626 for (int i = 0; i < catNodes.getLength(); i++) {
626 Element catNode = (Element)catNodes.item(i); 627 Element catNode = (Element)catNodes.item(i);
627 628
628 // The category name 629 // The category name
632 NodeList list = catNode.getChildNodes(); 633 NodeList list = catNode.getChildNodes();
633 634
634 // iterate through all properties or groups. 635 // iterate through all properties or groups.
635 List<Property> props = new ArrayList<Property> (); 636 List<Property> props = new ArrayList<Property> ();
636 for (int j = 0; j < list.getLength(); j++) { 637 for (int j = 0; j < list.getLength(); j++) {
637 Property p = new PropertySetting(); 638 Property p;
638 Element e = (Element)list.item(j); 639 Element e = (Element)list.item(j);
639 if (e.hasChildNodes() && 640 if (e.hasChildNodes() &&
640 e.getFirstChild().getNodeType() != Node.TEXT_NODE) { 641 e.getFirstChild().getNodeType() != Node.TEXT_NODE) {
641 p = parseSettingsGroup(e); 642 p = parseSettingsGroup(e);
642 } 643 }
667 return p; 668 return p;
668 } 669 }
669 670
670 671
671 /** 672 /**
672 * 673 * From a property element create a Property object.
673 */ 674 */
674 protected static Property parseSetting(Element property){ 675 protected static Property parseSetting(Element property){
675 NamedNodeMap attrMap = property.getAttributes(); 676 NamedNodeMap attrMap = property.getAttributes();
676 int attrNum = attrMap != null ? attrMap.getLength() : 0; 677 int attrNum = attrMap != null ? attrMap.getLength() : 0;
677 678
718 */ 719 */
719 protected static CollectionItem parseCollectionItem( 720 protected static CollectionItem parseCollectionItem(
720 Element node, 721 Element node,
721 boolean outs 722 boolean outs
722 ) { 723 ) {
723 logger.debug("AddArtifactServiceImpl.parseCollectionItem"); 724 logger.debug("CollectionHelper.parseCollectionItem");
724 725
725 if (node == null) { 726 if (node == null) {
726 logger.debug("The node for parsing CollectionItem is null!"); 727 logger.debug("The node for parsing CollectionItem is null!");
727 return null; 728 return null;
728 } 729 }

http://dive4elements.wald.intevation.org