MrDalekVzla / google-refine

Automatically exported from code.google.com/p/google-refine
Other
0 stars 0 forks source link

Project custom metadata while importing #483

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
*****
If you don't know how to do something in Google Refine, please ask on the
mailing list. Also use the mailing list for discussions and comments.

http://groups.google.com/group/google-refine/

Only file an issue here if you discover a bug or want to request a new
feature.

Thank you.
*****

What version of Google Refine are you using?
I am using 2.5 

What operating system and browser are you using?
Ubuntu 10.04 Chrome 
Is this problem specific to the type of browser you're using or it happens
in all the browsers you tried?
it is general problem 

Please provide any additional information below.

Hi I am working on a new extension of Google refine my extension require extra 
interface before uploading the the csv file to the parsing phase and it is 
basically enter data in form then creating the project .
My problem that I want to save the data from the form and be able to access 
them after creating the project 
I managed to reach the project metadata object and saved the data in  
_customMetadata Map 

I guess there is a BUG in
File :  com.google.refine.ProjectMetadata
Line : 88

 if ("save".equals(options.getProperty("mode"))) {
            writer.key("password"); writer.value(_password);

            writer.key("encoding"); writer.value(_encoding);
            writer.key("encodingConfidence"); writer.value(_encodingConfidence);

            writer.key("customMetadata"); writer.object();
            for (String key : _customMetadata.keySet()) {
                Serializable value = _customMetadata.get(key);
                writer.key(key);
                writer.value(value);
            }

this means that the custom metadata is only serialized to json in the save mode 

but what if I want to reach this data before ?

Original issue reported on code.google.com by gofranshukair@gmail.com on 15 Nov 2011 at 6:47

GoogleCodeExporter commented 9 years ago
It sounds like you've got a specific change to propose, so please provide a 
patch which implements the change and explain why the current accessor 
getCustomMetadata(String key) isn't adequate for your needs.

Original comment by tfmorris on 15 Nov 2011 at 7:27

GoogleCodeExporter commented 9 years ago
My suggestion is not related to the getCustomMetadata(String key).
I propose just to remove the  line that add project custom metadata outside the 
if statement because that restrict saving custom metadata to the save mode only 

I attach the patch with the suggested changes 

Original comment by gofranshukair@gmail.com on 17 Nov 2011 at 12:41

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch.  The relevant piece has been committed in r2404.  If you 
submit patches in the future, please try to make sure they only include the 
relevant change (this one had changes to project settings).

Original comment by tfmorris on 9 Dec 2011 at 11:07

GoogleCodeExporter commented 9 years ago

Original comment by dfhu...@google.com on 11 Dec 2011 at 10:33

GoogleCodeExporter commented 9 years ago

Original comment by tfmorris on 12 Dec 2011 at 7:41