PxPlus User Forum

Twitter Twitter Twitter

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Mike King

Pages: [1] 2 3 ... 65
1
Programming / Re: JSON from Array with numeric and string
« on: Today at 12:28:19 PM »
Another simple solution, which will work when using older PxPlus, is to predefine the JSON structure then load the values:

For example, we can preload the numeric JSON elements with zero values.  Only the numeric values need be declared.

->x$="{'Balance':0}"
->dim load json$=x$


The above will create the array json$ with add the element Balance marked as numeric.  Now you can define the various values you need.

->json$["Name"]="Mike King"
->json$["Addr"]="123 Main St"
->json$["Balance"]="123.45"
->json$["Email"]="mike.king@bbsysco.com"


When the Array is converted back to JSON the Numeric indicator for Balance is remembered.

->print dim(list edit json$)
{
  "Addr":"123 Main St",
  "Balance":123.45,
  "Email":"mike.king@bbsysco.com",
  "Name":"Mike King"
}





2
Nomads / Re: Convert NOMADS file to XML (need IOLIST)
« on: March 13, 2024, 05:39:27 PM »
Actually you can get the IOLIST for the Nomads screen definition file from the Nomads object.

It can be accessed by IOL=%nomads'_lib_iol$


3
iNomads / Re: File Upload
« on: March 09, 2024, 02:00:30 PM »
My suggestion would be to upload to a temporary directory then check the file size and contents using a virus scan and only then copy it to the proper location.

Technically there is no 'sure fire' way to control what the user is uploading.  For example while you might want to restrict a user to only upload a JPG or PNG, they could simply rename a infected file to have a .png or .jpg suffix.  Only once the file is uploaded can you confirm its contents. 

For JPG, PNG and BMP files you can read the first few bytes of the uploaded file to confirm the file type, then run whatever anti-virus software you want on the file before accepting it.  For example if you use Avast as your anti-virus the command ashCmd.exe can be used to scan a specific file and report its findings.

4
Web Services / Re: Publishing a PDF through PXPlus web engine
« on: March 07, 2024, 09:58:08 PM »
Here is a simple web program that will return a PDF file:

Code: [Select]
0010 OPEN (HFN)"*pdf*;file=output.pdf"
0020 FOR i=1 TO 20
0030 PRINT (LFO)"This is line ",i
0040 NEXT i
0050 CLOSE (LFO)
0060 OPEN (HFN,ISZ=-1)"output.pdf"
0070 READ RECORD (LFO,SIZ=1000000)contents$
0080 CLOSE (LFO)
0090 WRITE RECORD (%print_fn)contents$
0100 LET %Content_type$="Application/pdf"
0120 END

It creates a PDF file on "output.pdf" with lines 1 thru 20, sets the content type, and returns the PDF file contents.

You should be able to save this on your PxPlus Web server in the document root directory as something like pdf.pxp then call up the URL.  It will display the PDF.

Obviously in production you would dynamically create the PDF output file name and delete it when done.

5
Web Services / Re: Publishing a PDF through PXPlus web engine
« on: March 06, 2024, 04:18:29 PM »
Let me know if you have any issue with setting the content type.  It should work.

As for me, while we have left PVX Plus Technologies, I am enjoying semi-retirement.  Doing some ad-hoc consulting in order to keep active and busy.

Anyway, if you need help feel free to contact me and we will see what we can do.

6
Web Services / Re: Publishing a PDF through PXPlus web engine
« on: March 06, 2024, 03:18:05 PM »
Another thought, if the web server is Apache you might be able to use ProxyPass (and possibly ProxyPassReverse) to have the web simply re-route the specific request to your backend PVX Plus web server. 

This could be used to forward to whole request and return the result or to forward a request for the resultant PDF file and simply leave the PDF files on the PxPlus server.

There is something similar available for IIS if needed.

7
Web Services / Re: Publishing a PDF through PXPlus web engine
« on: March 06, 2024, 02:56:22 PM »
How is the website forwarding the request to the PxPlus web server?  If its by a standard web request you likely could have the PxPlus web server application respond with the contents of the web file and set the content type to "application/pdf".  Basically open/read the resultant PDF file as a binary file and write it to %PRINT_FN.

Assuming the webs site forwards the response that it receives along with its headers the PDF should get displayed.

8
Programming / Re: Can create a Browse Query
« on: March 03, 2024, 09:36:18 PM »
You could use the maintenance/screen generator to create a screen with a list box that you populate from a query, then add buttons below it.

You could also change your design so you start from a file maintenance screen with a query that allows selection of the client.  The standard file maintenance has edit, add new, and delete options along with browse buttons.

9
Webster Plus / Re: EZWeb takes approx 20 seconds for actions
« on: February 29, 2024, 04:04:02 PM »
That sounds like it would work.  The actual waiting page could be generated by Webster+ since a page that is being displayed and idle waiting to request an update itself would not consume a user slot.  Basically the user slot will only be used while Webster generates the page, not while its displayed.  Actually this is one of main benefits of developing using Webster+.  Less active resources used on the server.

Now if you only need to update the display every 5 minutes (300 seconds) and assuming your logic can generate the response in 1/2 second (which is likely an overkill) for 1000 users you likely only need a 2-3 user license (with 1/2 second processing 300 seconds will allow for 600 requests).

Let us know if you need any help.

10
Webster Plus / Re: EZWeb takes approx 20 seconds for actions
« on: February 28, 2024, 10:35:43 AM »
I was thinking about your issue last night and wondering if perhaps the easiest solution for you would be to use RSS.

There are a number of free RSS readers for Windows and other platforms, many of which can reside in the task bar or run in the background and display an alert when an RSS feed changes. 

On the server you could create RSS files and have your  internet web server (Apache, IIS, etc) simply serve up the RSS file.  Depending on your needs you could have multiple RSS feeds, a global for all users, company specific feeds, even user specific feeds.  These RSS files could be updated on the server as required using PxPlus either as the events occur or by a background task.  As for load, most servers can easily handle 1000s of requests per minute if all they are doing is forwarding a data file (the RSS feed).  This avoids you having to worry about how many PxPlus licenses you might need as PxPlus would not be directly involved in the RSS request.

Of course a lot of this depends on exactly what your application requirements are, but using RSS might be a real simple solution.

BTW: Another solution might be to use something like WhatsApp to send messages.  This is something I am looking at presently.




11
Webster Plus / Re: EZWeb takes approx 20 seconds for actions
« on: February 27, 2024, 08:20:53 PM »
There are a number of ways you could handle this.  You actually have two issues, one is the central server that the desktops will connect to and will serve up the status changes, the other is the software on the workstation.

For the central server you should be able to use PxPlus to handle the load.  To determine the number of concurrent users you would need to determine how long a request takes to respond and the frequency that you want workstations updated.

For the workstation this would be fairly easy to do using PxPlus however the license costs might be prohibitive.  If you find that is the case you could use something like powershell to create a workstation process or create a C, .NET or VB application to do the same. 

Now technically depending on your actual application requirements you might be able to have the host simply maintain 'status files' on the server and use Apache (or any other web service like IIS) simply serve up the status files.  PxPlus could update the status files as needed.

Last, but not least, you might be able to use Web Notifications as that may provide you the functionality you are looking for.

Of course, all of the above depends a lot on the exact needs of your application.



12
Webster Plus / Re: EZWeb takes approx 20 seconds for actions
« on: February 27, 2024, 02:46:05 PM »
Webster+ uses the PxPlus Web server interface which can run on EZWeb, Apache, or IIS uses a user slot for the duration of the process.  That is a user slot will be needed/allocated when the host server receives the request then freed up once the request has been completed.

When using the Web Server interface there is nothing actually running on the server until the user makes the request. 

In normal Windows/Linux processing once the user starts the application a user slot is allocated and will remain in use until they totally exit the application and all processes have completed. 

For example on Windows/Linux non-Web applications there is always at least one process running on the server and as such it requires a user slot for the duration.  When running using the Web server interface when a request is received a PxPlus process is started (using a user slot) and terminated once the response is sent.

13
Programming / Re: PXPlus crashing after error 61
« on: February 21, 2024, 07:48:30 PM »
Glad its been resolved. 

Over the years I have seen a variety of weird OS compatibility issues so I always suggest you run a version of PxPlus compiled and tested AFTER the release date of any OS.  In your case, while v12.50 may have started and appeared to run on Redhat 7, it was compiled and tested on Redhat 6.

14
ODBC / Re: Serius I complete missing undesrtand odbc
« on: February 21, 2024, 08:00:11 AM »
Edias is correct.  This appears to be the ProvideX ODBC driver as sold and supported by Sage with their MAS90 accounting package. 

If the issues you are having are relative accessing MAS90 data you should contact Sage for assistance as their ODBC driver is different than the drivers for PxPlus.

15
Programming / Re: Sign XML Documents with Digital Signatures
« on: February 20, 2024, 07:42:33 AM »
I would probably use XMLSEC (xmlsec1) to do this from command line as it is available on both windows and Linux and there is fairly extensive documentation available at:

http://sgros.blogspot.com/2013/01/signing-xml-document-using-xmlsec1.html

Here is the command documentation:

https://www.mankier.com/1/xmlsec1

While PxPlus logic could be used directly; by using a standard package like xmlsec1, should you have any issues the company receiving the XML may have examples.

Pages: [1] 2 3 ... 65