Futilities/v0.6/clade/Apps/ftm/Kiosk/@code/removed

From WoozleCodes
Jump to navigation Jump to search
Removed Code

This functionality was moved into the class yesterday:

#
enum eKiosk : string {

    // These need to match the XML WUIDL names.
    case CMD_COMPARE  = 'opt.comp';
    #case CMD_DELETE   = 'opt.del';
    #case CMD_IGNDATE  = 'opt.ign.date';
    #case CMD_FINISH   = 'opt.finish';
    case CMD_COPY     = 'do.copy';
    case CMD_MOVE     = 'do.move';
    case CMD_TRIM     = 'do.trim';
    case CMD_COUNT    = 'do.count';

    static public function InReqClassFor(string $sName) : ?string {
        #echo "INPUT NAME=[$sName]".CRLF;
        switch ($sName) {
            case self::CMD_COMPARE->value: $sc = InRqSpace\cFlag::class; break;
            case self::CMD_COPY->value: $sc = InRqSpace\Action\cCopy::class; break;
            case self::CMD_MOVE->value: $sc = InRqSpace\Action\cMove::class; break;
            case self::CMD_TRIM->value: $sc = InRqSpace\Action\cTrim::class; break;
            case self::CMD_COUNT->value: $sc = InRqSpace\Action\cCount::class; break;
            default:
              // Anything without an explicit class is assumed to be a settable value:
              $sc = InRqClass::class;
        }
        #echo "NAME=[$sName] CLASS=[$sc]".CRLF;
        return $sc;
    }
}

Commented out 04-04 and 04-03:

#
    /**
     * ACTION: describe the app and what it's planning to do
     *  (or would try to do but can't for some reason),
     *  based on the current command-line options.
     */
    // 2025-04-04 moved up to parent
    public function DescribeActions() : string {
        // 2025-04-03 What if we just copy from DBA?
        $oScrn = self::Screen();

        $sSelf = $this->FTagFor_AppItem()->Summary();
        $osPath = $this->QStoragePath();
        $sOut = $sSelf.CRLF;

        $oActs = $this->Actions();

        $nActs = $oActs->Count();
        if ($nActs == 0) {
            $sOut .= 'No action requested.'.CRLF;
            $sOut .= $this->RenderHelpText();
        } else {
            $sS = ($nActs == 1) ? '' : 's';
            $sOut .= "Planned action$sS:".CRLF;
            $oList = $oScrn->NewList();
            foreach ($oActs as $sKey => $oAct) {
                $oList->AddLine($oAct->Describe());
            }
            $sOut .= $oList->Render();

        }
        return $sOut;

    }
    // 2025-04-03 I *think* this is outdated now.
    protected function ItemInReqClass(TInstItemIface $oOpt) : string {
        $oaAttrs = $oOpt->Attrs();
        $sName = $oaAttrs->QName()->GetIt();

        // TO BE MODIFIED FOR FTM
        switch ($sName) {
          case 'do.list':
            $scAct = ListAction::class;
            break;
          case 'do.read';
            break;
          case 'do.write';
            break;
          default:
        }
        #$sOptName = $oaAttrs
        #echo $oaAttrs->ReflectObject()->Report();
        return $scAct;
    }

Was already commented out:

#
    // CEMENT BaseClass
    protected function MinQtyTerms() : int { return 1; }
    // CEMENT BaseClass
    protected function RenderTooFewTerms(int $qTerms) : string {
        switch($qTerms) {
          case 0: return "You must enter a target folder for the backup.";
          #case 1: return "You must also enter a target folder.";
        }
    }