Re: Blank values
Sharing HTML blocks across pages - one best way?
Starting to move a wConnect site from HTML-in-prg style to scripting style (.ExpandTemplate() and/or .ExpandScript() and/or template script-mapped extension).
Purpose: easily share existing HTML with a design agency, and easily integrate new HTML
Wondering how to share HTML code blocks across pages
eg, considering this block of HTML stored in head.htm
<!DOCTYPE html><htmllang="fr"><head><title><%=variable%></title> ....</head>
1/ how to make sure all pages in site include this block?
SSI directives are very handy because supported by all web servers
a typical SSI directive is:
<!--#include virtual=head.htm -->>
Does wConnect support SSI directive?
2/ what is the best practice to make sure 'variable' is available when page is generated?
- use a 'private' variable (.ExpandTemplate() and/or .ExpandScript())
- move all code generating variable into a code block inside head.htm?
Also looking for wConnect user feedback/advice/tricks ...
Thanks,
Re: Email not being sent
Re: Sharing HTML blocks across pages - one best way?
Import a plain file without:
<%= FILETOSTR(Config.cHtmlPagePath + "LeftSideBar.wws") %>
Import and run as a Template (ie. expand <%= %> expressions)
<%= MergeTextFromFile( Config.cHtmlPagePath + "LeftSideBar.wws" ) %>
Cache included text:
<%= CacheFile( Config.cHtmlPagePath + "Header.wws",0 ) %>
Cache and merge:
<%= CacheFile( MergeTextFromFile( Config.cHtmlPagePath + "LeftSideBar.wws" ),0 ) %>
+++ Rick ---
Re: GetMultiPartFile not saving to disk
Hmmm... I'm not sure why SYSTEM would not be able to access a folder on the local machine. SYSTEM has global Full Rights unless permissions have been explicitly changed.
Check folder permissions in the folder you're trying to write to and make sure SYSTEM is the rights.
Also check and make sure that there's no interference from Anti-Virus software. It might quarantine writes from SYSTEM in certain locations on disk. Turn it off and try the write operations again to see if that works...
+++ Rick ---
Re: Sharing HTML blocks across pages - one best way?
thanks for all these solutions
actually I'm looking for a mechanism that the design agency can support
I plan to have:
site root folder -- head-htm -- body-beg.htm -- header.htm -- ... -- body-end.htm
a typical page.htm will be:
<!--#include virtual=head-htm -->><!--#include virtual=body-beg.htm -->><!--#include virtual=header.htm -->><!--#include virtual=body-end.htm -->>
the designer will see the full page thru a simple
http://localhost/page.htm
we'll implement SSI <!--#include --> directive support somewhere in the wc framework and share whenever someone finds it useful
-- thn (FoxInCloud)
Replacing null in JSON
How can I replace the entry in the JSON result before it is sent back to the view?
with"parent":null
in the JSON?"parent":"#"
The column "parent"
[System.ComponentModel.DefaultValue("#")]publicint? parent { get; set; }
The JSON
[{"id":2,"text":"PROG","parent":null},{"id":3,"text":"STAGE ONE","parent":2},{"id":4,"text":"INFRA","parent":2},{"id":5,"text":"SYSTEM","parent":3},{"id":6,"text":"STOCK","parent":3},{"id":7,"text":"DPT","parent":3},{"id":8,"text":"SUPPLIES","parent":2}]
Thanks for your help
Replacing null in JSON
You can't assign a default value of a string to an int or int? value so this will silently fail.
The only way you can do this is to build custom JSON.NET converter that handles the object and specific value explicitly. Not a trivial thing to do.
One thing you can also do is use LINQ or an Anonymous object to project to a new anonymous type to export:
var obj = <yourobject>;returnnew { name = obj.name, company = obj.company, parent = obj.parent == null ? "#" : obj.parent.Value.ToString() };
Essentially what you're doing is exporting your data model and what this does is expose a view model to what's required on the client.
+++ Rick ---
Re: Blank values
Unfortunately without a little more info on the scenario how this happens
I asked before, but are you running the latest? The pre-release for 2.0 has a few additional safe-guards against race conditions on very busy site start ups. Even so we have tests that check for this scenario and we've not been able to duplicate any failures to get no resources - unless the load operations against the db fail outright...
What provider are you using?
Can you please log an issue on GitHub:
https://github.com/RickStrahl/Westwind.Globalization/issues
Any additional info would be useful. You haven't given any info on your runtime environment at this time...
+++ Rick ---
FIC online store option
Shareware Message.
I just installed a purchased version of the Web Service Proxy Generator. I made the installation on top of the demo version as email instructions.
Now, when i run the application it still showing the shareware message.
I did a 2nd trial removing the Web Service Proxy Generator, installing it again and i still getting the message.
I'm in a rush because i have to install one application that uses the WSPG in one of my customers.
Please let me know what can i do.
Thanks.
Rafael.
Re: Shareware Message.
Are you sure you downloaded the fully registered version from the email link that was sent to you?
I just downloaded and installed the full version from the download link and it works just fine with no shareware messages.
If the generator doesn't display the shareware message then you got the right version. In addition make sure you explicitly recompile all of your code - delete all fxp files and recompile all vcx files. You may have newer fxp files that would not automatically update if you just copy the files in.
+++ Rick ---
Re: FIC online store option
Thanks for your interest in FoxInCloud!
Due to the third-party license checks required, the FoxInCloud license ordering process remains - for now - pretty manual.
We'll send you an private email soon.
-- thn (FoxInCloud)
Session
FUNCTION OnProcessInit
THIS.InitSession("KJDevSession")
I can SET the session variables but when I try to GET them I am getting 'Unknown Member Session' or 'Unknown Member oSession' and the Process.oSession object is null.
I am SETting them in the Process class, and trying to get them in the wcsx prg file - is that what is going wrong for me?
Michael
www.WebConnectionHosting.com
Soap problmes
Our Payment Portal Provider has changed some things and it has completely stopped working.
The line of code in the program that is that is crashing that is part of the soap program that you provided is
**************************************************
THIS.oWSDLMethod = loSD.GetMethod(lcMethod) - ERROR 1924 LOSD is NOT and Object
**************************************************
After 2 days we got the message from them...
a security update has been implemented for our Web Services users that eliminates the ability to access EPS Web Service endpoints in a browser.
You will need to point the system that you use to create transactions to the WSDLs that are attached.
I have reviewed the code samples that they sent me and the only real difference is the header.
They send
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://ssl.selectpayment.com/PV" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" targetNamespace="https://ssl.selectpayment.com/PV" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
I am currently using
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
If I change the code in 'FUNCTION CreateSoapRequestXML'
Will this solve the problem ???
Edward K. Marois
Realty Information Systems
Re: Soap problmes
I don't think so. I don't think wwSoap cares about a bigger header with additional namespace defines in it. It's how the namespaces are applied to the XML document that matters. It looks to me that they're adding a bunch of SOAP feature namespaces and if those are used the service is going to break for sure.
IAC, you're kind of on your own with this. wwSoap has been deprecated about 6 years ago and replaced with the more resilient technology in the West Wind Web Service Proxy Generator. Part of the reason for this change was that the SOAP parsing features were offloaded to a system component rather than a Fox component that manually has to configure each little document feature and keep up with various SOAP spec changes and all the insane differences in SOAP behavior for different SOAP server implementations.
The newer tooling automates generation of the proxy and can much more easily keep up with changes simply by regenerating the proxies in a few steps. Anyway something to think about if you need to maintain this service for a long while.
That's not to say wwSoap won't work, but it requires a lot more manual tweaking to get any non-standard features to work with wwSoap. I haven't looked at wwSoap code in years...
+++ Rick ---
Re: Session
That should work. InitSession() should initialize the Session object and it should be in scope anytime there after.
However, if you're using wcsx extension - that's not mapped through your process class. So I'm guessing that your InitSession() is never actually called. There's a separate process class that handles .wcsx generically. Either remap that (in appmain::Process) to point at your process class or else your configured scriptmap (.kjd ?).
There are ways around this. you can set the EnableSession property to .T. on the page (in the property definitions) but that will use default session names, so this is still not what you want.
Best thing to do is use custom extensions that are mapped to your process class.
+++ Rick ---
Collapse TR
I have a menu page with a Table. In the Table every TR/TD contains links to web pages.
When a user connects to the application, its rights make links visible or not.
However, when a link is not visible I see still the TR/TD empty space.
Please, is there any way to collapse TR and TD programmatically?
I tried to assign ID to TR and TD and to force Style="Visibility: collapse" but it does not work.
Many thanks
Re: Session
Michael
www.WebConnectionHosting.com
Re: Collapse TR
display:none in css.
+++ Rick ---