Need to overload default application file(s) loading paths

Hello,

By default when an app is deployed, all the related resources (stores, etc) are expected to be at a relative path from the deployed path. I need to know how to configure Arch to load the resources from another path.

Please note, the url path to load the resources is NOT the same path as the file system (where I deploy too). To illustrate, the url might be domain.com/WEBROOT/resources/lib/ext/ApplicationName/app.js. The file system path (deploy path) would be /WEBROOT/src/main/webapp/resources/lib/ext/ApplicationName/app.js.

I have tried to use the Loader config 'paths' setting, but I did not help.

* I'm using a 'launch' config to render my application into a specific element, so I am not using app.html
* The application files are NOT in the same directory as the html that loads them, and at this point this is not going to change

Anybody have any thoughts on how to deploy my app to the required location and to then load resources that aren't in a relative path?

If this is unclear in anyway, let me know and I'll try to clarify.
Thanks,
Thantous

Am I wrong in that I don't believe I can achieve this with the current version of Architect? Moving the folder is an easy enough solution for now, but over the long term it would be awesome if configurations were available for this setup.

Thoughts?
Thanks,
Thanatos

p.s. I'm loving what I see in Architect, it's a fabulous update from Designer

Sorry but I still can't read into what you are missing in your development/deployment situation.

Hi Aaron,

Thanks for the reply. I was hoping the screen shots of the directory structure would make the issue clear. I will try again .

By default, applications are expecting to find their related resources (stores, models, etc) at a relative path from the app.js and app.html files. My resources are not setup like this, they are stored elsewhere, but still available via a different path. If this matters, I'm using a launch configuration to load my application into a specific content area in my page.

To illustrate, the url to my html file might be: domain.com/VideoWeb/a/b/file.html. The resources for the application that this page is loading would be available at this url: domain.com/VideoWeb/resources/scripts/lib_extjs/CampaignManager/app

I set the appFolder param to: /VideoWeb/resources/scripts/lib_extjs/CampaignManager/app

This parameter is used to tell the application where it's resource files are. Without this setting, my resources return 404 as they aren't relative to /VideoWeb/a/b/file.html.

I set the deploy path to to: /a/home/component/VideoWeb/src/main/webapp/resources/scripts/lib_extjs/CampaignManager

When I deploy, instead of seeing the app folder at my deploy path, I see the entire directory structure from the appFolder parameter, ie, /a/home/component/VideoWeb/src/main/webapp/resources/scripts/lib_extjs/CampaignManager/VideoWeb/resources/scripts/lib_extjs/CampaignManager/app.

What happens to your directories when you save with appFolder

Hello,
My work around for this is to set the appFolder setting outside of architect. Use your initial save location on the project to place it where you want it. Then after you save it, edit the appFolder setting in another editor so your application can find it based on your server settings, framework etc.

It's a pain to have to reset the appFolder setting in another editor each and everytime that you save your project. But I've found if you set appFolder in architect2 that it will overwrite your folders and place them into the appFolder location, not the save location.

Hello,
My work around for this is to set the appFolder setting outside of architect. Use your initial save location on the project to place it where you want it. Then after you save it, edit the appFolder setting in another editor so your application can find it based on your server settings, framework etc.

It's a pain to have to reset the appFolder setting in another editor each and everytime that you save your project. But I've found if you set appFolder in architect2 that it will overwrite your folders and place them into the appFolder location, not the save location.

Thank you for responding Oldroy. This approach does indeed work, but as you say it is definitely a pain to re-add the appFolder value after each deploy.

However, you did give me the idea for another option. Leaving the appFolder parameter as it is, I have created a symlink from deploy_path/app to the nested directory of deploy_path/VideoWeb/ressources/scripts/lib_extjs/CampaignManager/app which is auto-created by Architect and this seems to work nicely. I don't have to change app.js, and I don't have to move the app folder.

I would still love to see a fix from Sencha regarding this issue, we can't be the only two who have ran into it . I'll post back if I run into issues using the symlink approach.

appFolder

I wrote this up as a bug a couple days ago. No action on it yet. Maybe a useAppFolderForSave: true/false would solve the problem? This way it can be used both ways?

My guess is that people just aren't using appFolder settings. For me with rails 3.2 and the asset pipeline it just works. I inclde my extjs and app.js in my application.js use the loader to point back to ( { "Ext" : "mypath/extjs/src" }), then set my appFolder to /assets/Myapp/app and everything just works - this assumes that my initial save location is app/assets/javascripts/MyApp in rails.

Without using the appFolder setting you have to go through all sorts of manual contortions to include files in correct order in rails with the asset pipeline.