• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[HELPED]Valence 3.1 (ExtJS 4.0.7) Apps in Valence 4.1 : Ajax using vvcall.pgm

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELPED]Valence 3.1 (ExtJS 4.0.7) Apps in Valence 4.1 : Ajax using vvcall.pgm

    I have a "monolithic style" (non-mvc, non-mvvm) application built using ExtJS 4.0.7. I am attempting to see what it takes to migrate these applications to Valence 4.1. I've already copied /ext-4.0.7 to the /valence-4.1d/desktop folder. I've also copied the Valence 3.1 version of valence.css to /valence-4.1d/desktop/ext-4.0.7/resources/css and the Valence 3.1 version of valence-extjs4.js to /valence-4.1d/desktop/ext-4.0.7. (I understand that this isn't the best place for it, but I just need something that works for right now)

    My app has some code that initiates every time the app attempts to make an ajax request to ensure the server is available (we don't want web app users running web apps when the server is in a restricted state). Here is that code:


    Code:
        // global ajax request system availability check
        Ext.Ajax.on('beforerequest', function(conn, options) {
            if (!options.firstTime) {
            	Ext.Ajax.request({
        			url: 'vvcall.pgm',
        			params: {
        			pgm: 'MYAPPPGM',
        			action: 'checkSystem'
                },
        		    success: function(response) {
             			var data = Ext.decode(response.responseText);
                         
                        if (Ext.isIE) {
                            Ext.Ajax.abort();
                            Ext.getBody().mask();
            		    	Ext.Msg.alert('Microsoft Browser Detected', 'Internet Explorer does not work well with this application.  Please use Chrome.');
                        }
                         
                         
            			if (data.SUCCESS == '99') {
        	    			Ext.Ajax.abort();
        		    		Ext.getBody().mask();
        			    	Ext.Msg.alert('System unavailable', 'The system is not available at this time');
        	    		}
                	},
        	        firstTime: '1'
        		});
        	}
    However, when an HTTP post is made to vvcall.pgm, it's using our custom folder in the url:

    Code:
    POST http://mysystem:6041/ourcustomfolder/html/vvcall.pgm 404 (Not Found)
    Here are the stylesheet and script includes:

    Code:
    <link rel="stylesheet" type="text/css" href="/extjs407/resources/css/ext-all.css" />
    <link rel="stylesheet" type="text/css" href="/extjs407/resources/css/valence.css" />
    
    <script type="text/javascript" src="/extjs407/ext-all.js"></script>
    <script type="text/javascript" src="/extjs407/valence-extjs4.js"></script>
    Here are the Apache directives that allow access to those folders:

    Code:
    # Ext JS 4.0.7                                 
    Alias /extjs407 /valence-4.1d/desktop/ext-4.0.7
    <Directory /valence-4.1d/desktop/ext-4.0.7>    
       Order Allow,Deny                            
       allow from all                              
    </Directory>
    Here is a screen shot of our custom settings in the Portal Admin Setting page:

    Valence41 Custom Settings.jpg

    I also seem to be missing some other files (images) but I think I'll find them somehow:

    Code:
    GET http://mysystem:6041/extjs407/resources/css/icons/save.gif 404 (Not Found) ext-all.js:15 
    GET http://mysystem:6041/extjs407/resources/css/icons/arrow_rotate_clockwise.png 404 (Not Found) ext-all.js:15 
    GET http://mysystem:6041/extjs407/resources/css/icons/delete.png 404 (Not Found)
    I was able to fix the missing icon images by copying vvresources into the ext-4.0.7 folder. Again, I realize this isn't best practices, but I just need proof of concept working for now. Still getting the error above where my ajax call to vvpgm is building a url that includes my custom app path and not the default valence path.
    Last edited by rkanemeier; 03-12-2015, 02:21 PM.

  • #2
    I'm also curious if anyone else migrated from 3.1 to 4.1. I'm assuming they would have the same issues.

    Comment


    • #3
      Regarding your problem getting to VVCALL, have you tried mimicking the Ajax call in the Valence 4.1 example apps? i.e., switch the url in your Ajax call to '/valence/vvcall.pgm'. This path should have an explicit SriptAlias in your Apache config.

      Comment


      • #4
        That was it! Thanks! I'm going through and rerunning all Valence 3.1 apps in 4.1 before we make 4.1 "production ready". I'm sure the users will like it more! (great work on the product btw). Just a few more hurdles and we are there.

        Comment

        Working...
        X