Hallo.
I´m developing a ZIP function for GN. I´ve implemented a funcionality to the
Upload.class that puts files with the same basename (test.shp, test.dbf and
so on) to one zip archive and leaves the unzipped files for geoserver in the
same directory as a reference.
Until now you have to pick up the files step by step and upload them. It
would be great if I could pass through the absolute path from the Javascript
function "doFileUploadAction" in the metadata.edit.xls to the Upload.class.
Then a user could pick up his *. shp-file and GN would directly zip all
necessary files like the sbx, sbn, prj, dbf. This files always have the same
basename.
The parameter fname contains the information about the absolute path so i
could zip all files from the directory that have the base name the user
selected for the upload.
But only the filename remains after:
function doFileUploadAction in the metadata-edit.xls
if (fname.indexOf('/') > -1)
fname = fname.substring(fname.lastIndexOf('/') + 1, fname.length);
else
fname = fname.substring(fname.lastIndexOf('\\') + 1, fname.length);
1. I add a new parameter fullpath=fname; before the if clause to the
"doFileUploadAction" function to get the absolute path
2. Added public static final String FULLPATH = "fullpath"; to
org.fao.geonet.constants.Params.class
3. Tried to System.out.println(fullpath) in the Upload.class
This is the error i get after compiling and trying to upload:
2008-02-29 17:49:33,484 ERROR [jeeves.service] - Exception when executing
servic
e
2008-02-29 17:49:33,484 ERROR [jeeves.service] - (C) Exc :
MissingParameterEx :
fullpath
2008-02-29 17:49:33,484 DEBUG [jeeves.service] - Raised exception while
executin
g service
<error id="missing-parameter">
<message>fullpath</message>
<class>MissingParameterEx</class>
<stack>
<at class="jeeves.utils.Util" file="Util.java" line="69"
method="getParam" /
Can anyone give a hint how to pass through this parameter.
best regards
Roger
--
View this message in context: http://www.nabble.com/ZIP-Function-tp15764214s18419p15764214.html
Sent from the geonetwork-devel mailing list archive at Nabble.com.