[kepler-dev] [Bug 2386] - Customize Documentation in Kepler removes

Edward A. Lee eal at eecs.berkeley.edu
Sat Apr 29 03:42:59 PDT 2006


Thanks for pointing this out...

I have checked in the fix for this bug into the PtII CVS.

I also fixed a similar bug with parameters (if you added
a parameter, documented it, and later deleted it, the parameter
continued to be represented in the DocAttribute).

I also fixed another bug where if you did the above while
a model was executing, you would get an exception.  Now,
customization of documentation always occurs within a change request.

I tried to update the bugzilla entry, but couldn't log in (?).

Edward


At 02:37 PM 4/28/2006, Nandita Mangal wrote:
>hi Edward,
>Thanks for your input. I have fixed the bug occuring . I wanted to 
>ask you about another bug in  Documentation System :)
>http://bugzilla.ecoinformatics.org/show_bug.cgi?id=2425
>
>It occurs in both Ptolemy and Kepler, where if a user adds new ports 
>via configure
>and then later deletes them. The MOML's DocAttribute still retains 
>the old "deleted"ports information.
>And these "deleted ports" show up in future  CustomizeDocumentation 
>Forms as well.
>I guess  MOML change request needs to be called to remove the 
>"deleted" ports from MOML's docAttribute property as soon as one 
>deletes ports for any actor.
>
>thanks,
>nandita.
>
>
>
>Edward A. Lee wrote:
>
>>
>>Nandita:
>>
>>The DocViewer class code like the following in several places,
>>including _getPortEntries():
>>
>>             if (doc == null) {
>>                 doc = "No port description.";
>>                 // See if the next tier has documentation.
>>                 DocManager nextTier = manager.getNextTier();
>>                 if (nextTier != null) {
>>                     String nextDoc = nextTier.getPortDoc(port.getName());
>>                     if (nextDoc != null) {
>>                         doc = nextDoc;
>>                     }
>>                 }
>>             }
>>
>>The getNextTier() method of DocManager gets the port documentation
>>using code like this:
>>
>>         if (_isInstanceDoc) {
>>             _nextTier = new DocManager(_targetClass);
>>         } else {
>>             Class superClass = _targetClass.getSuperclass();
>>             if (_isNamedObj(superClass)) {
>>                 _nextTier = new DocManager(superClass);
>>             }
>>         }
>>
>>Hope this helps.
>>
>>Edward
>>
>>
>>At 11:11 AM 4/28/2006, you wrote:
>>
>>>Hi Edward,
>>>I wanted to ask you a code specific question in 
>>>"GetDocumentationAction" from the following scenario
>>>when if a docAttribute exists (i.e CustomizeDoc has been called 
>>>and docAttribute was added via MOMLChangeRequest).
>>>
>>>In this case , (correct me if i am wrong) we get the DocAttribute 
>>>and display it via the DocTableau. However I am unsure
>>>where the javadocs information is called in this process i.e ports 
>>>n params information and how that is displayed as well
>>>in the DocTableau. I believe in Ptolemy when one customizes 
>>>documentation both newly added docAttribute as well as original
>>>ports/params information show up. However I am unsure how & where
>>>ports/params info (from doc/codeDoc/classname.xml in case of Ptolemy)
>>>is made to show here in the DocViewer.
>>>
>>>I am trying to solve a Kepler bug where CustomizeDocumentation 
>>>deletes all previous ports/params information for some reason and only
>>>shows the newly added "DocAttribute" information.
>>>
>>>Another interesting point in this case, is that if i just click on 
>>>"CustomizeDoc" and click "cancel"...even then
>>>an empty docAttribute is created in the MOML as follows:
>>><property name="DocAttribute" class="ptolemy.vergil.basic.DocAttribute">
>>>        </property>
>>>The above also shows no actor documentaiton in  DocViewer.
>>>
>>>"GetDocumentationAction" from the Ptolemy documentation structure 
>>>is the only class that i have customized in Kepler.
>>>(where i only change location of javadocs from doc/codeDoc to a 
>>>Kepler-Docs location)
>>>
>>>Kindly feel free to correct my understanding of Ptolemy's 
>>>documentation structure working if I am wrong.
>>>Thanks so much.
>>>
>>>nandita.
>>>
>>>
>>>
>>>
>>>
>>>
>>>//From "GetDocumentationAction.java"
>>>DocAttribute docAttribute = (DocAttribute) docAttributes
>>>                    .get(docAttributes.size() - 1);
>>>            // Need to create an effigy and tableau.
>>>            Effigy context = Configuration.findEffigy(target);
>>>            if (context == null) {
>>>                context = Configuration.findEffigy(target.getContainer());
>>>                if (context == null) {
>>>                    MessageHandler.error("Cannot find an effigy for "
>>>                            + target.getFullName());
>>>                }
>>>            }
>>>            ComponentEntity effigy = context.getEntity("DocEffigy");
>>>            if (effigy == null) {
>>>                try {
>>>                    effigy = new DocEffigy(context, "DocEffigy");
>>>                } catch (KernelException exception) {
>>>                    throw new InternalErrorException(exception);
>>>                }
>>>            }
>>>            if (!(effigy instanceof DocEffigy)) {
>>>                MessageHandler.error("Found an effigy named DocEffigy that "
>>>                        + "is not an instance of DocEffigy!");
>>>            }
>>>            ((DocEffigy) effigy).setDocAttribute(docAttribute);
>>>            ComponentEntity tableau = ((Effigy) 
>>> effigy).getEntity("DocTableau");
>>>            if (tableau == null) {
>>>                try {
>>>                    tableau = new DocTableau((DocEffigy) effigy, 
>>> "DocTableau");
>>>                    ((DocTableau) tableau).setTitle("Documentation for "
>>>                            + target.getFullName());
>>>                } catch (KernelException exception) {
>>>                    throw new InternalErrorException(exception);
>>>                }
>>>            }
>>>            if (!(tableau instanceof DocTableau)) {
>>>                MessageHandler.error("Found a tableau named 
>>> DocTableau that "
>>>                        + "is not an instance of DocTableau!");
>>>            }
>>>            ((DocTableau) tableau).show()
>>>
>>>DocAttribute docAttribute = (DocAttribute) docAttributes
>>>                    .get(docAttributes.size() - 1);
>>>            // Need to create an effigy and tableau.
>>>            Effigy context = Configuration.findEffigy(target);
>>>            if (context == null) {
>>>                context = Configuration.findEffigy(target.getContainer());
>>>                if (context == null) {
>>>                    MessageHandler.error("Cannot find an effigy for "
>>>                            + target.getFullName());
>>>                }
>>>            }
>>>            ComponentEntity effigy = context.getEntity("DocEffigy");
>>>            if (effigy == null) {
>>>                try {
>>>                    effigy = new DocEffigy(context, "DocEffigy");
>>>                } catch (KernelException exception) {
>>>                    throw new InternalErrorException(exception);
>>>                }
>>>            }
>>>            if (!(effigy instanceof DocEffigy)) {
>>>                MessageHandler.error("Found an effigy named DocEffigy that "
>>>                        + "is not an instance of DocEffigy!");
>>>            }
>>>            ((DocEffigy) effigy).setDocAttribute(docAttribute);
>>>            ComponentEntity tableau = ((Effigy) 
>>> effigy).getEntity("DocTableau");
>>>            if (tableau == null) {
>>>                try {
>>>                    tableau = new DocTableau((DocEffigy) effigy, 
>>> "DocTableau");
>>>                    ((DocTableau) tableau).setTitle("Documentation for "
>>>                            + target.getFullName());
>>>                } catch (KernelException exception) {
>>>                    throw new InternalErrorException(exception);
>>>                }
>>>            }
>>>            if (!(tableau instanceof DocTableau)) {
>>>                MessageHandler.error("Found a tableau named 
>>> DocTableau that "
>>>                        + "is not an instance of DocTableau!");
>>>            }
>>>            ((DocTableau) tableau).show();
>>>
>>>
>>>
>>>bugzilla-daemon at ecoinformatics.org wrote:
>>>
>>>>http://bugzilla.ecoinformatics.org/show_bug.cgi?id=2386
>>>>
>>>>
>>>>altintas at sdsc.edu changed:
>>>>
>>>>           What    |Removed                     |Added
>>>>---------------------------------------------------------------------------- 
>>>>
>>>>         AssignedTo|altintas at sdsc.edu           |nmangal at sdsc.edu
>>>>             Status|ASSIGNED                    |NEW
>>>>
>>>>
>>
>>------------
>>Edward A. Lee
>>Professor, Chair of the EE Division, Associate Chair of EECS
>>231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
>>phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
>>eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
>

------------
Edward A. Lee
Professor, Chair of the EE Division, Associate Chair of EECS
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal  



More information about the Kepler-dev mailing list