|
definition: |
toShortView :: ToHtmlGenerator
toShortView erdname (Entity entityName attrlist) _ _ =
stCmtFunc
("The short view of a " ++ entityName ++ " entity as a string.\n"++
"This view is used in menus and comments to refer to a " ++ entityName ++
" entity.")
(thisModuleName erdname, (lowerFirst entityName)++"ToShortView")
2
Public
(baseType (model erdname, entityName) ~> stringType)
[simpleRule [CPVar (1,eName)]
(case attributeDomain firstKeyAttribute of
StringDom _ -> accessFirstKeyAttribute
_ -> applyF (pre "show") [accessFirstKeyAttribute]
)]
where
eName = lowerFirst entityName
accessFirstKeyAttribute =
applyF (model erdname, eName ++ attributeName firstKeyAttribute)
[cvar eName]
firstKeyAttribute = findKeyAttribute attrlist attrlist
findKeyAttribute (attr@(Attribute _ _ key _):attrList) fullList =
if key == Unique then attr
else findKeyAttribute attrList fullList
findKeyAttribute [] fullList = head fullList
|
|
demand: |
argument 2 |
|
deterministic: |
deterministic operation |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,{Entity},_,_) |-> _}
|
|
name: |
toShortView |
|
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 |