# Copyright for the Uniform Repository Service (c) 1995 - 2013,
# by Gerald Banon. All rights reserved.
# Version 2.1
# getIibiproperties.tcl
# example of use
# http://banon-pc3/getibiproperties?parsedibiurl.ibitype=ibip&parsedibiurl.ibi=3ERPFQRT3W/39AFDTP
# criterionList is a list for an array with the following entries (see GetURLPropertyList):
# default value example value domain description
# parsedibiurl.ibitype required ibip rep ibip ibin
# parsedibiurl.ibi required 3ERPFQRT3W/39AFDTP
# parsedibiurl.verblist optional ResolveIBIURL GetFieldValueList ResolveIBIURL GetMetadata GetFieldValueList GetFileList GetAppropriateSimilar GetAppropriateMetadata
# parsedibiurl.similaritycriteria optional language lastEdition language lastEdition {language lastEdition} {lastEdition language}
# parsedibiurl.similaritycriteriaformetadata optional language language language
# parsedibiurl.fieldnamelist optional {} translationList translationList nextEdition
## parsedibiurl.responselanguage optional tcl tcl tcl
# parsedibiurl.metadataformat optional Free BibTeX Free BibTeX BibINPE Short
# parsedibiurl.metadataheader optional {Content-Type: text/html} "Content-Type: text/html" "Content-Type: text/html" "Content-disposition: attachment; filename=meatadata.txt"
# parsedibiurl.metadatafieldnamelist optional {} {identifier nexthigherunit shorttitle}
# parsedibiurl.cssfileurl optional {} http://urlib.net/iconet.com.br/banon/2003/05.31.10.45/mirrorStandard.css
## parsedibiurl.filelistformat optional {}
# parsedibiurl.requiredsite optional {} banon-pc3
# parsedibiurl.requiredmetadatatimestamp optional {} 2012:03.10.18.15.31
# parsedibiurl.requireddocumentstate optional {Registered Original} {Registered Original} {Registered Original} {Modified Original} {Copy of an Original} {Modified Copy of an Original} {Unchecked}
# parsedibiurl.filepath optional {} Readme.html
# parsedibiurl.querylist optional {} choice short
# parsedibiurl.requiredmirror optional {} dpi.inpe.br/banon/1999/06.19.17.00 used to define the search scope for FindURLPropertyList and for the header appearance in Get
# parsedibiurl.requiredsite has priority over parsedibiurl.requiredmetadatatimestamp
# parsedibiurl.requiredmetadatatimestamp has priority over parsedibiurl.requireddocumentstate
# clientinformation.ipaddress optional {} 192.168.1.100
# clientinformation.languagepreference optional {} pt-br,en;q=0.5 pt-br,en;q=0.5 en pt-BR languagebutton otherwise browser setting
# clientinformation.contextlanguage optional {} pt-BR en pt-BR result of FindLanguage (see FindPreferredLanguage) - the available language satisfying the language preference
# clientinformation.contextlanguage is needed when there is no target file (because of displaydoccontent.cgi - see CreateAbsolutePath)
proc GetIBIProperties {} {
if [catch {
global env
puts {Content-Type: text/plain}
puts {}
# col
set col ../../../../..
# URLibServiceRepository
set URLibServiceRepository $env(URLIB_SERVICE_REP)
source ../$col/$URLibServiceRepository/doc/cgi/mirrorfind-.tcl ;# MultipleExecute
source ../$col/$URLibServiceRepository/doc/utilities1.tcl ;# ReturnTimeOutReference
# cgi
if [info exists env(QUERY_STRING)] {
foreach {name value} [split $env(QUERY_STRING) &=] {
set cgi([DecodeURL $name]) [DecodeURL $value]
}
}
# criterionList
set criterionList {}
foreach fieldName [array names cgi] {
lappend criterionList $fieldName $cgi($fieldName)
}
# serverAddress (used in CreateTclPage and SetFieldValue only)
set serverAddress [list $env(SERVER_NAME) $env(URLIB_PORT)]
# MULTIPLE SUBMIT
set command [list list GetURLPropertyList $criterionList]
# puts $command
set siteList [list $serverAddress]
set searchResultList [MultipleExecute $siteList $command] ;# scenario 0 - level 1 is for MultipleSubmit be able to reach currentRep
puts $searchResultList
} m] {puts $m; if 0 {global errorInfo; puts $errorInfo}}
}