Hi,
our architecture is composed by redundant FieldServers (for PLC exchanging data), redundant DesktopServers (for managemnet of th panels) and WebServer (for management of the panel by WEB).
In our project we insert some PDF and .txt files for the client application and use getPath function for vizualize it; in local (by means Field and Desktop servers) this function works; we have problems in the client side (no PDF or .txt are vizualized).
We use Getpath folder using HELP directory with parametrs suggested by the WinCC OA help:
getPath(<keyword>, <filename>, <langId>)
How to solve this issue for the client side?
We need to use "autoUpdateDir" (otherwise in wich config files shall be included) or getPath function is enough in our case?
Let me know.
Thanks in advance.
getPath function in Web client
- kilianvp
- Posts:443
- Joined: Fri Jan 16, 2015 10:29 am
Re: getPath function in Web client
What Client do you use? Desktop UI? or ULC UX?
- orla090978
- Posts:55
- Joined: Thu Jan 03, 2019 2:05 pm
Re: getPath function in Web client
Thanks for reply.
Desktop UI connected to a redundant WebServerUI.
Regards.
Desktop UI connected to a redundant WebServerUI.
Regards.
- kilianvp
- Posts:443
- Joined: Fri Jan 16, 2015 10:29 am
Re: getPath function in Web client
yes you should use autoUpdateDir you can put it in config.level or config.
- gschijndel
- Posts:376
- Joined: Tue Jan 15, 2019 3:12 pm
Re: getPath function in Web client
Using the 'getPath' function should be enough to download the file to the client and be able to visual it. But storing the file in the '.wincc_oa-cache' directory is not necessary by using the https protocol and the right url.
For 'getPath' to work the file under the directories 'help' & 'msg' must be stored in a language-dependent subdirectory. The file does not have to exist in all project language subdirectory, since there is language fallback mechanism which also searches for the file in other languages if the file has not been found in the specified/active language. This is described in the documentation under: Multilangual projects -> Installation -> File search and language-fallback-mechanism
For 'getPath' to work the file under the directories 'help' & 'msg' must be stored in a language-dependent subdirectory. The file does not have to exist in all project language subdirectory, since there is language fallback mechanism which also searches for the file in other languages if the file has not been found in the specified/active language. This is described in the documentation under: Multilangual projects -> Installation -> File search and language-fallback-mechanism
- orla090978
- Posts:55
- Joined: Thu Jan 03, 2019 2:05 pm
Re: getPath function in Web client
Thanks for reply,
our script for PDF opening in our PDF EWO is the following:
int enIdx, gerIdx;
enIdx=getLangIdx("en_US.utf8");
gerIdx=getLangIdx("de_CH.utf8");
string path;
if(getActiveLang(enIdx))
path = getPath(HELP_REL_PATH)+"/maintenanceTabs/SEW_FC_MOVIFIT_TYPE_000_EN.pdf";
else
path = getPath(HELP_REL_PATH)+"/maintenanceTabs/SEW_FC_MOVIFIT_TYPE_000_DE.pdf";
this.load(path);
PDF file is stored in the HELP folder in the "language-dependent subdirectory" (EN and DE).
Is this correct? Because locally works (in the server) but in the client our PDF.ewo is not loaded.
Best regards.
our script for PDF opening in our PDF EWO is the following:
int enIdx, gerIdx;
enIdx=getLangIdx("en_US.utf8");
gerIdx=getLangIdx("de_CH.utf8");
string path;
if(getActiveLang(enIdx))
path = getPath(HELP_REL_PATH)+"/maintenanceTabs/SEW_FC_MOVIFIT_TYPE_000_EN.pdf";
else
path = getPath(HELP_REL_PATH)+"/maintenanceTabs/SEW_FC_MOVIFIT_TYPE_000_DE.pdf";
this.load(path);
PDF file is stored in the HELP folder in the "language-dependent subdirectory" (EN and DE).
Is this correct? Because locally works (in the server) but in the client our PDF.ewo is not loaded.
Best regards.
- kilianvp
- Posts:443
- Joined: Fri Jan 16, 2015 10:29 am
Re: getPath function in Web client
you added "autoUpdateDir = help/" to your config?
- orla090978
- Posts:55
- Joined: Thu Jan 03, 2019 2:05 pm
Re: getPath function in Web client
Hi Kilianvp,
no because HELP subdirectory seems not included:
Defines a relative directory name below the project path which will be used to download all files and subdirs (recursively) on startup when communicating via the HTTP server. This entry can be specified multiple times. The following sub directories can be used:
/pictures
/panels
/images
/colorDB
/xml
/nls
/bin
/data
/scripts/libs
Note
If other sub directories are specified, the HTTP server answers with "not found"
Above is correct?
Thanks for your support.
no because HELP subdirectory seems not included:
Defines a relative directory name below the project path which will be used to download all files and subdirs (recursively) on startup when communicating via the HTTP server. This entry can be specified multiple times. The following sub directories can be used:
/pictures
/panels
/images
/colorDB
/xml
/nls
/bin
/data
/scripts/libs
Note
If other sub directories are specified, the HTTP server answers with "not found"
Above is correct?
Thanks for your support.
- gschijndel
- Posts:376
- Joined: Tue Jan 15, 2019 3:12 pm
Re: getPath function in Web client
Save the files as:
help/en_US.utf8/maintenanceTabs/SEW_FC_MOVIFIT_TYPE_000.pdf
help/de_CH.utf8/maintenanceTabs/SEW_FC_MOVIFIT_TYPE_000.pdf
And try it with this code (this should download the file to the client):
In case you do not want to rename the files I would write the if statement as (since the 'getActiveLang' function does not take arguments):
help/en_US.utf8/maintenanceTabs/SEW_FC_MOVIFIT_TYPE_000.pdf
help/de_CH.utf8/maintenanceTabs/SEW_FC_MOVIFIT_TYPE_000.pdf
And try it with this code (this should download the file to the client):
Code: Select all
path = getPath(HELP_REL_PATH,"maintenanceTabs/SEW_FC_MOVIFIT_TYPE_000.pdf");Code: Select all
if (getLangIdx("en_US.utf8") == getActiveLang())- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: getPath function in Web client
You should use the config entry autoUpdateDir only for those directories which are really needed.
If you use this entry for a lot of directories with possibly a lot of files the startup will take longer as more files need to be copied from the server to the client.
Best Regards
Leopold Knipp
Senior Support Specialist
If you use this entry for a lot of directories with possibly a lot of files the startup will take longer as more files need to be copied from the server to the client.
Best Regards
Leopold Knipp
Senior Support Specialist