Aloe Discussion

  1. 3 weeks ago

    Hal G

    Sep 29 Pre-Release Testers, Xojo Pro Orlando, FL

    Feel free to ask about Aloe here and @Tim D and I will try to answer. Anyone else can answer too... :)

  2. Hal G

    Sep 29 Pre-Release Testers, Xojo Pro Orlando, FL

    Robert asked this here: https://forum.xojo.com/43345-xojo-web-vs/last but I thought it'd be better to start another thread...

    @RobertLitchfield @Hal G , @Tim D ,
    I watched your demo at the VXUG September 2017 Meeting and while I'm understanding the overall concept I'm having trouble putting it into practice. From what I understand from your demo, Aloe should improve the performance of my existing slow application (possibly due to my own newbie mistakes). To help me understand the implementation of Aloe, would it be possible to see 1) how pages interact with each other and 2) how to retrieve data from a form.

    My application consists of about four pages, of which two of them are input forms with pre-populated form fields. The application is too slow, and I'm trying to find ways to improve the performance. (I have another thread related to this.)

    BTW...if this should move to another thread...I'm happy to do so.

    Robert

    Hey Robert,

    Since we're using standard html posted forms, you need to handle receiving the posted data and create a form to post the data.

    Near the beginning of the loading a page, we check to see if any data was posted and for good measure, see if we have a value in the posted value called token. If we do, we run our method to save the data.

    // Data was posted
    If AloeRequest.WebRequest.Method = "Post" Then
      
      // Save the Data
      If AloeRequest.POST.Lookup( TablePlural + "DetailForm" + "Token", "" ).StringValue <> "" Then
        // Save the Data
        HTMLDetailHandleSave
      End If
    
    End If

    Then we create the html form populated with the data from the record. If data was posted, the record is already updated since we saved. Below you can the form opening tag that posts back to the same page. Then we include two hidden form fields. Further down in the code, are all the other form fields like First Name which would use the data from Records.Field( "NameCompany" ).StringValue.

      // Open the form.
      HTMLDetail = HTMLDetail  + "<form id='" + TablePlural + "DetailForm" + "' name='" + TablePlural + "DetailForm" + "' method='post' action='" + RequestPathBase + "" + TableKey + "' enctype='application/x-www-form-urlencoded'>"
      
      // Form Token
      HTMLDetail = HTMLDetail  + "<Input type='hidden' name='" + TablePlural + "DetailForm" + "Token" + "' id='" + TablePlural + "DetailForm" + "Token" + "' value='1' >"
      
      // TableKey
      HTMLDetail = HTMLDetail  + "<Input type='hidden' name='" + TableKeyName + "' id='" + TableKeyName + "' value='" + Records.Field( TableKeyName ).StringValue + "' >"

    In Xanadu, I use the following code to add a floating div, show a 'Name' label, and then add an html table to display the labels / fields.

    ///////////////////////////////////////////////////////////
    // Group
    HTMLDetail = HTMLDetail + GetDivBeginStageFloat( "auto" )
    HTMLDetail = HTMLDetail + "<p><strong>Name</strong></p>"
    HTMLDetail = HTMLDetail + GetTableBeginNoBorder
    
    
    // NameCompany
    Field = New FormField( "Text", "NameCompany", Records.Field( "NameCompany" ).StringValue, "width: " + GetPX( GetWidthDefault ) + ";" )
    HTMLDetail = HTMLDetail + GetTableRow2RL( "Company", Field.HTML )
    
    // NameTitle
    Field = New FormField( "Text", "NameTitle", Records.Field( "NameTitle" ).StringValue, "width: " + GetPX( GetWidthDefault ) + ";" )
    HTMLDetail = HTMLDetail + GetTableRow2RL( "Title", Field.HTML )
    
    // NamePrefix
    Field = New FormField( "Text", "NamePrefix", Records.Field( "NamePrefix" ).StringValue, "width: " + GetPX( GetWidthDefault ) + ";" )
    HTMLDetail = HTMLDetail + GetTableRow2RL( "Prefix", Field.HTML )
    
    // NameFirst
    Field = New FormField( "Text", "NameFirst", Records.Field( "NameFirst" ).StringValue, "width: " + GetPX( GetWidthDefault ) + ";" )
    HTMLDetail = HTMLDetail + GetTableRow2RL( "First", Field.HTML )
    
    // NameMiddle
    Field = New FormField( "Text", "NameMiddle", Records.Field( "NameMiddle" ).StringValue, "width: " + GetPX( GetWidthDefault ) + ";" )
    HTMLDetail = HTMLDetail + GetTableRow2RL( "Middle", Field.HTML )
    
    // NameLast
    Field = New FormField( "Text", "NameLast", Records.Field( "NameLast" ).StringValue, "width: " + GetPX( GetWidthDefault ) + ";" )
    HTMLDetail = HTMLDetail + GetTableRow2RL( "Last", Field.HTML )
    
    // NameSuffix
    Field = New FormField( "Text", "NameSuffix", Records.Field( "NameSuffix" ).StringValue, "width: " + GetPX( GetWidthDefault ) + ";" )
    HTMLDetail = HTMLDetail + GetTableRow2RL( "Suffix", Field.HTML )
    
    
    // Column End
    HTMLDetail = HTMLDetail + GetTableEnd
    
    HTMLDetail = HTMLDetail + GetBR + GetDivEnd

    It looks like this in the interface, in the Name portion...

    -image-

  3. Robert L

    Sep 29 Pre-Release Testers, Xojo Pro

    This looks very interesting...let me work through it this afternoon and if I have questions I'll post them here. :)

    Robert

  4. Robert L

    Sep 29 Pre-Release Testers, Xojo Pro
    Edited 3 weeks ago by Robert L

    Well that worked like a charm! Once I got my head around it, it all makes sense as it is somewhat like building the old .asp web applications with VB.

    I do have a question though, why do you have a mandatory default value on the POST.LookUp()? The reason I ask is that I might be missing something in the way I did it.

    Edit:
    The more I play with this...the more I like it. I was concerned I might need to move to Rails in order to get the scalability I wanted, but now I can stay in the Xojo system (which I'm a fan of) while getting the performance I need.

    Robert

  5. Hal G

    Sep 29 Pre-Release Testers, Xojo Pro Orlando, FL

    @RobertLitchfield I do have a question though, why do you have a mandatory default value on the POST.LookUp()? The reason I ask is that I might be missing something in the way I did it.

    For this?

    If AloeRequest.POST.Lookup( TablePlural + "DetailForm" + "Token", "" ).StringValue <> "" Then

    Tim has Aloe returning the post values in a dictionary. So that is looking up the value for the key TablePlural + "DetailForm" + "Token". I calc the key so I don't have to go to each page and copy paste the Token name for that page. TablePlural is just the plural form of the table, in this case 'Contacts'. The second parm in the Lookup is "" which means return "" if that key does not exist in the dictionary. I could use the same token name on every page, but I wanted it to be specific...

    I'm psyched you like it. @Tim D did a spectacular job making Aloe super fast AND simple for the rest of us to take advantage of! Aloe really makes Xanadu shine!

  6. Robert L

    Sep 29 Pre-Release Testers, Xojo Pro
    Edited 3 weeks ago by Robert L

    I've been mucking around in it for the last couple of hours testing different use cases. So far Aloe is passing most of them, though more testing is still needed.

    I am missing the ability to access a session variable though (maintain state per site users). I know @Tim D is working on adding a session module, so I'm looking forward to testing that when it is available.

    I will do more testing over the weekend because I want to see Aloe in action pulling a fair amount of data from a DB and displaying it. That will be the true test of the performance for my use cases.

    RJL

  7. Hal G

    Oct 3 Pre-Release Testers, Xojo Pro Orlando, FL

    Just received my Amazon AWS Invoice for:

    • $5/month Amazon Lightsail
    • ~$30/month Amazon Aurora MySQL

    And that can run multiple apps, depending on the load... :)

    -image-

  8. Kevin W

    Oct 3 Pre-Release Testers, Xojo Pro

    I have a vps that runs about $24 per month that I run email, web, mysql, and a few small apps on. It's not as loaded as I thought it would be so I could probably run it for less than $20. There's a ton of low cost options out there.

  9. Thomas T

    Oct 3 Pre-Release Testers, Xojo Pro Europe (Germany, Munich)

    I keep being impressed by the numbers you're going with. My websites are still running on a fairly slow virtual web server, with an Apache (or is it Nginx? I can't even tell) html + php server, and I pay about $10/mo for it. Never ran out of capacity or it getting slow. The only kind of high load I needed was for delivering my apps, which. thanks to Xojo, are about 10MB in size, and would drain on the traffic limit in the past. So I am using Amazon S3 for downloading those files now, and I pay about 1-2 US$ a month for that.

    What kind of stuff do you guys run that require you to pay $35 a month??

  10. Kevin W

    Oct 3 Pre-Release Testers, Xojo Pro

    I could have paid about $10 and gone with dual core instead of quad core, but we host about 75 email accounts and webmail service on that vps and I wanted it to be snappy. No complaints so far.

    I host my personal stuff at home and don't pay anything for it beyond my regular internet connection. Been that way for many years now. Used to host it on an old powerbook g3 with a dying battery. It would still last an hour on battery though, so better than a cheap UPS.

    If I were to set anything up new, I'd probably find a used i7 mac mini or a maybe a nuc and load proxmox on it and host everything myself. It's nice to be able to spin up a vm quickly and the backup in proxmox is very easy to use. You can rsync the backups to a local machine and be able to get back up and running quickly. We have a couple of machines at work set up this way. It's quite nice. You can spin up a new vm, or a backup of your current one and test out changes and then blow it away when you're done.

  11. Thomas T

    Oct 3 Pre-Release Testers, Xojo Pro Europe (Germany, Munich)
    Edited 3 weeks ago by Thomas T

    Kevin, running a server from home - that requires you to have a static IP, or use a dyndns service, though. The latter I find a bit unreliable, don't you?

  12. scott b

    Oct 3 Pre-Release Testers, Xojo Pro local coffee shop

    @ThomasTempelmann What kind of stuff do you guys run that require you to pay $35 a month??

    most of that is DBaaS (MySQL as a Service) costs.. LightSail and Digital Ocean’s smallest servers are $5/month.

  13. Kevin W

    Oct 4 Pre-Release Testers, Xojo Pro

    I have my domains with NameCheap. They have an included dynamic dns service that I have setup on my router (mikrotik). It updates as needed. Most providers in my experience, at least in our area use DHCP and unless there is a prolonged power outage on the provider's end, the ip that is assigned from the server remains the same. I think it's been a couple of years or more since our IP has changed.

  14. Deleted 3 weeks ago by Robert L
  15. Hal G

    Oct 5 Pre-Release Testers, Xojo Pro Orlando, FL

    Added some info on the Xanadu web page how @Tim D and I are deploying our Aloe based Xojo Web Apps on Amazon Lightsail using NGINX, Amazon Aurora, and Amazon S3.

    Tim will be demoing "Hosting Xojo Web apps w/ Amazon Web Services, Nginx, and more." at the next VXUG meeting .

  16. 2 weeks ago

    Scott S

    Oct 6 Pre-Release Testers Waukesha, WI USA

    Aloe is a great project. Thank you so much! Running in the debugger works awesome.

    I am having an issue though. After building it as standalone, I copy the htdocs, logs and data folder into the same level as the app. When I load the page in the browser, I get the 404 page.

    Demo 1 gets the 404 page
    Demo 6 gets a blank page in the browser

    I tried building a standalone for OSX and for the raspberry pi. Both get the same result.

  17. Tim D

    Oct 7 Pre-Release Testers, Xojo Pro Richmond, VA

    @Scott S : Try moving your compiled app into a subfolder, so that the folder structure looks something like this:

    /app
    	your-app
    	your-app Libs
    	your-app Resources
    /htdocs
    /logs
  18. Scott S

    Oct 7 Pre-Release Testers Waukesha, WI USA

    Thank you, @Tim D . Moving the app into a subfolder did the trick.

  19. Hal G

    Oct 7 Pre-Release Testers, Xojo Pro Orlando, FL

    @Tim D Try moving your compiled app into a subfolder, so that the folder structure looks something like this

    The structure Tim suggested makes it easy to replace the app without having to move the supporting folders. :)

  20. Deleted 2 weeks ago by Tim K

or Sign Up to reply!