Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Phone Gap application and a web application on the same domain setup

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

    Phone Gap application and a web application on the same domain setup

    Can some of you more experienced guys give me a few pointers on how to set this up?
    My goal is to create a phone gap application for my current web application, in other words same database and security details. I would think I could use the same domain and application server, just run a separate instance on an alt port.
    Should I or could I also run an IIS server from the same domain (different port?) I would also want it to be https protected but since it would be the same domain but on a different port I don't think it would require another certificate...

    Another question on setup and configuration would be - Do I need to (or would I want to) create a new workspace dedicated to that phonegap app? If so can I use the same security setup, and share it between the projects or workspaces?

    Lots of unknowns and I would really like to start off on the right foot.

    As always, thanks in advance for your advice!
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

    #2
    Re: Phone Gap application and a web application on the same domain setup

    It sounds as though you're making this too complicated. Do you really want to have your mobile app hit a different instance? If so, doesn't that instance have a different IP address? Having a different project for mobile doesn't matter that much unless your component naming conventions are awful and you don't know your mobile components from anything else. You'd publish your web stuff to your web ip and your mobile stuff to your mobile ip. Your PGB app URL for Ajax Callbacks would point to your mobile ip. I don't think it's any more complex than that.

    Even simpler if you don't involve another instance.

    Comment


      #3
      Re: Phone Gap application and a web application on the same domain setup

      no, same ip and domain just different port. Maybe I am making it too difficult...but thats why I am asking around first.
      I think my naming conventions are ok - I do know what each component is for although i have a few I question my sanity over.

      I just thought that building a separate conn string pointing to an instance on a different port might help with server loads by splitting the PG app off on it's own instance. I appreciate your thoughts and certainly your exp.
      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

      Comment


        #4
        Re: Phone Gap application and a web application on the same domain setup

        you are making it to hard - just do as David has suggested. Just use it as is.
        Insanity: doing the same thing over and over again and expecting different results.
        Albert Einstein, (attributed)
        US (German-born) physicist (1879 - 1955)

        Comment


          #5
          Re: Phone Gap application and a web application on the same domain setup

          Originally posted by CharlesParker View Post
          no, same ip and domain just different port. Maybe I am making it too difficult...but thats why I am asking around first.
          I think my naming conventions are ok - I do know what each component is for although i have a few I question my sanity over.

          I just thought that building a separate conn string pointing to an instance on a different port might help with server loads by splitting the PG app off on it's own instance. I appreciate your thoughts and certainly your exp.
          I'm not sure that's how it works... or is the best way to achieve what you want. If you want to split your web and mobile apps because of load issues, then pointing them at the same ip address means your one server will still have to deal with web and mobile. Setting up 2 instances, each with their own ip address seems to be a good way to ensure that each server is handling their own stuff. Read this... it may help..

          http://documentation.alphasoftware.c...n%20Server.xml

          Comment


            #6
            Re: Phone Gap application and a web application on the same domain setup

            David, if I am understanding your position - I would need two licenses, correct?
            NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

            Comment


              #7
              Re: Phone Gap application and a web application on the same domain setup

              Don't think so. On a multi-core server you can set up a server per core... with 1 license.

              Comment


                #8
                Re: Phone Gap application and a web application on the same domain setup

                So here is the other issue I have, and again this is where I am sorta scratching my head.
                My default project is my web application, I have built a multi tenant app. and everything is going quite well. I clicked the PG app and then selected a UX, uploaded it and its on my phone, so far so good, but when I go to log in, I wind up going straight to my websites login page - home.a5w

                If I create an phone gap app with integrated login, and my security settings for my default web project are set to send me to home.a5w if login is required - shouldn't I create a new project, like on port 81 with new redirect pages, etc???
                How would I use the same security tables?

                I must be missing something, if you guys say I am complicating this - let me know how to uncomplicate it, lol.

                Many many thanks!
                NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                Comment


                  #9
                  Re: Phone Gap application and a web application on the same domain setup

                  Your components may live together in the same project, but out in the real world they do not, and cannot, act the same.

                  You have a PGB App. It doesn't, shouldn't and can't know anything about your web security settings and a5w pages.

                  You're still thinking about separate project and ports.... and re-direct pages. You can't think this way. PGB doesn't know, or care anything, about re-direct pages. You're in a completely different world.

                  You live and die in the UX. That's why Alpha added integrated login. Your UX controls who gets in. And, once in, you can direct based on security. But, it's the integrated login and the login events of the UX and the code you write to check security that determines what happens to a user.

                  The web security settings have virtually nothing to do with a PGB App.

                  So... understanding this... you need to set your PGB UX component or components to Always Allowed. This way, your web security settings can't lay a finger on them. You have control... not the WSS. Not a great acronym now that I see it. But... to a PGB App, the WSS is a bully... and we have to take away its control.

                  Check out those UX Client-side events... afterLogin, afterLoginFailed, and afterLogout. Use these to direct your users to Panelcards and run code that does stuff. You even have Server-side event for this stuff too.

                  Of course, for a multi-tenant app, you're in for a world of hurt anyway in a mobile app... depending on how your wrote it. Maybe it'll be ok.

                  Check out the video series UX_V12--65 : Using a UX Component to create a Login component for a mobile app.

                  The .login() method of the UX still uses the security tables to verify a user, but after that you control where they go. Instead of redirect pages, think of redirect panels within your app.

                  Comment


                    #10
                    Re: Phone Gap application and a web application on the same domain setup

                    As for the multi-tenant aspect, I need two things and perhaps you can advise me on the best way to go about it. First, I need to know the usergroup and a field I call the company_id. So ordinarily, I use =a5ws_getcurrentuser() to get the user_id and I think that will work. Second, I get the company_id with a sql lookup and assign it to a session var.
                    I don't think session vars are the way to go in a PG app - so what would you recommend? I have seen you talking quite a bit about state variables.

                    Thanks for the tips, feel free to go on some more about your experiences and advice. What's the best way for me to do an equivelent in a PG app for my session var?
                    In my typical grid and or UX I use the following for the ondialoginit...

                    Code:
                    function onDialogInitialize as v (e as p)
                    dim cn as sql::Connection
                    cn.open("::Name::Connection1")
                    
                    dim pUser as p
                    dim pUser.userid as c
                    a5ws_logged_in_user_values(pUser)
                    
                    session.thecoid = sql_lookup("::name::Connection1","users","theuserid='"+pUser.userid+"'","thecompanyid")
                    
                    end function
                    I have been reading about session vars not being available, etc. as well as a persistent login issue.
                    My goal is to create a native technician app so that guys can do field reports, and scan equipment in, etc.
                    Possibly even check in and out of locations like the demo app in the last pre-release - pretty cool stuff!

                    I will watch that recommended video and try to get my head in the right direction, I really appreciate you taking the time to advise me!

                    Again, thanks in advance for your time and thoughts, much appreciated!
                    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                    Comment


                      #11
                      Re: Phone Gap application and a web application on the same domain setup

                      Looks like thats all a green light so far...I did need to watch those video's and understand the login process...thanks!
                      NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                      Comment


                        #12
                        Re: Phone Gap application and a web application on the same domain setup

                        Hi Charles, Can you let me know which videos you watched please, as I want to do the same thing. Also, mention anything else that you found useful. Thanks.

                        Comment


                          #13
                          Re: Phone Gap application and a web application on the same domain setup

                          It was actually very straight forward, I guess you would say typical UX stuff.
                          https://www.youtube.com/watch?v=oIUGB93HuYE

                          I am sure it's in the Alpha Video library but I found it here first and I realized how simple it was pretty early on. A couple of key things, the login component needs to be Always Allowed...and other than that watch the whole video! If you already are familiar with the UX it might be a bit boring but it's always that ONE thing that helps to remind!
                          Looking back I have to wonder what I found sooooo hard about it.
                          I still have MORE questions now though about making it look better etc, lol
                          NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

                          Comment


                            #14
                            Re: Phone Gap application and a web application on the same domain setup

                            I think this will get me a quick response in this thread (especially since DavidK seems to be my alpha guardian on these forums, much appreciated with all your help!)

                            I have multiple WAS instances on my server with a load balancer and I think this might be causing me issues with setting up my AJAX callback URL. In order to get my publishing to work the guys at zebra host helped me set up a publishing profile (which publishes to the A5Webroot folder). My server does use SSL but it is handled by the load balancer (which I believe the load balancer and multiple instances are causing my headaches).

                            I've tried many different combinations of IP addresses and web addresses with folder names in the callback URL to no avail. I figured I would need to use the IP address that is being used in the publishing profiles FTP settings but I've had no luck with it (tried both port 80 and port 443). I've also tried to add /A5Webroot/ at the end of the url per the instructions but after reading those instructions again it sounds like the folder that would go there would be a folder inside the A5Webroot folder but my components are just being published to that folder (so not sure if I need to add a folder to the end of my url or not).

                            Any insight on this would be greatly appreciated.

                            Comment


                              #15
                              Re: Phone Gap application and a web application on the same domain setup

                              So after pinging the site from my computer I found a completely different IP address which ended up working (ie allowing for Ajax callbacks). However, it is only working on an android device, there aren't any errors on the build for iOS but the test Ajax button isn't firing correctly, any ideas why it would work on one device and not the other?

                              Comment

                              Working...
                              X