1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default Need to overload default application file(s) loading paths

    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.

    Code:
    Ext.Loader.setConfig({
        enabled: true,
        paths: {
            Ext: '.',
            ApplicationName: '/WEBROOT/resources/lib/ext/ApplicationName'
        }
    });
    Some info regarding my app:

    * 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

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default


    OK, found a work around. It would be great to know if this issue is being worked on, of if there's already a solution, or if this is the solution.

    First off, I've removed the Loader config 'Paths' settings.

    Secondly, I've updated the appFolder property to the path where the files will eventually end up. Below is my app.js.

    Code:
    Ext.Loader.setConfig({
        enabled: true
    });
    
    
    Ext.application({
        models: [
            'StatusTypeModel'
        ],
        stores: [
            'StatusTypeStore'
        ],
        views: [
            'CampaignManager'
        ],
        appFolder: '/VideoWeb/resources/scripts/lib_extjs/TestMe/app',
        name: 'MyApp',
    
    
        launch: function() {
            var cmp = Ext.create('MyApp.view.CampaignManager', {
                renderTo: Ext.query('*[class=fieldset_page_sections]')[0]
            });
            cmp.show();
        }
    
    
    });
    My deploy path is set to this;

    * /home/NAME/component/VideoWeb/src/main/webapp/resources/scripts/lib_extjs/TestMe

    Once deployed, here is what my directory structure within TestMe looks like;

    appPath.jpg

    To make the application work, I now have to move the app directory. Here is what I expect the tree to look like, and what's required to make the application work properly.

    appPath_expected.jpg

    : Requested Solution :

    What I need to be able to say within Architect is;

    * Deploy all application files / folders to: /home/NAME/component/VideoWeb/src/main/webapp/resources/scripts/lib_extjs/TestMe

    * Make the application look for it's resources (stores, models, etc) at: /VideoWeb/resources/scripts/lib_extjs/TestMe/app

    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

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default


    Bump.

    Is there a solution to this issue? Support?

    Thanks a ton,
    Thantous

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,306
    Vote Rating
    125
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Sorry but I still can't read into what you are missing in your development/deployment situation.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #5
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default


    Quote Originally Posted by aconran View Post
    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.

    Code:
    var cmp = Ext.create('CampaignManager.view.CampaignManagerForm', {
        renderTo: Ext.query('*[class=fieldset_page_sections]')[0]
    });
    cmp.show();
    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.

    I believe what I need to specify are two settings;

    a) Load my resources from this path: /VideoWeb/resources/scripts/lib_extjs/CampaignManager/app
    b) Put my resources at this path: /a/home/component/VideoWeb/src/main/webapp/resources/scripts/lib_extjs/CampaignManager/app

    Does this make it any clearer?
    Thanks,
    Thanatos

  6. #6
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default


    Bump.

  7. #7
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    79
    Vote Rating
    4
    oldroy is on a distinguished road

      0  

    Default What happens to your directories when you save with appFolder

    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.

  8. #8
    Sencha User
    Join Date
    Oct 2011
    Posts
    45
    Vote Rating
    1
    thantous is on a distinguished road

      0  

    Default


    Quote Originally Posted by oldroy View Post
    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.

    Thanks again,
    Thantous

  9. #9
    Sencha Premium Member
    Join Date
    Nov 2007
    Posts
    79
    Vote Rating
    4
    oldroy is on a distinguished road

      0  

    Default appFolder

    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.

  10. #10
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,306
    Vote Rating
    125
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    We have plans to enhance the deployment process and will certainly take your workflow into consideration as we approach this problem.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

Thread Participants: 2