GNOME Bugzilla – Bug 675274
Allow changing the title and author
Last modified: 2021-07-05 11:30:43 UTC
Hi. I have a suggestion to improve the current functionality of this application. I think could be very useful to provide a easy way to change metadata of a file. It's very common that many people don't change the defaults propieties of a working file. So when you open it from Gnome-documents you get the file name and the default author. Other case is for pdf. I usually download many pdf but their metadata is not correct or not appropriately written so I cannot find them using gnome-documents. I hope I have express myself clear enough as my primary language is not English. Regards!
Yeah, though we first need a way to display it (see bug 661608).
Ok, I see, but... Can't be just one bug: "Implement viewing and editing of file metadata" Thanks for your time!
Title editing is now implemented in git master, even though information is not written back to the file itself (bug 681828). We also need to implement an editable Author field, so keeping this open for now.
*** Bug 710226 has been marked as a duplicate of this bug. ***
Changing the summary to narrow it down a bit. Metadata in itself is a bit broad and can cover lots of things. Lets use this bug only for editing titles and author information. As Cosimo said, you can edit titles now. Editing the author field needs to be implemented.
Hi, I was trying to implement the very same as that for title to the author field.... I added similar code for author as for title with some adjustments.... const _AUTHOR_ENTRY_TIMEOUT=200; // Author value if (doc instanceof Documents.LocalDocument) { this._authorEntry = new Gtk.Entry({ activates_default: true, text: doc.author, editable: true, hexpand: true, width_chars: 40, halign: Gtk.Align.START }); grid.attach_next_to (this._authorEntry, this._author, Gtk.PositionType.RIGHT, 2, 1); let docId = doc.id; this._authorEntryTimeout = 0; this._authorEntry.connect('changed', Lang.bind (this, function() { if (this._authorEntryTimeout != 0) { Mainloop.source_remove(this._authorEntryTimeout); this._authorEntryTimeout = 0; } this._authorEntryTimeout = Mainloop.timeout_add(_AUTHOR_ENTRY_TIMEOUT, Lang.bind(this, function() { this._authorEntryTimeout = 0; let newauthor = this._authorEntry.get_text(); TrackerUtils.setEditedAuthor(newauthor, docId, null); return false; })); })); } else { this._authorEntry = new Gtk.Label({ label: doc.author, halign: Gtk.Align.START }); grid.attach_next_to (this._authorEntry, this._author, Gtk.PositionType.RIGHT, 2, 1); } Also added the respective code in TrackerUtils.js for.......... function setEditedAuthor(newAuthor, docId, callback) { let sparql = ('INSERT OR REPLACE { <%s> tracker:coalesce(nco:fullname(?creator), nco:fullname(?publisher) \"%s\" }'.format(docId, newAuthor)); Application.connectionQueue.update(sparql, null, function(object, res) { try { object.update_finish(res); } catch (e) { log('Unable to set the new author on ' + docId + ' to : ' + e.toString()); } if (callback) callback(); }); } Please can you tell me what is the problem here with the code. The problem that I am facing is that although the author name is being displayed in the Gtk.Entry for author but on updating it is not getting updated....
(In reply to sparshpaliwal123@gmail.com from comment #6) > Hi, I was trying to implement the very same as that for title to the author > field.... Could you please attach your changes as patch? See https://wiki.gnome.org/GnomeLove/CodeContributionWorkflow#Submitting_patches
Created attachment 300201 [details] [review] This patch is the initial work on the bug. I have attached the patch for the work I had done on the bug.
I think here the problem is with sparql query let sparql = ('INSERT OR REPLACE { <%s> tracker:coalesce(nco:fullname(?creator), nco:fullname(?publisher) \"%s\" }'.format(docId, newAuthor)); I tried a lot but was not able to find ontology for author field. Please can you help with this. I guess correcting this should make this work.
perhaps nco:creator? http://www.semanticdesktop.org/ontologies/2007/03/22/nco/#creator
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-documents/-/issues/ Thank you for your understanding and your help.