Subscribe for automatic updates: RSS icon RSS

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

Pages: [1] 2 3 ... 10
 1 
 on: December 04, 2019, 12:31:30 pm 
Started by Gary C. - Last post by Gary C.
Hello

It has literally just happened again.

I have looked in the fastcgidispatch log file but this gave no insight into the cause. Are there other logs I can look at? There are many, many proxy and dvm logs.

For reference, to restore services I am require to restart Apache and then start fastcgidispatch in standalone mode.

Gary

 2 
 on: December 03, 2019, 10:56:28 pm 
Started by Snorri B. - Last post by Snorri B.
Thanks Reuben.

Quote
That point with datetime reminded me of the options we have with XML Serializer http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/r_gws_XmlSerializer_option_flags.html.   It maybe that what you want is a similar option with JSON serialization ie use DBDATE or ISO-8601 with JSON serialization

I think this is a great idea. Then you could toggle the behavior depending on what you are trying to achieve. Can you create a feature request? :)

BTW: I did not play with DBFORMAT, but js.get("integer_field") actually added ".0" at the the end. So with this JSON record:

{"i":123,"c":"Some data","d":789190.02}

DISPLAY js.get("i")

will display "123.0"

Best regards,
-Snorri

 

 3 
 on: December 03, 2019, 10:05:37 pm 
Started by Snorri B. - Last post by Reuben B.
Snorri,

In researching I came across this thread https://stackoverflow.com/questions/10286204/the-right-json-date-format which includes the answer because XKCD says so https://xkcd.com/1179/ :-)

By using ISO-8601 we should be good with using JSON to pass arguments to WebComponents

Quote
As "DATE" is not a known JSON datatype, I have no way of knowing if the STRING I get using the .get() method is a DATE or not.
therein lies the problem, we don't know either

Quote
This works fine with all numeric and string  datatypes but I guess I will need to apply some conversions to boolean and datetime as well :(

Boolean is a JSON data-type so shouldn't be a problem.  Datetime I'd expect us to use ISO-8601 as well but a quick check I don't see any T or Z in our output.  I am not 100% sure on the standard if Z,T mandatory or optional but I can imagine if we output "2019-12-04T09:00:00Z" instead of "2019-12-04 09:00:00" then that would cause a similar issue to what you are encountering with DATE, but for now (fortunately as it maybe we don't put T or Z into the datetime string) seems to be ok.  Also interestingly with numbers being a JSON data-type, I experimented with DBFORMAT and that does handle case of being able to assign appropriately (I tried with DBFORMAT using , as decimal point)

That point with datetime reminded me of the options we have with XML Serializer http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/r_gws_XmlSerializer_option_flags.html.   It maybe that what you want is a similar option with JSON serialization ie use DBDATE or ISO-8601 with JSON serialization

Finally I also want to make sure that it is understood that with

LET date_variable = js.get("date_element")

js.get is returning a string in that instance.  So you have

LET date_variable = string

and the normal string to date conversion is taking place.  And as you discover the date in ISO-8601 format is not converted.

With util.JSONObject.toFGL as in

CALL js.toFGL(r)

http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_ext_util_JSONObject_toFGL.html

that is effectively passing the data-type across and so has that information so as to parse the information.

Reuben
 



 4 
 on: December 03, 2019, 09:17:08 pm 
Started by Gary C. - Last post by Reuben B.
Have you looked in our logs?

 5 
 on: December 03, 2019, 12:43:28 pm 
Started by Gary C. - Last post by Gary C.
Hi

Just wondering if any other user has had similar experiences they can share. We run Apache and GAS on the same server and use fastcgidispatch. The server does not appear to be stressed. On two occasions over the past week we have had a situation were all sessions have been terminated.

On looking, I can see that the fastcgidispatch -s process is not running, but restarting it does not seem to solve the problem. I have to date restarted the server and the services to restore normal operations.

Looking in the apache error log I can see the following entries:

Code
  1. [Mon Dec 02 09:40:41.036717 2019] [proxy:error] [pid 1608:tid 140488589903616] AH00940: FCGI: disabled connection for (localhost)
  2. [Mon Dec 02 09:40:43.043685 2019] [proxy:error] [pid 1608:tid 140488823146240] AH00940: FCGI: disabled connection for (localhost)
  3. [Mon Dec 02 09:40:45.058024 2019] [proxy:error] [pid 1608:tid 140488573118208] AH00940: FCGI: disabled connection for (localhost)
  4. [Mon Dec 02 09:40:47.064385 2019] [proxy:error] [pid 1609:tid 140488707401472] AH00940: FCGI: disabled connection for (localhost)
  5.  

Many thanks
Gary

 6 
 on: December 02, 2019, 11:31:11 pm 
Started by Snorri B. - Last post by Snorri B.
Hi Rene and thanks.

My problem with this is the fact that I was trying to use the JSONObject as a way to pass data to and from "generic" functions. As "DATE" is not a known JSON datatype, I have no way of knowing if the STRING I get using the .get() method is a DATE or not.  So in my "generic" routine this will fail:

Code
  1. call mydialog.setFieldValue("datefield", js.get("datefield"))

It will silently assign null to "datefield".

This works fine with all numeric and string  datatypes but I guess I will need to apply some conversions to boolean and datetime as well :(

I have a workaround where I use base.typeinfo.create() rather than util.JSONObject.fromFGL() and then I store the datatypes in a different structure. Then I covert the DATEs to ISO format before putting them back into the JSONObject structure (so the calling program can use .toFGL()). I could also probably get the datatype from the form, but all this is a lot of hassle.

Best regards,
-Snorri

 7 
 on: December 02, 2019, 09:39:50 pm 
Started by Snorri B. - Last post by Rene S.
Hello Snorri,
your using the phrase "hard-wired format". I would argue differently: any util.JSON* method converting date to string (or vice versa) assumes dates are formatted according to the ISO 8601 date format. This fit's the real live.

Try this:
Code
  1. LET date_variable = util.Date.parse(js.get("date_element"), "YYYY-MM-DD")


We should eventually add specialized get methods,
Code
  1. LET date_variable = js.getDate("date_element")

Rene



 8 
 on: December 02, 2019, 09:37:06 pm 
Started by Snorri B. - Last post by Rene S.
Hello Snorri,
your using the phrase "hard-wired format". I would argue differently: any util.JSON* method converting date to string (or vice versa) assumes dates are formatted according to the ISO 8601 date format. This fit's the real live.

Try this:
{code}
    LET date_variable = util.Date.parse(js.get("date_element"), "YYYY-MM-DD")
{code}

We should eventually add specialized get methods,
{code}
    LET date_variable = js.getDate("date_element")
{code}

Rene



 9 
 on: November 28, 2019, 02:09:15 pm 
Started by Snorri B. - Last post by Snorri B.
Hello everyone.

I've already raised this issue with support and they say it's the expected behavior. I'd like to hear what the community has to say :)

When using the method util.JSONObject.fromFGL(rec) all DATE fields in rec (if any) are converted to the format "YYYY-MM-DD" regardless of the setting in DBDATE. This is also mentioned in the documentation. Consider this code:
Code
  1. IMPORT util
  2. MAIN
  3. DEFINE js util.JSONObject
  4. DEFINE r record
  5. date_element DATE
  6. END RECORD
  7. DEFINE date_variable DATE
  8. LET r.date_element  = TODAY
  9. DISPLAY "r.date_element=",r.date_element
  10. LET js = util.JSONObject.fromFGL(r)
  11. DISPLAY "JSON 2 string:", js.toString()
  12. LET date_variable = js.get("date_element")
  13. DISPLAY "date_variable=",date_variable
  14. DISPLAY "JSON type=",js.getType("date_element")
  15. END MAIN
  16.  

Displays:

r.date_element=28.11.2019
JSON 2 string:{"date_element":"2019-11-28"}
date_variable=     
JSON type=STRING

The simple .get() method returns the date_element as a string and  NULL is assigned to the date_variable, because the date is incorrect according to DBDATE setting.

As JSON itself knows nothing about dates the question arises: Why does FGL enforce DATE in JSON to be at a specific, hard-wired format rather than just DBDATE?

Best regards,
-Snorri

 10 
 on: November 27, 2019, 04:28:11 pm 
Started by Leigh P. - Last post by Olivier E.
Hello Leigh,

Windows docker, we have no documentation yet.
But it sounds possible.

Olivier Eckert - Four Js Support

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