Add Data Widget Required ".prj" file and missing file message in Portuguese language of Brazil

714
4
Jump to solution
04-25-2018 07:00 AM
Labels (1)
GilbertoMatos
Occasional Contributor II

Hello!

I need to customize the "Add Data widget" so that the ".prj" file is required, in addition to ".dbf", ".shp" and ".shx". The widget already displays a message when one of these last three files is missing from the ".zip" file. I can not find where I can make this customization, so I can not display the message to the user in the Portuguese language of Brazil instead of English.

Thanks for any help.
Gilberto.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Gilberto,

  You will not be able to add that requirement as what sets the requirements and returns the errors is your Portals sharing/rest/content/features web service.

View solution in original post

4 Replies
GilbertoMatos
Occasional Contributor II

Hello

Momentarily, the solution I found to translate the missing file error message into English was to use a replace, as I did not find this information in any language file in the application. Below is the code changed in the file "widgets \ AddData \ search \ AddFromFilePane.js", at line 410, as follows:

message: error.message.replace("Invalid Shapefile", "Não será possível importar o shapefile").replace("missing dbf file", "arquivo dbf ausente ou inválido").replace("missing shp file", "arquivo shp ausente ou inválido").replace("missing shx file", "arquivo shx ausente ou inválido")  //error.message

I'm still trying to figure out how to force verification of the existence of the ".prj" file inside the ".zip" file. If anyone can help, I appreciate it.
Gilberto.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Gilberto,

  You will not be able to add that requirement as what sets the requirements and returns the errors is your Portals sharing/rest/content/features web service.

RobertScheitlin__GISP
MVP Emeritus

You can limit the file types that the add data widget allows (as you were asking about in the other thread) though.

In the widgets\AddData\search\AddFromFilePane.js just remove the unwanted type from the SHAPETYPE_ICONS object.

GilbertoMatos
Occasional Contributor II

Hello Robert!

Thanks for your return. Actually I was debugging, and I realized that I can not even include ".prj" as required, because in the code I saw the share service that performs this task.

As for limiting the types of files to import, I'd already done that, just like you mentioned. Thanks a lot for the help.

Hug,
Gilberto.

0 Kudos