Web Connection
Web Connection 6.50 Beta Announced
Gravatar is a globally recognized avatar based on your email address. Web Connection 6.50 Beta Announced
  Rick Strahl
  All
  Oct 9, 2018 @ 07:25am

Hi all,

I've just put out a preview release of Web Connection 6.50, which will be a major release update to Web Connection. It's been 3 years since 6.0 was released and this update cycle includes a number of big changes that warrant a major release.

UI Updates: Bootstrap 4 and FontAwesome 5

'Major' in that there are a few big changes that required a ton of work on my part to fix up existing samples and all the myriad of templates, but not major as in major breaking changes. The brunt of the work in this release is around updating the support frameworks to current versions - specifically upgrading to BootStrap 4 and FontAwesome 5. Bootstrap 4 has kept most of its original features but there are a lot of breaking changes when moving from Bootstrap 3 - 4. However, even though these frameworks are not drop in replacements, you can continue to use existing apps that are running with older versions and gradually upgrade, or simply keep running with the older frameworks.

In the process of updating I've also did a major overhaul of the page templates, and support libraries moving off of the obsolete Bower and to just going back to including specific lib versions. The end result is that the templates are now cleaner and more modern.

There's a new BOOTSTRAP_VERSION 4 flag in wconnect.h that affects how some of the HTML components render - specifically the DatePicker and checkboxes and radio buttons have some behavioral changes between versions due to the differences in the layout Bootstrap uses. For existing applications you can set the flag to 3 and it'll use the old rendering for controls so it works either way.

Visual Studio Templates and Code Snippet Updates

I know many of you don't use Visual Studio for building Web Connection applications but one of the nice things about Visual Studio is the extensibility. I've updated the Page templates for the new features described above and also created a number of Code Snippets that help embedding Web Connection specific controls and a number of common bootstrap constructs like data drive form groups and so on.

This relates very much to the new layouts and I'm finding this is making me much more productive.

Reminder: You can easily create your own Templates and Snippets

I mentioned this a few times, especially during training in years past: It's really easy to create code snippets in Visual Studio, which are simply XML text files that contain expansion text and place holder values that can be replaced. If you have anything at all that is repetitive creating a Code Snippet in a few minutes as an XML file and dropping it into a special folder can saves gobs of time.

Updated Samples

I've also updated the Web Connection Samples that are running online here:

Web Connection Samples

You'll notice the new Bootstrap and FontAwesome themes and a few other small changes. Overall, the changes aren't drastic, but definitely noticable.

New File Upload Examples

There are also two new file upload examples - one using a few approaches for very simple button style uploads using plain POST, AJAX and using a new slick component call Uppy.

Markdown Improvements

Web Connection now includes the ability to simply drop a .md file into a folder and have that document rendered as HTML using the default layout page for the page wrapper. This can be quite handy for text based pages like About pages, Service Agreements, Privacy policy, Contact us and so that are usually part of a site but aren't dynamic.

You can now simply drop a file into a folder and reference it over the Web. It's a small thing, but very useful.

In addition, the Markdown Islands feature that allows you to embed a block of Markdown into a Script or Template like this:

<div id="EmbeddedMarkdown">

<markdown>
    ## This is a Markdown header
    This is a block of **Markdown text** embedded inside of the HTML document. 
    It's automatically parsed.
    
    Here's what it does:
    * Parses Markdown text
    * Creates HTML
    * Leaves Script expressions intact
    
    > ### Note
    > Markdown cannot contain script expressions.
    
</markdown>

</div>

As above this lets you more easily deal with large static blocks of text in an otherwise dynamic page.

Also related to Markdown there's a new SanitizeHtml() function which can strip all script code from HTML input - including Markdown rendered to HTML - captured from users. HTML or Markdown input has to be checked for Cross site scripting and SanitizeHtml() takes care of that producing safe html.

New wwPdfPrinterDriver

There's a new generic wwPDF printer driver that works with most printer drivers that output to PDF. On Windows 10 and Windows 2016 there's now a Microsoft PDF Printer Driver that can be used to create PDF output quickly and generically, and we can use this new printer to print reports to PDF.

Here's what that looks like using what should be familar wwPdf style printing:

oPDF=CREATEOBJECT("wwPdfPrinterDriver")     

*** Specify the printer **name** from your Printer List
oPdf.cPrinterDriver = "Microsoft Print to PDF"

*** Optional - wait for doc to finish in milliseconds
oPdf.nMaxWaitTime = 10000

lcFile = SYS(2023) + "test.pdf"

IF !oPDF.PrintReport("custlist.frx",lcFile)
   ? oPDF.cErrorMsg
ENDIF

*** Desktop: Open the file and display it
* GoUrl(lcFile)

*** Web: Download the file from disk to Web clients
Response.DownloadFile(lcFile,;
                         "application/pdf",;
                         "CustomerReport.pdf")  

User Management

There are also a number of wwUserSecurity enhancements that allow checking for empty user data, a new wwProcess::oUser member that now always is set and can be checked for user authentication more easily. No more explicit OnAuthenticated() hooks are required the oUser is now available on any request.

I've also been working on a generic Login and User Management system that provides drop in authentication to applications. So managing logins, adding new users, new user validation, password recovery as well as a simple user administration module can simply be plugged into an existing application rather than recreating that code repeatedly for every application. However, this will be a separate product most likely and it's not quite ready yet - those coming to the Web Connection training and the SW Fox conference will get a glimpse at this and get a preview there 😃

More stuff...

There are also a number of wwDotnetBridge improvements, including a big fix that works around the nasty File blocking issue with files loaded from network based sources. wwDotnetBridge now checks for blocked files and tries to unblock them before the DLLs get executed. There's also better error handling for wwDotnetBridge load errors on startup which have always been very cryptic. Between these two fixes there should be much less of a hurdle to use wwDotnetBridge.

There have also been a number of bug fixes in the install Wizards including one fairly major issue with Application Pools that seems to be caused by some change in behavior of the IIS automation tools was fixed.

Upgrades?

As I mentioned this is a major release meaning this will be a paid for upgrade. It's been 3 years since 6.0 and this major update warrants that half version update that is a paid upgrade.

If you've registered Web Connection since the beginning of the year you qualify for a free upgrade. Contact me directly and I'll get your license upgraded.

Upgrade pricing is available and during the beta there's an additional 10% discount using a promo code of WebConnectionBeta.

Web Connection 6.50 Upgrade

Feedback

If you're a registered user of Web Connection 6.0 you already got a beta notice with a download link to the latest beta version. I'm hoping to gather some feedback on the new version both from a new install perspective and setting up a new application, as well as running the new version with an existing application.

Web Connection versions can install side by side so you can have old and new running on a machine, just make sure to point at the appropriate version folders from your project folders.

Check it out and please report any issues you find here.

Aloha,

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Web Connection 6.50 Beta Announced
  Jeff L
  Rick Strahl
  Oct 9, 2018 @ 08:56am

Rick,

I ran the samples on the Brave browser and everything worked ok with one exception that I could see.

I used the Brave browser and did get funny results when printing the PDF with Display to Browser checked.

I think it's a Brave browser behavior, the PDF always downloaded and never displayed in the browser. In fact Brave downloaded a WWD file with binary data instead of displaying to the browser. Using Brave it successfully downloaded a good PDF when the radiobutton to download was checked.

I checked it out in Chrome and both options worked correctly.

Checked out the Albums. While I'm not the biggest metal fan, I do have some, of course. I was happy to see Neurosis 'Enemy of the Sun' album in your collection. Way cool!

Gravatar is a globally recognized avatar based on your email address. re: Web Connection 6.50 Beta Announced
  Rick Strahl
  Jeff L
  Oct 9, 2018 @ 01:43pm

Thanks Jeff for the heads up. Always good to get some feedback from things running on someone else's machine 😃

As to the PDF rendering on Brave - that makes sense. Brave most likely doesn't have a built-in PDF viewer so it'll try to display the raw PDF binary/text which is going to produce unpredictable results. The proper way a browser is supposed to handle this is if it doesn't know how to render the content type provided is to download it.

The explicit download link solves that inconsistency, but it's a bit more of a hassle as you have to hold on to the file and then later delete it without knowing when the user is done (usually using some sort of DeleteFiles() scheme that deletes files that are over a certain date old).

Again, thanks for checking things out and reporting... it is useful!

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Web Connection 6.50 Beta 2 Update
  Rick Strahl
  Rick Strahl
  Oct 13, 2018 @ 05:17pm

I've just pushed up another update of the beta to the download sites. If you're a registered user of 6.x you can use the registration info sent in the last email. The filename and password are the same...

This update fixes many small administration and configuration issues that predate this beta. New projects get a lot of little enhancements that should make installs (both first time and CONFIG installs on a server) more reliable. I've also added a new BrowserSync.prg file for new projects that runs your project under Browser-Sync if it is installed for a quick way to launch a project with live-reloading - just DO BrowserSync.prg.

Updating older Projects (6.x+ versions)

If you have existing projects you can look in the `ProjectTemplates folder to find the default templates for this.

If you have older projects and you want to update to the latest support files I recommend:

  • Create a new project
  • Use BeyondCompare or similar to compare:
    • build.bat
    • install-iis-features.ps1
    • deploy\bld_YourApp.prg
    • deploy\yourApp_serverConfig.prg
    • deploy\yourAppMain.prg

Updated Samples Online

I've also updated the online Web Connection Samples at:

https://west-wind.com/wconnect/

The samples now use the new templates and examples.

I've also updated the SwFox Training application which is a simple time tracking application which is now online at:

https://swfoxtimetrakker.west-wind.com

Give it a Try

I'm getting pretty close to release 6.50 - before the conference next week, so any feedback will be useful. If you run into any issues please post back here.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. Web Connection 6.50 Beta 3 Update
  Rick Strahl
  Rick Strahl
  Oct 26, 2018 @ 03:40pm

Hi all,

I've just put up Web Connection Beta for 5.60 Beta 3. This update has a number of small improvements over the previous betas, some of which came up during the recent Southwest Fox Training last week.

The updated beta is available here:

  • Shareware Version
  • Registered Users of 6.x should have gotten an email a couple of weeks back

Note that 6.50 will be a paid upgrade from version 6.0 - if you registered Web Connection since the beginning of the year the upgrade will be free. Otherwise upgrade pricing applies.

Updates since the last Beta (see original message in this thread)

Here are a few of the main improvements:

No more hardcoded Paths in compiled Script Content Pages

The wwScripting class that's responsible for turning .wcs style FoxPro/HTML script pages into FoxPro code previously embedded a hard coded path into the template for template content pages. Template content pages are pages that are referencing back to a _laytout.wcs (or whatever other) page that provides the re-usable page chrome for a site.

Previously the content page hardcoded the path to the template into the actual PRG file as the layout page which actually is the top level rendering control has to find the content page on disk in order to execute it.

The result of this was that you'd get content page PRG files that had something like this:

LOCAL CRLF
CRLF = CHR(13) + CHR(10)

 pcPageTitle = "Customers - Time Trakker" 

 IF (!wwScriptIsLayout)
    wwScriptIsLayout = .T.
    wwScriptContentPage = "c:\webconnectionprojects\timetrakker\web\Customers.ttk"
    ...
ENDIF

The hard coded path would be injected at the time when the page was created. This works just fine if you are running the PRG and FXP on the same site that it was compiled on, but it could cause problems if you deployed your application when the page was not in the exact same path hierarchy as when it was compiled.

With the latest release Web Connection now stores the page name in a PRIVATE variable when the page is initially accessed - after all the processor knows the path to the page that we are accessing. The value is declared at the top of the call, and then passed down via the call stack. Getting this right turned out to be tricky as the timing is critical, which is why I believe the hard coded path was used to begin with.

Anyway - now there are no more hardcoded paths and you should now be able to easily deploy FXP files of Content Script Pages to the server and execute them without any issues.

Markdown Island Improvements

I've also added minimal support for script processing inside of Markdown islands. Markdown islands are blocks of markdown contained inside of a <markdown></markdown> block and is rendered as Markdown.

You can now do things like this:

<markdown>
   Welcome back <%= poModel.Username %>

   ### Your Orders
   <% 
      SELECT TOrders 
      SCAN
   %>
      **<%= TOrders.OrderNo %>** - <%= FormatValue(TOrders.OrderDate,"MMM dd, yyyy") %>
   <% ENDSCAN %>
</markdown>

You can now embed script expressions and code blocks inside of Markdown blocks and they will execute.

Note that there are some caveats: Markdown blocks are expanded prior to full script parsing and any Markdown that is generated is actually embedded as static text into the page. The script processor then parses the rendered markdown just like it does any other HTML markdown on the page.

This has a few consequences as well: Markdown is always rendered as is at parse time which means multi-line markdown statements (lists, tables for example) may be rendered in unpredictable ways. For example list items (* item 1) in a loop will render as individual lists rather than individual list items because the MD is expanded at render time before the script expressions are executed.

So in short script expressions work but there are some limitations - alas: Caveat Emptor.

Browser Sync PRG now created for new Projects

When you create a new project, Web Connection now creates a browserSync.prg that's properly configured for your project. Assuming browser-sync is installed, this file will:

  • Launch Browser Sync on the Command Line
  • Navigate your browser to the appropriate site and port
  • Start your FoxPro server as a PRG file (DO yourAppMain.prg)

If you haven't played with Browser Sync and how it can help you quickly auto-refresh Script, JS and CSS pages after you make changes take a look at this recent blog post.

Final Beta

This should be the final Beta Release of Web Connection 6.50 as I've put the current code base into production and I also used it for all of the training at Southwest Fox, which is always a good stress test to find odd bugs. There were very few and really none related to the new features.

I'm hoping to put out 6.50 next week some time. However, I'd appreciate if some of you could install the beta and check out features and play around with some of the improvements. Any feedback before release would be awesome...

+++ Rick ---

© 1996-2024