Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: 1 2 3 [4] 5 6 ... 10
 31 
 on: May 04, 2025, 11:46:07 pm 
Started by Gary C. - Last post by Leo S.
Hi Gary, works for me with  FGL 5.01.02 and httdispatch 5.01.01 ... see attached.
Try at your side and if this doesn't work with your env contact the support.

I'd like to point you for displaying PDF's "inlined" to a simple webcomponent I came up with: it doesn't open a 2nd tab and you could integrate more seamless into your workflow.
Since 4.x it works painless in GBC and GDC (exception safari mobile: only the 1st page of the pdf is displayed as an image because it seems an iframe limitation of safari mobile).
Previously pdfjs was needed to render PDFs in a Genero Form, nowadays browsers are capable of displaying their own GUI for showing PDFs in an iframe.
See https://github.com/leopatras/wc_simplepdf
Regards, Leo

 32 
 on: May 04, 2025, 03:21:04 pm 
Started by Gary C. - Last post by Gary C.
Hi
We have finally made the move from FGL 3.21 to 5.01 but have noted a behaviour we cannot explain when using the launchURL front call in conjunction with ui.Interface.filenameToURI to display stored documents.

We have a centralised function to do this as all documents are stored in a single document archive. The function is as below:

Code
  1. #+
  2. #+ View a document by its ID
  3. #+
  4. #+ This function allows the user to download a document for viewing
  5. #+
  6. #+ The public record will be set holding the document ID and its actual name
  7. #+
  8. #+ Documents are stored by ID in an archive folder (the root of which is held in environment variable: FGL_DOCUMENTROOT)
  9. #+ IDs are prepended with zeros to make them 12 characters in length, e.g. 215168 becomes 000000215168
  10. #+ The folder structure for the above document is then:
  11. #+
  12. #+ $(FGL_DOCUMENTROOT)/000/000/215/000000215168
  13. #+
  14. #+ @return Nothing
  15. #+
  16.  
  17. function sys_viewDocumentByID()
  18.  
  19.    define sFileSource,
  20.        sFileDestination,
  21.        sDocumentUri string
  22.  
  23.    if p_documentR.documentid is null then
  24.        return
  25.    end if
  26.    if p_documentR.documentname is null then
  27.        return
  28.    end if
  29.  
  30. # Get the full path to the document within the archive
  31.  
  32.    let sFileSource = sys_getDocumentPath(p_documentR.documentid)
  33.    if sFileSource is null then
  34.        return
  35.    end if
  36.  
  37. # If using GBC, copy the document to the temporary area, renaming at the same time
  38. # If all is well, get the URI and make the front call
  39.  
  40.    if ui.Interface.getFrontEndName() = "GBC" then
  41.        try
  42.            let sFileDestination = os.Path.join(g_tmpServerDir.trim(), p_documentR.documentname.trim())
  43.            if os.Path.copy(sFileSource, sFileDestination) then
  44.                let sDocumentUri = ui.Interface.filenameToURI(sFileDestination)
  45.                call ui.Interface.frontCall("standard", "launchURL", [sDocumentUri], [])
  46.            end if
  47.        catch
  48.            call sys_showMessage(%"Error", sfmt(%"Unable to download file %1 to %2 (%3)", sFileSource,  sFileDestination, status), "")
  49.        end try
  50.        return
  51.    end if
  52.  
  53.    try
  54.        let sFileDestination = g_tmpClientDir.trim(), g_clientPathSeperator.trim(), p_documentR.documentname.trim()
  55.        call fgl_putfile(sFileSource, sFileDestination)
  56.        call sys_launchDocument(sFileDestination)
  57.    catch
  58.        call sys_showMessage(%"Error", sfmt(%"Unable to download file %1", sFileSource)||CRLF||sfmt("To: %1", sFileDestination), "")
  59.        return
  60.    end try
  61.  
  62. end function
  63.  

For the time being we are able to run our codebase using FGL 3.21 or 5.01, hence the check for the front end type.

The above works well when the filename of the document has no spaces, e.g. image01.jpg, but fails when there are spaces.

For example, a filename of "Meeting Report.pdf" will fail. The result is the following URI, for which we get a bad request response in the browser:

https://app.alsico.co.uk/gas/ua/ft/6f73f925533f0d5470e57ba6ea7b762a/fgl-files/82966/Meeting%20Report.pdf?t=1746363820;s=461534;charset=UTF-8

However, if we replace the spaces with an underscore, i.e. "Meeting_Report.pdf", this results in a URI such as below, which works:

https://app.alsico.co.uk/gas/ua/ft/831139bc472031110b9fe19ea07f7add/fgl-files/82994/Meeting_Report.pdf?t=1746363908;s=461534;charset=UTF-8

Can anyone see any issues in the above code? Though the workaround is fine, it would be better for us not to have to manipulate the file name.

Thanks in advance

Gary

 33 
 on: May 03, 2025, 06:50:22 pm 
Started by Benjamin G. - Last post by Benjamin G.
Hi Reuben,

moving libcrypto and libssl out of /opt/fourjs/gst/lib solve the situation

Thanks

 34 
 on: May 03, 2025, 01:02:06 am 
Started by Benjamin G. - Last post by Reuben B.
Whenever someone says something like

Quote
fglrun on commande line (ssh) works fine

Same code running from studio with target GDC ok
Same code running from studio with target GBC ko with error

my immediate thought is environment, hence this article https://4js.com/ask-reuben/ig-218/

So add the line ...

Code
  1. RUN "env | sort > /tmp/yourname.env"

...as soon as possible after MAIN and compare the output from the 3 scenarios.

There is one thing with this error though, chances are it occurs before the MAIN because of presence of IMPORT security.  So use a small test program without that IMPORT security line.

What you will probably see is GSTDIR/lib being included in PATH / LD_LIBRARY_PATH, and some libcrypto / libssl libraries being picked up from there rather than FGLDIR/lib or the system equivalents.

i.e. you are hitting this issue https://4js.com/support/issue/?id=GST-19307

There is a workaround but as they have not publicised it in the Issue Description, contact your support contact on Monday and they should be able to give a workaround.

Reuben

 



 35 
 on: May 02, 2025, 06:54:40 pm 
Started by Benjamin G. - Last post by Benjamin G.
Hi,

I've UNSET LANG but still same situation ...
On commande line with or without LANG we don't have this error

Regards

 36 
 on: May 02, 2025, 04:40:04 pm 
Started by Benjamin G. - Last post by Leo S.
Hi Benjamin, check if LANG is set to something like "fr" and unset it if it's the case.
Regards , Leo

 37 
 on: May 02, 2025, 04:16:27 pm 
Started by Benjamin G. - Last post by Benjamin G.
Hello

On last version :

fglrun 5.01.02 rev-763f056
Genero virtual machine
Target l64xl228

This code :

IMPORT security
MAIN
 DEFINE s STRING = "dGVzdHRlc3Q="
 LET s = security.Base64.ToString(s)
 display s
END MAIN

fglrun on commande line (ssh) works fine

Same code running from studio with target GDC ok
Same code running from studio with target GBC ko with error
           
            FORMS statement error number -6221.
            C extension initialization failed with status -1.

Any idea ?

Thanks







 38 
 on: April 30, 2025, 04:08:25 pm 
Started by Benjamin G. - Last post by Benjamin G.
Sorry, my fault not have seen that "Declarative dialogs support parameters (SUBDIALOG)" starting at 5.00.03

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/fgl_whatsnew_500v.html

Thank you

 39 
 on: April 30, 2025, 12:07:58 pm 
Started by Benjamin G. - Last post by Sebastien F.
Hello Benjamin,

1) Still using de-supported FGL version 5.00 ? Please move to latest 5.01!

https://4js.com/download/products/?

2) Your t_donation type is a DYNAMIC ARRAY, which is implicitly passed by reference and does not need the INOUT keyword, reserved for RECORDs

https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_runtime_stack.html

Try with FGL 5.01 compiler, you will get a better error message:

comment.4gl:14:5:14:24:error:(-8432) An INOUT parameter requires a RECORD type.

Seb

 40 
 on: April 30, 2025, 11:24:53 am 
Started by Benjamin G. - Last post by Benjamin G.
Hi,

Why this code doesn't compile (tested version 4.01 and 5.02) ?
Thank you

fglcomp 5.00.02 rev-025d702c
Genero 4gl compiler
Target l64xl228

Four Js*
Licensed Materials - Property of Four Js
(c) Copyright Four Js 1995, 2024. All Rights Reserved.
* Trademark of Four Js Development Tools Europe Ltd
  in the United States and elsewhere
root@vmgenerodev03:/tmp VMGENERODEV03      $fglcomp --verbose d
[parsing d.4gl]
[parsing d cancelled: 1 errors]
The compilation was not successful.  Errors found: 1.
The file 'd.err' has been written.
root@vmgenerodev03:/tmp VMGENERODEV03      $cat d.err
PUBLIC TYPE t_donations DYNAMIC ARRAY OF RECORD
  p_date  DATE,
  p_amount MONEY,
  p_reason VARCHAR(250)
END RECORD

DIALOG donations(donations t_donations INOUT)
| A grammatical error has been found at 'donations' expecting: ')'.
| See error number -6609.
    INPUT ARRAY donations FROM donations.*
      AFTER FIELD p_amount
        IF donations[arr_curr()].p_amount<2.0 THEN
          ERROR "must be at least 2 dollar:-)"
          NEXT FIELD CURRENT
        END IF
      AFTER ROW
        IF arr_curr()<=arr_count() THEN
          DISPLAY "AFTER ROW donations:check row and save to database"
        END IF
    END INPUT
END DIALOG



Pages: 1 2 3 [4] 5 6 ... 10
Powered by SMF 1.1.21 | SMF © 2015, Simple Machines