https://projects.ecoinformatics.org/ecoinfo/https://projects.ecoinformatics.org/ecoinfo/ecoinfo/favicon.ico?14691340362009-12-27T19:14:27ZEcoinformatics RedmineKepler - Bug #4547: documentation for file parameter includes an errorhttps://projects.ecoinformatics.org/ecoinfo/issues/4547?journal_id=155922009-12-27T19:14:27Zben leinfelderleinfelder@nceas.ucsb.edu
<ul></ul><p>also in StringParameter.<br />It's not in the actor moml...so it must be in the action that is displaying the documentation</p> Kepler - Bug #4547: documentation for file parameter includes an errorhttps://projects.ecoinformatics.org/ecoinfo/issues/4547?journal_id=155932009-12-29T15:59:30Zben leinfelderleinfelder@nceas.ucsb.edu
<ul></ul><p>Parsing the description is throwing an error - perhaps it's trying to substitute values or $ID?<br />Snippet from the FileParameter.xml MOML below:</p>
<p><p>The FileParameter specifies a file or URL. The value of the parameter is a string that may contain references to variables within scope (i.e., variables defined at the same level of the hierarchy or higher) using the $ID ${ID}, or $(ID) syntax. </p></p> Kepler - Bug #4547: documentation for file parameter includes an errorhttps://projects.ecoinformatics.org/ecoinfo/issues/4547?journal_id=155942010-01-03T20:26:44ZChristopher Brookscxh@eecs.berkeley.edu
<ul></ul><p>Viewing the documentation for FileParameter works fine in the ptII tree,<br />but fails in Kepler, probably because of something about the Kepler customizations to the documentation viewer.</p>
<p>However, if I modify ptolemy/vergil/actor/DocManager.java to include the<br />stack trace:<br /> _exception = "Error evaluating DocAttribute parameter:\n" + e<br /> + ptolemy.kernel.util.KernelException.stackTraceToString(e);</p>
<p>Then I get the stack trace below, which does not include a call to <br />ptolemy/ptolemy/vergil/basic/KeplerDocumentationAttribute.java</p>
<p>Looking at the code, I see that DocAttribute has description as a StringParameter.</p>
<p>I think this should be changed to a StringAttribute so that the contents<br />of the description are not evaluated and so that $ID is not expanded.</p>
<p>I made this change in my tree and found it was necessary to add a MoMLFilter<br />for this change because the configuration has files that<br />ptolemy/configs/basicUtilities.xml include lines like:</p>
<pre><code>&lt;property name="description" class="ptolemy.data.expr.StringParameter" value="To edit the documentation that appears&#10;when the user double clicks on this icon,&#10;right click on the <em>background</em> of the model and select&#10;Documentation-&gt;Customize Documentation.&#10;The description you are currently editing&#10;will not appear when the user double clicks on the Documentation icon."&gt;</code></pre>
<p>The MoMLFilter looks for DocAttributes and changes the class of<br />description from StringParameter to StringAttribute.</p>
<p>The question is: should this change go in to the Ptolemy tree, or is<br />the problem really in Kepler?</p>
<p>I think the description should be a StringAttribute, not a StringParameter.<br />However, this change would require updating many files because the filter<br />would mark the files as modified.</p>
<p>Anyway, here's the stack trace from Kepler</p>
<p>ptolemy.data.expr.Variable._evaluate(Variable.java:1656) at ptolemy.data.expr.Variable.getToken(Variable.java:578) at ptolemy.data.expr.StringParameter.stringValue(StringParameter.java:95) at ptolemy.vergil.actor.DocManager. (DocManager.java:164) at ptolemy.vergil.actor.DocViewer._init(DocViewer.java:652) at ptolemy.vergil.actor.DocViewer. (DocViewer.java:115) at ptolemy.vergil.actor.DocTableau. (DocTableau.java:90) at ptolemy.vergil.basic.GetDocumentationAction.showDocAttributeTableau(GetDocumentationAction.java:442) at ptolemy.vergil.basic.GetDocumentationAction.showDocumentation(GetDocumentationAction.java:161) at ptolemy.vergil.basic.GetDocumentationAction.actionPerformed(GetDocumentationAction.java:120) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at javax.swing.AbstractButton.doClick(AbstractButton.java:334) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1050) at apple.laf.CUIAquaMenuItem.doClick(CUIAquaMenuItem.java:119) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1091) at java.awt.Component.processMouseEvent(Component.java:5602) at javax.swing.JComponent.processMouseEvent(JComponent.java:3129) at java.awt.Component.processEvent(Component.java:5367) at java.awt.Container.processEvent(Container.java:2010) at java.awt.Component.dispatchEventImpl(Component.java:4068) at java.awt.Container.dispatchEventImpl(Container.java:2068) at java.awt.Component.dispatchEvent(Component.java:3903) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866) at java.awt.Container.dispatchEventImpl(Container.java:2054) at java.awt.Window.dispatchEventImpl(Window.java:1801) at java.awt.Component.dispatchEvent(Component.java:3903) at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) Caused by: ptolemy.data.expr.UndefinedConstantOrIdentifierException: The ID ID is undefined. at ptolemy.data.expr.ParseTreeEvaluator.visitLeafNode(ParseTreeEvaluator.java:674) at ptolemy.data.expr.ASTPtLeafNode.visit(ASTPtLeafNode.java:125) at ptolemy.data.expr.ParseTreeEvaluator._evaluateChild(ParseTreeEvaluator.java:1310) at ptolemy.data.expr.ParseTreeEvaluator._evaluateAllChildren(ParseTreeEvaluator.java:1264) at ptolemy.data.expr.ParseTreeEvaluator.visitSumNode(ParseTreeEvaluator.java:1116) at ptolemy.data.expr.ASTPtSumNode.visit(ASTPtSumNode.java:128) at ptolemy.data.expr.ParseTreeEvaluator.evaluateParseTree(ParseTreeEvaluator.java:104) at ptolemy.data.expr.Variable._evaluate(Variable.java:1644) ... 36 more Caused by: ptolemy.data.expr.UndefinedConstantOrIdentifierException: The ID ID is undefined. at ptolemy.data.expr.ParseTreeEvaluator.visitLeafNode(ParseTreeEvaluator.java:674) at ptolemy.data.expr.ASTPtLeafNode.visit(ASTPtLeafNode.java:125) at ptolemy.data.expr.ParseTreeEvaluator._evaluateChild(ParseTreeEvaluator.java:1310) at ptolemy.data.expr.ParseTreeEvaluator._evaluateAllChildren(ParseTreeEvaluator.java:1264) at ptolemy.data.expr.ParseTreeEvaluator.visitSumNode(ParseTreeEvaluator.java:1116) at ptolemy.data.expr.ASTPtSumNode.visit(ASTPtSumNode.java:128) at ptolemy.data.expr.ParseTreeEvaluator.evaluateParseTree(ParseTreeEvaluator.java:104) at ptolemy.data.expr.Variable._evaluate(Variable.java:1644) at ptolemy.data.expr.Variable.getToken(Variable.java:578) at ptolemy.data.expr.StringParameter.stringValue(StringParameter.java:95) at ptolemy.vergil.actor.DocManager. (DocManager.java:164) at ptolemy.vergil.actor.DocViewer._init(DocViewer.java:652) at ptolemy.vergil.actor.DocViewer. (DocViewer.java:115) at ptolemy.vergil.actor.DocTableau. (DocTableau.java:90) at ptolemy.vergil.basic.GetDocumentationAction.showDocAttributeTableau(GetDocumentationAction.java:442) at ptolemy.vergil.basic.GetDocumentationAction.showDocumentation(GetDocumentationAction.java:161) at ptolemy.vergil.basic.GetDocumentationAction.actionPerformed(GetDocumentationAction.java:120) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1882) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2202) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at javax.swing.AbstractButton.doClick(AbstractButton.java:334) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1050) at apple.laf.CUIAquaMenuItem.doClick(CUIAquaMenuItem.java:119) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1091) at java.awt.Component.processMouseEvent(Component.java:5602) at javax.swing.JComponent.processMouseEvent(JComponent.java:3129) at java.awt.Component.processEvent(Component.java:5367) at java.awt.Container.processEvent(Container.java:2010) at java.awt.Component.dispatchEventImpl(Component.java:4068) at java.awt.Container.dispatchEventImpl(Container.java:2068) at java.awt.Component.dispatchEvent(Component.java:3903) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4256) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3936) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3866) at java.awt.Container.dispatchEventImpl(Container.java:2054) at java.awt.Window.dispatchEventImpl(Window.java:1801) at java.awt.Component.dispatchEvent(Component.java:3903) at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)</p> Kepler - Bug #4547: documentation for file parameter includes an errorhttps://projects.ecoinformatics.org/ecoinfo/issues/4547?journal_id=155952010-01-11T07:03:55ZChristopher Brookscxh@eecs.berkeley.edu
<ul></ul><p>Fixed. Changed DocAttribute.description from a StringParameter to a StringAttribute so that Kepler does not report errors when displaying documentation. It is unclear why this fails for Kepler, but works for Ptolemy. An addition to moml.filter.PropertyClassChanges filters for this change. Fortunately, only three demos required changes.</p>
<p>ptolemy/domains/de/demo/Clock/Clock.xml<br />ptolemy/domains/modal/demo/Case/Case.xml<br />ptolemy/actor/lib/hoc/demo/Case/Case.xml</p>
<p>The changed Java files were:<br />ptolemy/vergil/basic/KeplerDocumentationAttribute.java<br />ptolemy/vergil/basic/DocAttribute.java<br />ptolemy/vergil/actor/DocManager.java<br />ptolemy/moml/filter/PropertyClassChanges.java</p>
<p>Note that this change means that models that have DocAttributes with the<br />description parameter set will be marked as modified by the filter.<br />Thus, the user will be prompted for save on close.</p> Kepler - Bug #4547: documentation for file parameter includes an errorhttps://projects.ecoinformatics.org/ecoinfo/issues/4547?journal_id=155962013-03-27T21:27:15ZRedmine Admin
<ul></ul><p>Original Bugzilla ID was 4547</p>