Futilities/v0.6/clade/Kiosk/WUIDL/@fx/ReadInput
< Futilities | v0.6 | clade | Kiosk | WUIDL
Jump to navigation
Jump to search
About
- Action: match the input arguments up against the available (app) parameters, and turn them into an Action sequence
- Defined by Ferreteria
Code
#
public function ReadInput() {
// + OBJECTS
$oScrn = self::Screen();
$osDex = $this->QInDadex(); // object encapsulating the input command
// - OBJECTS
// Iterate through the input command/request and add InReqs to the Actions() list:
if ($osDex->HasIt()) {
#self::GotToHere();
$oDex = $osDex->GetIt();
$oaActs = $this->Actions();
while ($oDex->HasData()) {
$oPair = $oDex->FirstPairPull(); // get the next argument
$sArgKey = $oPair->Name(); // key for input argument
#$this->AmHere("ArgKey=[$sArgKey]");
$oTInst = $this->MainTag();
$oCues = $oTInst->GetFTags()->InputCues();
// search Cues for input commandlet ($sArgKey)
$osTDCue = $oCues->QryIt($sArgKey);
if ($osTDCue->HasIt()) {
$oTDCue = $osTDCue->GetIt(); // [WF]Sys\Data\tree\XML\tags\cue\cFound
$oTDItem = $oTDCue->GetOuter();
#$this->AmHere('$oTDItem class: '.get_class($oTDItem));
// create an Action for this option-tag
$scAct = $this->ItemInReqClass($oTDItem); // look up Action class for the reqItem holding this cue
$sArgVal = $oPair->HasValue() ? $oPair->Value() : ''; // input argument value, if any
//+DEBUG
#$oTTItem = $oTDItem->Type();
#echo $oTTItem->ReflectThis()->Report(); // DEBUG
#$sTag = $oTTItem->Name(); // name of tag-type
#$this->AmHere(" -- ArgName=[".$oPair->Name()."] tag=[$sTag] ArgVal=[$sArgVal]");
//-DEBUG
$oAct = ($scAct)::FromItemPiece($oTDItem,$oPair); // create Action-object for it
$oaActs->Append($oAct); // add Action to the sequence
} else {
$oErr = new ErrorClass("input argument [$sArgKey] not recognized.");
$this->Errors()->AddMsgObject($oErr);
}
}
}
}