tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/4643-reloading-an-extension-mxt-during-developmentInfinite Kind: Discussion 2021-06-22T09:20:23Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-01-31T13:03:33Z2021-01-31T13:03:33ZReloading an extension (.mxt) during development.<div><p>Is this java or python?</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-01-31T13:14:00Z2021-02-01T10:05:45ZReloading an extension (.mxt) during development.<div><p>java</p></div>andytag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-01-31T16:00:38Z2021-01-31T16:00:39ZReloading an extension (.mxt) during development.<div><p>This is a Java extension.</p>
<p>currently after making a code change i must:<br>
- remove extension - make change (involves visible changes to summary page) - install extension - force an update to summary page (move extension up-down in preferences).</p>
<p>This is fine; but looking for a single-action like "update" which also refreshed the summary page.</p>
<p>Thanks.</p></div>andytag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-01-31T16:29:26Z2021-02-01T20:49:18ZReloading an extension (.mxt) during development.<div><p>FYI - With Python extensions it works as I think the PY interpreter gets reloaded....</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-01-31T19:53:17Z2021-01-31T19:53:17ZReloading an extension (.mxt) during development.<div><p>You have to restart MD. When MD starts it loads each extension and calls the init function. This loads the class into the JVM and thus will remain loaded until MD restarts. The purpose behind thus is so the extension can be called when the data file is opened. When you select an extension the Invoke method is called.</p></div>Mike Bray (Quote Loader Author)tag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-01-31T22:09:54Z2021-01-31T22:09:54ZReloading an extension (.mxt) during development.<div><p>Hi Andy,</p>
<p>To load the new code you'll need to either go through the Extensions menu to load the extension, or you might be able to double-click on the extension, or drag it from the file browser into the main app window to present the load-extension window. Clicking OK/Install in that window will unload the existing extension and load the new code.</p>
<p>Thanks,<br>
Sean</p></div>Sean Reillytag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-02-01T01:17:05Z2021-02-01T01:22:23ZReloading an extension (.mxt) during development.<div><p>Thanks - the drag-drop method is very helpful. The only thing missing which is not a big deal is when the drag-drop occurs the 'getGUIView' is not invoked so an action is needed to force it - such as 'up-down' on the summary page preferences. I'm including my sequence (with lifecycle events) for any future readers; thanks for all the help everyone. (To verify changes are in fact loaded I used the console with an updated message.):</p>
<ul>
<li>start MD (extension not installed)</li>
<li>drag-drop my extension into main window
<ul>
<li>ackknowledge prompts</li>
</ul>
</li>
<li>following 'FeatureModule' lifecycle vents called in my extension:
<ul>
<li>getBuild</li>
<li>getVendor</li>
<li>getDescription</li>
<li>init</li>
<li>getBuild</li>
<li>getBuild</li>
<li>getVendor</li>
<li>getDescription</li>
</ul>
</li>
<li>
<p>add my extension to summary page</p>
<ul>
<li>getGUIView</li>
</ul>
</li>
<li>
<p>make change and rebuild</p>
</li>
<li>
<p>drop-drop updated extension.</p>
<ul>
<li>acknowledge prompts</li>
</ul>
</li>
<li>
<p>following 'FeatureModule' events called:</p>
<ul>
<li>getBuild</li>
<li>getVendor</li>
<li>getDescription</li>
<li>getBuild</li>
<li>getVendor</li>
<li>getDescription</li>
<li>unload</li>
<li>init</li>
<li>getBuild</li>
<li>getBuild</li>
<li>getVendor</li>
<li>getDescription</li>
</ul>
</li>
<li>
<p>here i must use 'Preferences | Summary Page | (up down)' to force a refresh on screen</p>
<ul>
<li>getGUIView</li>
</ul>
</li>
<li>
<p>restart MD (NOT REQUIRED but showing lifecycle events)</p>
<ul>
<li>init</li>
<li>handleEvent("md:file:opening")</li>
<li>getGUIView</li>
<li>getBuild</li>
<li>getBuild</li>
<li>handleEvent("md:account:root")</li>
<li>getGUIView</li>
<li>handleEvent("md:file:opened")</li>
</ul>
</li>
</ul>
<p>== minor bug ==</p>
<ul>
<li>After removing my extension, restarting MD and reinstalling my extension, the extension shows up in the column previously assigned and not in the "available items" <em>and</em> it is not shown. A simple "up-down" change refreshes.</li>
</ul></div>andytag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-03-21T23:10:48Z2021-03-21T23:10:48ZReloading an extension (.mxt) during development.<div><p>Andy, did you solve this? I have the same problem.. that is to get the Home Screen to reload and therefore load the new HomePageView.. Currently I double-click an account in the side bar, which loads a new UI and thus the new view... I wish there was a refresh / reload current Home Screen method... Did you solve this?</p></div>Stuart Beesley (Mr Toolbox)tag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-03-22T01:48:41Z2021-03-22T01:48:41ZReloading an extension (.mxt) during development.<div><p>No, the "nudge" is still necessary for the 'getGUIView' to be invoked (aka refresh).</p>
<p>I have since switched to using Eclipse for development (took me a while to get it configured properly) and running/debugging means I'm restarting which avoids the issue during development - and avoids re-deployment altogether.</p></div>andytag:infinitekind.tenderapp.com,2009-01-14:Comment/490057672021-03-23T09:20:11Z2021-03-23T09:20:11ZReloading an extension (.mxt) during development.<div><p>This seems to help:</p>
<p>from com.moneydance.apps.md.controller import URLUtil<br>
moneydance.showURL(URLUtil.getMoneydanceURL("gohome"))</p>
<p>if not on the Home Screen, then great... But if on the Home Screen, you navigate away and then back....</p></div>Stuart Beesley (Mr Toolbox)