• 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] Using Valence To Redirect To Another 3rd Party WebSite?

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

  • [HELPED] Using Valence To Redirect To Another 3rd Party WebSite?

    I have a need to launch a long url from the green screen. To make a long story short I cannot use STRPCCMD because the URL is too long, and RUNRMTCMD is not viable in our environment. I am working on a way to utilize an HTML redirect but I'm hitting huge problems with the CCSID(1200) field types. Is there a way to tap into Valence for this since I see several CCSID(1200) fields?

  • #2
    I'm having trouble determining the problem here. Can you post an example or a green screen shot or something so I can see what you're trying to do?

    Comment


    • #3
      I want to access this URL from the iSeries:

      Code:
      http://maps.google.com/maps?q=CNX+Corporation,+North+Jefferson+Street,+Chicago,+IL&hl=en&ll=41.886512,-87.641802&spn=0.012987,0.029182&sll=30.372875,-94.921875&sspn=15.380001,29.882813&oq=cnx+corp&hq=CNX+Corporation,+North+Jefferson+Street,&hnear=Chicago,+Cook,+Illinois&t=m&z=16&iwloc=A
      One way to to do it, is to use the STRPCCMD command. But its parameter is only 120'ish characters. Another way to do it is to use RUNRMTCMD, but this requires distributing a PC script file to everyone, and is not an option. Another way to do it, is to store that long URL in a file, attach a token to that record (or in the case of Valence, a sessions id), launch a shorter URL that calls another RPG program that passes back in the token id (or session id), then use the qtmhwrstout api to send a "Redirect" (http status 301 and 302) and include the LONG url from the token file. In essence, you've created a way to launch long urls directly from an RPG program.

      This URL will be dynamic (of course). I was wondering if there were any procedures I can use in Valence's library to help accomplish this. The programs i have set up end up encoding the URL (replacing & and + with their HTML ASCII equivilant), and it seems to interfere with the website's search functionality.

      As a side note, i'm not using Google maps for my live example. I'm just using that here because giving you the actual URL would violate security.

      Comment


      • #4
        It's been a few days and I didn't want this thread to die. Was just checking if Valence had some way to re-route a URL request.

        Comment


        • #5
          I'm still having trouble understanding the question fully but if you are trying to actually launch or initialize a web page from a green screen then that functionality is beyond the scope of Valence. Valence really has nothing to do with the green screen and doesn't interface with it in any way. Am I misunderstanding something?

          Comment


          • #6
            I think the "outside the scope of Valence" is my brick wall here. Thanks Richard. :-)

            Comment


            • #7
              Take a look at the DDS keyword MOUBTN ... you can actually trap mouse events on the green screen form RPG.. so a user could double click on an item in your subfile, for example, and your RPG code can then concatenate the url string together and then call the STRPCO cmd from the RPG. You should be able to pass at least a 1000 characters. I'm not sure what the max is.

              Comment


              • #8
                Originally posted by mwmayer4 View Post
                Take a look at the DDS keyword MOUBTN ... you can actually trap mouse events on the green screen form RPG.. so a user could double click on an item in your subfile, for example, and your RPG code can then concatenate the url string together and then call the STRPCO cmd from the RPG. You should be able to pass at least a 1000 characters. I'm not sure what the max is.
                Thanks for your response mwmayer! You are on the same page in terms of what I'm trying to do. STRPCCMD only allows 121 characters (or close to that). Anything longer than that becomes truncated. After researching a few different iSeries expert forums, I came to the conclusion that I have 3 options that are native to the iSeries:

                1. STRPCCMD - URL length limitation
                2. RUNRMTCMD - requires PC script that will not be possible for us
                3. URL Redirect - requires apache server and RPG program to resend URL redirect status with long URL

                So, as you can see, option 1 and 2 are not possible. 3 is possible, and I already have a prototype working but it has some quirks that prohibits certain websites from understanding the request. I was wondering if Valence had any way of accomplishing this by us using some of the vvAPI's. But it seems that since it's "outside of the scope of Valence", the brick wall wins. ;-)

                Comment


                • #9
                  After seeing the latest posts I think I understand the requirement a little better. Why not do something like this:

                  1) user takes an action on the green screen that indicates they want to go to the url
                  2) RPG program does something that will remember or "save" whatever parms are needed to construct the long url
                  3) your program then does the STRPCCMD to call a Valence URL and incorporates the Valence SID as an identifier (or you can use a shorter id of your own creation)
                  4) Your small Valence app does a simple ajax call to get all the parms that were saved in step 2
                  5) the long url is then constructed on the front-end (this is the key part) and the redirect takes place.

                  Comment


                  • #10
                    Are you 100% positive on the 121 characters? I don't think I've had that problem.

                    Comment


                    • #11
                      Originally posted by mwmayer4 View Post
                      Are you 100% positive on the 121 characters? I don't think I've had that problem.
                      110% positive:

                      http://www-01.ibm.com/support/docvie...2572d700525c13

                      Comment


                      • #12
                        Richard,

                        Could you expand a little on how you would accomplish the redirect and how you would format the URL in terms of CCSIDs? I'm betting there is a Valence api that does this already, I just don't know what it is.

                        Comment


                        • #13
                          I didn't see anything in your URL example that would require worrying about ccsids. If you just do an Ajax request and get a standard JSON response from Valence with all the fields parsed out you can string the URL together on the front end. The ampersand and plus signs won't be an issue.

                          Comment

                          Working...
                          X