CurryInfo: spicey-4.2.0 / Spicey.ControllerGeneration.deleteController

definition:
deleteController :: ControllerGenerator
deleteController erdname (Entity entityName _) _ _ =
  let entlc    = lowerFirst entityName  -- entity name in lowercase
      entvar   = (0, entlc)             -- entity parameter for controller
      sinfovar = (1, "sinfo")           -- "sinfo" parameter
  in
  controllerFunction
  ("Deletes a given "++entityName++" entity (after asking for confirmation)\n"++
   "and proceeds with the list controller.")
  entityName "delete" 1
  (baseType (model erdname, entityName) ~> controllerType)
  [simpleRule [CPVar entvar]
    (applyF (pre "$")
       [applyF checkAuthorizationFunc
         [applyF (enauthModName,entlc++"OperationAllowed")
                 [applyF (authorizationModule,"DeleteEntity") [CVar entvar]]],
        CLambda [CPVar sinfovar] $
         applyF (spiceyModule,"confirmDeletionPage")
                [CVar sinfovar,
                 applyF (pre "concat")
                   [list2ac [string2ac "Really delete entity \"",
                             applyF (entitiesToHtmlModule erdname,
                                     entlc ++ "ToShortView")
                                    [CVar entvar],
                             string2ac "\"?"]]]])]
demand:
argument 2
deterministic:
deterministic operation
documentation:
------------------------------------------------------------------------------
--- Generates controller to delete an entity after confirmation.
failfree:
(_, _, _, _)
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,{Entity},_,_) |-> _}
name:
deleteController
precedence:
no precedence defined
result-values:
_
signature:
String -> Database.ERD.Entity -> [Database.ERD.Relationship]
-> [Database.ERD.Entity] -> AbstractCurry.Types.CFuncDecl
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term