comphtml does not find CPPCALL or VARIABLE in json files

Discussion to talk about software related topics only.
Post Reply
stephen starkie
Posts: 2
Joined: Fri Oct 09, 2020 4:00 am

comphtml does not find CPPCALL or VARIABLE in json files

Post by stephen starkie »

We have inherited some code (written for 2.8.5 I believe) that we have considerably restructured in 3.3. The code has html with javascript that loads json files to show in datatables. These json files have VARIABLES and CPPCALLs in them, but the do not get caught by the comphtml tool. The html also has VARIABLES and CPPCALLs which are. So; it seems that this probably worked at some point but not now. How can I make comphtml find these in json files as well;

Here is the output from comphtml;

omphtml ../html -ohtmldata.cpp
Reading files from ../html and compressing them into htmldata.cpp
Ignoring files and directories: CVS, cvs, .SVN, .svn, .git, .GIT, .nbaccess
MIME_file: /Applications/NetBurner/pcbin/MIME_magic.txt
Building MIME list..... Done
Processing /Reset.htm
New function DoAddIndexRefJSLink # 1
1279 bytes
Processing /favicon.ico 318 bytes
Processing /.DS_Store 6148 bytes
Processing /sharedHtml/resetTable.htm 347 bytes
Processing /sharedHtml/footer.htm 167 bytes
Processing /sharedHtml/menu.htm 468 bytes
Processing /css/steris.css 3566 bytes
Processing /images/folder.GIF 1035 bytes
Processing /images/sterislogo.png 6466 bytes
Processing /images/text.GIF 1013 bytes
Processing /images/arrows.png 1781 bytes
Processing /images/row_bkg.png 1036 bytes
Processing /images/header_bkg.png 1062 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_asc_disabled.png 148 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_both.png 201 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_desc_disabled.png 146 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_desc.png 158 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_asc.png 160 bytes
Processing /DataTables/datatables.min.js 82234 bytes
Processing /DataTables/datatables.min.css 14305 bytes
Processing /records.htm 3448 bytes
Processing /time.htm
New function writeSockLocalTime # 2

New function writeSockUTCTime # 3
2120 bytes
Processing /index.htm 2325 bytes
Processing /json/devDisc.json 4201 bytes
Processing /json/inc0.json 3616 bytes
Processing /json/security.json 1339 bytes
Processing /json/inc1.json 3616 bytes
Processing /json/post0.json 1119 bytes
Processing /json/time.json 4365 bytes
Processing /json/post1.json 1120 bytes
Processing /json/network.json 1504 bytes
Processing /json/about.json 1384 bytes
Processing /network.htm 1910 bytes
Processing /devDisc.htm 1891 bytes
Processing /security.htm
New Variable DisplayInstalledCertificate() # 1

New Variable DisplayCertificateFileStatus() # 2

New Variable DisplayKeyFileStatus() # 3
3569 bytes
Processing /scripts/jquery-3.2.1.min.js 86659 bytes
Processing /scripts/main.js 9492 bytes
Processing /about.htm 2407 bytes
Processing /robots.txt 27 bytes
Processing /licenses.txt 2230 bytes
Result counts = 295 total_ends :148
149863 bytes out of 216995 original encode out of 260380 total original
Processing /Reset.htm
Found function DoAddIndexRefJSLink # 1
1279 bytes
Processing /favicon.ico 318 bytes
Processing /.DS_Store 6148 bytes
Processing /sharedHtml/resetTable.htm 347 bytes
Processing /sharedHtml/footer.htm 167 bytes
Processing /sharedHtml/menu.htm 468 bytes
Processing /css/steris.css 3566 bytes
Processing /images/folder.GIF 1035 bytes
Processing /images/sterislogo.png 6466 bytes
Processing /images/text.GIF 1013 bytes
Processing /images/arrows.png 1781 bytes
Processing /images/row_bkg.png 1036 bytes
Processing /images/header_bkg.png 1062 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_asc_disabled.png 148 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_both.png 201 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_desc_disabled.png 146 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_desc.png 158 bytes
Processing /DataTables/DataTables-1.10.16/images/sort_asc.png 160 bytes
Processing /DataTables/datatables.min.js 82234 bytes
Processing /DataTables/datatables.min.css 14305 bytes
Processing /records.htm 3448 bytes
Processing /time.htm
Found function writeSockLocalTime # 2

Found function writeSockUTCTime # 3
2120 bytes
Processing /index.htm 2325 bytes
Processing /json/devDisc.json 4201 bytes
Processing /json/inc0.json 3616 bytes
Processing /json/security.json 1339 bytes
Processing /json/inc1.json 3616 bytes
Processing /json/post0.json 1119 bytes
Processing /json/time.json 4365 bytes
Processing /json/post1.json 1120 bytes
Processing /json/network.json 1504 bytes
Processing /json/about.json 1384 bytes
Processing /network.htm 1910 bytes
Processing /devDisc.htm 1891 bytes
Processing /security.htm
Found Variable DisplayInstalledCertificate() # 1

Found Variable DisplayCertificateFileStatus() # 2

Found Variable DisplayKeyFileStatus() # 3
3569 bytes
Processing /scripts/jquery-3.2.1.min.js 86659 bytes
Processing /scripts/main.js 9492 bytes
Processing /about.htm 2407 bytes
Processing /robots.txt 27 bytes
Processing /licenses.txt 2230 bytes

Thanks,

Stephen
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: comphtml does not find CPPCALL or VARIABLE in json files

Post by pbreed »

Is this from windows or a Mac?
I just ran this test and it worked for me... on windows...

One possible issue could be case sensitivity...

Is your json file
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: comphtml does not find CPPCALL or VARIABLE in json files

Post by pbreed »

Sorry hit return too soon...
a JSON file or a json file?
This is controlled by the comphtml settings in MIME_magic.txt
Also make sure you don't have older versions of comphtml.exe in your path...

the line in the MIME_magic.txt file should be:
.json 3 application/json

Lastly the VARIABLE and CPPCALL need to be in a full html comment for compcode to find it...
IE:
<!--CPPCALL Foo -->
stephen starkie
Posts: 2
Joined: Fri Oct 09, 2020 4:00 am

Re: comphtml does not find CPPCALL or VARIABLE in json files

Post by stephen starkie »

@pbreed - thanks very much; I am on a Mac - I tried it on a Windows VM and it worked - compared the MIME magic file - found the missing .json entry to my Mac installation - it now all works.

Thanks very much
User avatar
pbreed
Posts: 1080
Joined: Thu Apr 24, 2008 3:58 pm

Re: comphtml does not find CPPCALL or VARIABLE in json files

Post by pbreed »

Thanks for telling us what was wrong.
One of our engineers hunted down the installer error that was using the wrong mime_magic file on non-windows platforms.
Future releases will not have this error.

Paul
Post Reply