From: Arne V. <cob...@us...> - 2004-04-26 22:28:42
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv964/src/org/jrobin/core Modified Files: Util.java XmlTemplate.java Log Message: JRobin 1.3.1 - Improved Value Grid calculation - Updated RrdGraph for read-only opening of RRD files - Added STEP and SAMPLES rpn values - Added first_day_of_week XML option for time_axis node - Added gprint overload with specific base value - Added TOTAL aggregate for datasources - Improved graph XML parsing (legend and comments do not get trimmed any longer) Index: XmlTemplate.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/XmlTemplate.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** XmlTemplate.java 15 Mar 2004 10:40:50 -0000 1.6 --- XmlTemplate.java 26 Apr 2004 22:28:33 -0000 1.7 *************** *** 178,188 **** } ! protected String getChildValue(Node parentNode, String childName) throws RrdException { ! String value = Util.Xml.getChildValue(parentNode, childName); return resolveMappings(value); } ! protected String getValue(Node parentNode) { ! String value = Util.Xml.getValue(parentNode); return resolveMappings(value); } --- 178,196 ---- } ! protected String getChildValue( Node parentNode, String childName ) throws RrdException { ! return getChildValue( parentNode, childName, true ); ! } ! ! protected String getChildValue(Node parentNode, String childName, boolean trim) throws RrdException { ! String value = Util.Xml.getChildValue(parentNode, childName, trim); return resolveMappings(value); } ! protected String getValue( Node parentNode ) { ! return getValue( parentNode, true ); ! } ! ! protected String getValue(Node parentNode, boolean trim ) { ! String value = Util.Xml.getValue(parentNode, trim); return resolveMappings(value); } Index: Util.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/Util.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Util.java 22 Mar 2004 09:20:12 -0000 1.13 --- Util.java 26 Apr 2004 22:28:33 -0000 1.14 *************** *** 351,360 **** } ! static String getChildValue(Node parentNode, String childName) throws RrdException { NodeList children = parentNode.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if (child.getNodeName().equals(childName)) { ! return getValue(child); } } --- 351,365 ---- } ! // -- Wrapper around getChildValue with trim ! static String getChildValue( Node parentNode, String childName ) throws RrdException { ! return getChildValue( parentNode, childName, true ); ! } ! ! static String getChildValue( Node parentNode, String childName, boolean trim ) throws RrdException { NodeList children = parentNode.getChildNodes(); for (int i = 0; i < children.getLength(); i++) { Node child = children.item(i); if (child.getNodeName().equals(childName)) { ! return getValue(child, trim); } } *************** *** 362,371 **** } static String getValue(Node node) { String value = null; Node child = node.getFirstChild(); if(child != null) { value = child.getNodeValue(); ! if(value != null) { value = value.trim(); } --- 367,381 ---- } + // -- Wrapper around getValue with trim static String getValue(Node node) { + return getValue( node, true ); + } + + static String getValue(Node node, boolean trimValue ) { String value = null; Node child = node.getFirstChild(); if(child != null) { value = child.getNodeValue(); ! if( value != null && trimValue ) { value = value.trim(); } |