View Full Version : Importing file of old projects

18 Apr 2012, 5:21 AM

is it possible to import files (app.js, views.js, controler.js, ...) of old projects in Sencha Architect ?

Thank you,

18 Apr 2012, 8:19 AM
You can certainly include additional files with raw source code via the resources node. However there is no way to import it and have them introspected into Architect's format so that you can make design time changes.

18 Apr 2012, 8:20 AM
Thank you for your answer

18 Apr 2012, 8:27 AM
As far as I can tell: no. Architect, like Designer, does not care about JS files at all. It treats them just as text, not as Component definitions or what have you.

As with Designer, the magic lies in the project file (the XDS file). Unlike Designer, there are also additional metadata files that are referenced by the XDS file (unlike Designer's monolithic approach). These are all JSON, but unless you enjoy editing large JSON files by hand (functions and other user-entered code are stored as strings with escaped newlines because JSON does not have a multi-line string syntax), you're stuck with Architect for that.

I would recommend re-creating your MVC structure, using as much of its functionality as possible (e.g. creating functions and event handlers via drag and drop rather than manually) and then using overrides to add functionality that lies outside of what you can do with drag and drop. If you were already adhering to the best current practices for Sencha's JS libraries, this should be a matter of a few hours of copy and paste (plus clicking and dragging things a lot).

I'm afraid there's no way to edit functions, event handlers, etc outside of Sencha Architect without using overrides (i.e. "true" interoperability), but for this kind of thing, the lack of code intelligence in Architect's edit mode isn't that much of a problem. Though it's still a bit disappointing considering IntelliJ's IDEA family of IDEs just recently added code intelligence for ExtJS (and presumably Sencha Touch).

Overrides seem to be more of a hack intended to help if you hit Architect's limits. The ability to define your own components in your JavaScript IDE and then import them into Architect and get the same usability as with the built-in components would have been very nice (I'd imagine it'd do for ExtDesigner/Architect what level editors and modding capabilities have done for games). Sadly the component import/export still seems to be based around JSON configurations of built-in components rather than actual extensions, so it remains a bit of a walled garden.

EDIT: To clarify: It is possible to add JS files to a project, but they will not be very useful. This functionality is (apparently) primarily intended to allow for adding non-ExtJS/Touch code and other resources the app may rely on. So, no: It's not possible to import a model, view, store or controller and have it appear in Architect as if you had created it "natively" within Architect (that is, with configurable properties, behaviours and so on).