Mailing List webobjects-dev@wocommunity.org Message #510
From: Markus Ruggiero (rucotec) <markus.ruggiero@rucotec.ch>
Subject: Re: [WO-DEV] How can I access EOEntity userInfo documentation with EOGenerator?
Date: Sun, 12 May 2024 08:59:25 +0200
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>

On 11 May 2024, at 18:24, Ralf Schuchardt <rasc@gmx.de> wrote:

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


Thanks, that works. Who would have thought so? As far as I know EOEntity does not have a documentation accessor, so there must be some internal coding that maps the dictionaries and extracts the documentation.

But now I have the next problem:

I can put the comments into _MyClass.java and MyClass.java. Once EOGen has run there will not be any updates to MyClass.java anymore. What if I update the documentation? The updated doc goes into the regenerated _MyClass.java but is NOT reflected in MyClass.java. The javadoc {@inheritDoc} only works for stuff _inside_ the class definition but not for the class  documentation itself.

Do you know of any way to make hovering over MyClass in Eclipse show the combined javadoc from _MyClass and MyClass?

The conceptual documentation of an entity clearly goes into _MyClass and additional implementation specific documentation should go into MyClass. But often I need to see the conceptual documentation of MyClass. Of course I can command-click MyClass to open MyClass.java where I can hover over the super class and see the doc but this “messes up my mental editing context” and I lose track where I was and where to go back to.

Any idea?

---markus---

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