Component/Keyword: DevTools/Web IDE/Application Edit Framework
New API for obtaining the "current application"
currentApplication is a global variable in index.html.
- value is an object with {Id, name, path, isRunning, and description) properties when accessed from within the application editor
- value will be
null when accessed from the Application Manager
Currently it works like this:
- Manage Apps gets the list of applications with:
- GET http://localhost:8070/resources/applications which gets back:
{
"1": {
"name": "testxxxx",
"path": ""
},
"111": {
"copyFrom": "zero:employee.demo",
"name": "employee.demo",
"path": ""
},
"11": {
"name": "AppTest2",
"path": ""
}
}
- When an App is edited (double click or edit from dropdown):
- FreedomMgrDemo.js calls this._controller.open(data.application);
- Where data.application includes: id, name, path, isRunning, theme, description
- Next the base-freedom-controller.js in open calls:
this._updateIdeFromApplication();
this._finishOpen(true);
this.applicationLoaded(this._application);
* The _finishOpen(true) calls this._ideWidget.open(pOpenDialog) which calls open on FreedomUIDemo.js.
-
-
- open in FreedomUIDemo.js is where the applicationName etc are setup for the app edit. * The applicationLoaded in the controller is connected to the applicationLoaded in FreedomMgrDemo,
- The applicationLoaded in FreedomMgrDemo calls this.showEditor()
- The showEditor in FreedomMgrDemo is connected to the showEditor in index.html
- The showEditor in index.html calls showManager(false) which does this:
dijit.byId('freedom-mgr-demo').domNode.style.display = pManagerOrEditor ?
'block' : 'none';
dijit.byId('freedom-ui-demo').domNode.style.display = pManagerOrEditor ?
'none' : 'block';
- When a bookmark or browser back/forward is used, the flow is different:
- index.html setsup handleInitParms and calls showManager(false)
- if handleInitParms is set, showManager will call mController.findAndOpenApp(handleInitParms);
- findAndOpenApp will call the service to get the application info, and then call
this.open(app);
// need to go to the right page...
dojo.publish("ShowView", [{source: pub }]);
It seems like this could be much simpler with Publish/Subscribe model.
-
- I am using a publish/subscribe model for the browser back/forward.
- dojo.publish("ShowView", [{source: this }]) is called with this:
{
"_app": 11,
"_appname": "appName",
"_file": "/test/testJ",
"_uiview": "allFilesView",
"_view": "AppEditor",
"changeUrl": "view=AppEditor+app=11+uiview=allFilesView+file=/test/testJ"
}
-
- I would like to have the applications service add the id to the application json data.
Paths that editors need to know...
- phys app path - path to the app root: C%3A/workdir/employee.demo
- phys file path - path to the file: C%3A/workdir/employee.demo/public/widgets/mywidget.js
- file path - phys file path - phys app path: public/widgets/mywidget.js
- phys checkpoint path - path to the app root: C%3A/workdir/temp/employee.demo/public/widgets/mywidget.js
- virtual should work - assume something like: C%3A/workdir/employee.demo/public/dojo/dojo.js (file does not physically exist)
- phys web path - path to the web files: C%3A/workdir/employee.demo/public (location of editing context root)
- editing root - URL to files in context root while editing "/resources/files" + phys web path: /resources/files/C%3A/workdir/employee.demo/public
- web path - web accessible path after public : widgets/mywidget.js
- full editing preview path - editing root + web path
- context root - /employee.demo or / (running context root for absolute URLs)
- editors web/file path - / or C%3A/zero.ide/public XXX Should not be used by editors
-- edchat - 27 Feb 2008