Mailing List webobjects-dev@wocommunity.org Message #509
From: Ralf Schuchardt <rasc@gmx.de>
Subject: Re: [WO-DEV] How can I access EOEntity userInfo documentation with EOGenerator?
Date: Sat, 11 May 2024 18:24:15 +0200
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>

The documentation from EntityModeller should be directly accessible under the documentation key, e.g.

/**
#if ($entity.documentation) * ${entity.documentation}
#end
 */
public abstract class ${entity.prefixClassNameWithoutPackage}

I have similar constructs in my template for attributes, relationships and fetch specifications.

Ralf

Markus Ruggiero (rucotec) schrieb am 11. May 2024, um 14:54 Uhr:

When creating documentation for an entity in the Documentation tab in EntityModeler the resulting doc is put into the userInfo dictionary. How can I access this with EOGenerator?

userInfo = {
"_EntityModeler" = {
documentation = "doc for EMRTreatmentStep\n<ul>\n\t<li>a list entry</li>\n</ul>";
};
};

Tried different KV-paths in the template file but failed whenever I explicitly used the key “_EntityModeler” with/out “_”, with/out capital “E”. Using “_” results in a syntax error during generation.

Accessing the user info dict itself works

Using
${entity.userInfo}

results in
{_EntityModeler={documentation=doc for EMRTreatmentStep
<ul>
<li>a list entry</li>
</ul>}}

Which is great so far but two key too high in the key path.
However going deeper only dumps the given path itself into the result
${entity.userInfo.entityModeler}

results in
${entity.userInfo.entityModeler}

I expect this to result in something like
{documentation=doc for EMRTreatmentStep
<ul>
<li>a list entry</li>
</ul>}

Seems like EOGenerator explicitly ignores the key “_EntityModeler”

I can put my own javaDoc key into the user info dict, this works, but the text input field in WOLips EntityModeler is way too small in the userInfo editor.
What is the documentation good for if I cannot access it?

Any ideas?

Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster