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: Today at 03:49:23 pm 
Started by Huy H. - Last post by Huy H.
Very interesting!  Thanks for the info John and Reuben.

 2 
 on: Today at 03:04:22 pm 
Started by Christine R. - Last post by Christine R.
[ANNOUNCE] Genero Enterprise 3.20 - GBC and GDC Maintenance Release


 Genero Enterprise 3.20 - GBC 1.00.58 and GDC 3.20.15
 Maintenance Release


Four Js is pleased to announce a Maintenance Release of Genero Browser Client 1.00.58 and Genero Desktop Client 3.20.15.

These versions include the following fixes :

These versions are now downloadable from the website : http://www.4js.com/download/products/.

Note : All Four Js Genero customers under maintenance have free access to the new release.

Best regards,

Four Js Development Tools

 3 
 on: Today at 02:54:15 am 
Started by Huy H. - Last post by Reuben B.
To answer Huys question
Quote
John, I'm not sure what you mean when you mention a "delegate program" for a web service, can you elaborate more.
I would go up 1 level with the links from Johns answer to https://4js.com/online_documentation/fjs-gas-manual-html/#gas-topics/c_gas_how_to_implement_delegation.html and you can read through the various pages which include Johns 2 links.

Reuben

 4 
 on: Today at 02:41:51 am 
Started by Huy H. - Last post by John T.
Hi Huy,

We used delegation for security and checking other bits and pieces.  This basically just involves adding the DELEGATE tag to the EXECUTION element of your .xcf file.
The delegate program is then called first.  In the delegate you can access the HttpServiceRequest as you can with the lower level framework.  Then you can set headers which you get access to via the context dictionary in your high level service (as in my sample below).   We are also using WSScope so we set the users scope in the delegate as these are stored in our database, i.e call req.setResponseHeader("X-FourJs-Environment-Scopes", scope).

Here is the link to a .xcf file with a DELEGATE tag:
https://4js.com/online_documentation/fjs-gas-manual-html/#gas-topics/c_gas_delegate_configuration.html

And here is a link to Fourjs sample delegate program:
https://4js.com/online_documentation/fjs-gas-manual-html/#gas-topics/c_gas_delegate_example.html

John











 5 
 on: September 23, 2020, 11:01:02 pm 
Started by Huy H. - Last post by Huy H.
I saw the same "blank-key" in the context dictionary when I did my testing.  I suspect it's related to the bug Sisavanh is referring to.

John, I'm not sure what you mean when you mention a "delegate program" for a web service, can you elaborate more. 

Thus far, when we implement REST using the "low-level" framework in Genero 3.20, the call to obtain the com.HttpServiceRequest via com.WebServiceEngine.getHTTPServiceRequest(-1) is available for us.  But it looks like when we're using the high-level framework design, calling com.WebServiceEngine.getHTTPServiceRequest(-1) within our module that has been registered to handle the REST request is a little too late.  When we do that, it just waits indefinitely until the next web service hits.

 6 
 on: September 23, 2020, 08:25:57 am 
Started by Huy H. - Last post by John T.
Hi,

If you are using a delegate program with your web service, which I assume you are, you can get access to the service request (com.HttpServiceRequest) and therefore all the headers.

Then you can also set headers with com.HttpServiceRequest.setResponseHeader() in the delegate program.  If you prefix the header you are setting with X-FourJs-Environment- then you can access the header via the context dictionary from your web service function.

So in the delegate program:
call req.setResponseHeader("X-FourJs-Environment-X-VTM-client-token", req.getRequestHeader("X-VTM-client-token" ))

and then in the service function:
let client_token = context["X-VTM-client-token"]

Per the response from Sisa it sounds like all the headers are meant to be in the context dictionary.  That would have been easier, but as we are using a delegate it is not too much trouble.

Just doing a bit of checking on this I notice that one of the headers I set also comes through to the dictionary without a key name.  Strange.  So I am seeing both:
    X-jjttest = this is jjttest       (as in the key and data)
and
     = this is jjttest     (so no name for the key)

Maybe all part of the same bug.


John



 7 
 on: September 21, 2020, 04:11:12 pm 
Started by Paul M. - Last post by Paul M.
Hi Alex,

Thanks for the lesson on PXML, I didnt know any of that . There should be a tutorial section on the web site with this kind of information explained( or have I not looked hard enough :-) )

I guess I am using the json to keep things simple when I read the data back in from the scanned image. It might be easier to send it out as a delimited string.

I get what you are saying by using aCounter as I can increment every time I do an output to report and use that to order the scanned pages. I am printing the record pr_header  just once in the FIRST PAGE HEADER section and also creating the QR code in the same section in the design then using x and y to position at the top of each page. I didnt think I could access any variables outside the first page header section.



Thanks.

 8 
 on: September 21, 2020, 03:23:56 pm 
Started by Paul M. - Last post by Alex G.
Hi Paul,

the parse error is caused by the double quotes in the JSON value (not the curly braces).

The parsing works as follows: A PXML-RTL expression is evaluated firstly by the RTL evaluator by searching the PXML-RTL expression for substrings of the pattern {expr} and replacing these by their evaluation result. The result of this substitution is then evaluated in a second pass by the PXML evaluator.
Examples:

Example 1 (a numeric property):
PXML-RTL-expression: 1+{2+3}*4+{5*6}+9
Expression after RTL evaluation: 1+5*4+30+9
Expression after PXML evaluation: 60

Example 2 (a string property, the variable aVariable is set to "foo"):
PXML-RTL-expression: "{aVariable}"+" "+format(4,ARABIC)
Expression after RTL evaluation: "foo"+" "+format(4,ARABIC)
Expression after PXML evaluation: "foo 4"

Example 3 (a string property, the variable aVariable is set to ""foo""):
PXML-RTL-expression: "{aVariable}"+" "+format(4,ARABIC)
Expression after RTL evaluation: ""foo""+" "+format(4,ARABIC)
Expression after PXML evaluation: ERROR because ""f is not a valid start of a PXML-expression

Example 4 (a string property, the variable aVariable is set to "\042foo\042" (\042 is the octal escape for a double quote)):
PXML-RTL-expression: "{aVariable}"+" "+format(4,ARABIC)
Expression after RTL evaluation: "\042foo\042"+" "+format(4,ARABIC)
Expression after PXML evaluation: ""foo" 4"

Example 5 (a string property, the variable aVariable is set to ""foo""):
PXML-RTL-expression: "{aVariable.replaceAll(34.toChar(),"\\042")}"+" "+format(4,ARABIC)
Expression after RTL evaluation: "\042foo\042"+" "+format(4,ARABIC)
Expression after PXML evaluation: ""foo" 4"

So the fix for your problem is to replace any double quotes in the variable by an octal escape.
This you can do by using the RTL replaceAll() method so that your expression would look as follows: "{pr_header.qr_code.replaceAll(34.toChar),"\\042")}"+format(getTotalNumberOfPhysicalPages(),ARABIC)

Your worries regarding the usage of a PXML total page number function like getTotalNumberOfPhysicalPages() are unfounded.
Issues like the need to delay printing until the total number of pages is known, is taken care of. Likewise the bar code images are updated in the preview window as soon as the total number of pages is known.

I am asking myself however if doing it this way isn't overcomplicating things a little.
The mechanism, for what we call the "Page n of m" problem in conjunction with bar codes, is designed to drive an enveloping machine so handle a batch print of documents with variable page length.

If I understand you correctly, then you are not actually interested in actual page numbers but you "just" need a number to bring images into an order.
If this is the case, why don't you simply define a variable in the report that is incremented with each print of the variable pr_header.qr_code like this:

LET aCounter=aCounter+1
PRINT pr_header.*, aCounter
 
.. and then use the literal code value property with this expression like this: codeValue="{{pr_header.qr_code+";"+aCounter}}"

Then things are straightforward you also don't need to quote the JSON.
 

 9 
 on: September 21, 2020, 12:25:53 pm 
Started by Paul M. - Last post by Paul M.
Hi Alex,

Thanks for taking the time to look at this.

I have tried the codeValueExpression and get the error attached.

What we want to do is the following:

- User prints delivery dockets
- Dockets given to delivery driver
- On delivery customer signs docket
- Driver returns docket to office
- Office scans the signed dockets
- Associate scanned images to transactions on database for future viewing.

I would like to put a small json string in a qr code that a small python script can then read from the scanned image  giving enough information to associate to a specific transaction in the database.

We have got this to work but we would also like to include the page number in the qr code so that the scanned images could be shown in the correct order. In an ideal world we would also love to include the total number of pages per delivery docket so that the system knows that there are no missing pages but I guess that may not be possible as that is only known at the end of the print.

Text being encoded :  {"doc_type":"BTL","depot_code":"E01","trans_no":494}

Is the {} in the json string causing the error?





 10 
 on: September 21, 2020, 11:41:05 am 
Started by Huy H. - Last post by Sisavanh S.
Hi,

Indeed there is an issue, you should be able to use WSContext to retrieve the headers.
I've filed bug:
GWS-973: WSContext does not retrieve all the headers

Thanks for reporting.
Best regards,
Sisa.

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