CurryInfo: spicey-4.2.0 / Spicey.ControllerGeneration.listController

definition: Info
 
listController :: ControllerGenerator
listController erdname (Entity entityName _) _ _ =
  controllerFunction
    ("Lists all " ++ entityName ++ " entities with buttons to show, delete,\n"++
     "or edit an entity.")
    entityName "list" 0
    controllerType
    [simpleRule [] -- no arguments
      (applyF (pre "$")
          [applyF checkAuthorizationFunc
            [applyF (enauthModName,lowerFirst entityName ++ "OperationAllowed")
              [applyF (authorizationModule,"ListEntities") []]],
           CLambda [CPVar infovar] $ doExpr
            [CSPat (CPVar entsvar)
                   (applyF (model erdname,"runQ")
                      [constF (model erdname,"queryAll" ++ entityName ++ "s")]),
             CSExpr (applyF (pre "return")
                           [applyF (viewFunctionName entityName "list")
                                   [CVar infovar, CVar entsvar]])
            ]
         ]
        )]
 where
  infovar = (0, "sinfo")
  entsvar = (1, lowerFirst entityName ++ "s")
demand: Info
 argument 2
deterministic: Info
 deterministic operation
documentation: Info
 
---------------------------------------------------------------------------
failfree: Info
 (_, _, _, _)
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,{Entity},_,_) |-> _}
name: Info
 listController
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 String -> Database.ERD.Entity -> [Database.ERD.Relationship]
-> [Database.ERD.Entity] -> AbstractCurry.Types.CFuncDecl
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term