From: <rd...@us...> - 2003-06-11 20:02:24
|
Update of /cvsroot/digir/DiGIRprov/www In directory sc8-pr-cvs1:/tmp/cvs-serv20015 Modified Files: DiGIR_getCaps.php Log Message: - minQueryTermLength, maxSearchResponseRecords, maxInventoryResponseRecords values are first searched as normal tag values inside metadata, then as attribute "v" (to keep backward compatibility). - defaultRecordFormat, defaultInventoryConcept are not required anymore. Index: DiGIR_getCaps.php =================================================================== RCS file: /cvsroot/digir/DiGIRprov/www/DiGIR_getCaps.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DiGIR_getCaps.php 6 May 2003 20:33:22 -0000 1.3 --- DiGIR_getCaps.php 11 Jun 2003 20:02:20 -0000 1.4 *************** *** 28,38 **** * @param boolean $showError Indicates if an error value should be shown if the * $qry doesn't return any nodes. defautls to TRUE. */ ! function addMetaElement(&$xp,$qry,$nodeName,$srcFile,$showError=TRUE) { $nodes= $xp->match($qry); echo "<".$nodeName.">"; if (count($nodes) > 0) ! echo $xp->getData($nodes[0]); elseif ($showError) { --- 28,49 ---- * @param boolean $showError Indicates if an error value should be shown if the * $qry doesn't return any nodes. defautls to TRUE. + * @param string $defVal Default value for element if attribute is not set. */ ! function addMetaElement(&$xp,$qry,$nodeName,$srcFile,$showError=TRUE,$defVal='') { $nodes= $xp->match($qry); echo "<".$nodeName.">"; if (count($nodes) > 0) ! { ! $val = $xp->getData($nodes[0]); ! if (empty($val)) ! { ! //Look for value on attribute "v" ! $attrs = $xp->getAttributes($nodes[0]); ! $val = (isset($attrs['v'])) ? $attrs['v'] : $defVal; ! } ! echo $val; ! //echo $xp->getData($nodes[0]); ! } elseif ($showError) { *************** *** 66,71 **** { $attrs = $xp->getAttributes($nodes[0]); ! if (isset($attrs['v'])) ! echo $attrs['v']; else echo $defVal; --- 77,82 ---- { $attrs = $xp->getAttributes($nodes[0]); ! if (isset($attrs[$attrName])) ! echo $attrs[$attrName]; else echo $defVal; *************** *** 314,327 **** echo "<dateLastUpdated>".$ares[1]."</dateLastUpdated>\n"; ! addMetaElementAttr($xp2,'//configuration/metadata/minQueryTermLength', ! 'v',g_MinTextLength,'minQueryTermLength',$cPath); ! addMetaElementAttr($xp2,'//configuration/metadata/maxSearchResponseRecords', ! 'v',DIGIR_ABS_RECORD_LIMIT,'maxSearchResponseRecords',$cPath); ! addMetaElementAttr($xp2,'//configuration/metadata/maxInventoryResponseRecords', ! 'v',DIGIR_ABS_RECORD_LIMIT,'maxInventoryResponseRecords',$cPath); ! addMetaElementAttr($xp2,'//configuration/metadata/defaultRecordFormat', ! 'v','','defaultRecordFormat',$cPath); ! addMetaElementAttr($xp2,'//configuration/metadata/defaultInventoryConcept', ! 'v','','defaultInventoryConcept',$cPath); echo "</resource>\n"; } --- 325,334 ---- echo "<dateLastUpdated>".$ares[1]."</dateLastUpdated>\n"; ! addMetaElement($xp2,'//configuration/metadata/minQueryTermLength', ! 'minQueryTermLength',$cPath,TRUE,g_MinTextLength); ! addMetaElement($xp2,'//configuration/metadata/maxSearchResponseRecords', ! 'maxSearchResponseRecords',$cPath,TRUE,DIGIR_ABS_RECORD_LIMIT); ! addMetaElement($xp2,'//configuration/metadata/maxInventoryResponseRecords', ! 'maxInventoryResponseRecords',$cPath,TRUE,DIGIR_ABS_RECORD_LIMIT); echo "</resource>\n"; } |