After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 675274 - Allow changing the title and author
Allow changing the title and author
Status: RESOLVED OBSOLETE
Product: gnome-documents
Classification: Core
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
ready
: 710226 (view as bug list)
Depends on: 661608
Blocks:
 
 
Reported: 2012-05-02 04:37 UTC by Jorge Meneses
Modified: 2021-07-05 11:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This patch is the initial work on the bug. (3.78 KB, patch)
2015-03-24 15:18 UTC, sparshpaliwal123@gmail.com
needs-work Details | Review

Description Jorge Meneses 2012-05-02 04:37:33 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!
Comment 1 Cosimo Cecchi 2012-05-14 15:45:18 UTC
Yeah, though we first need a way to display it (see bug 661608).
Comment 2 Jorge Meneses 2012-05-20 17:16:40 UTC
Ok, I see, but... Can't be just one bug: "Implement viewing and editing of file metadata"

Thanks for your time!
Comment 3 Cosimo Cecchi 2012-08-14 11:14:40 UTC
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.
Comment 4 Debarshi Ray 2013-11-27 21:54:56 UTC
*** Bug 710226 has been marked as a duplicate of this bug. ***
Comment 5 Debarshi Ray 2014-03-28 13:15:31 UTC
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.
Comment 6 sparshpaliwal123@gmail.com 2015-03-24 08:29:41 UTC
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....
Comment 7 Debarshi Ray 2015-03-24 14:54:20 UTC
(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
Comment 8 sparshpaliwal123@gmail.com 2015-03-24 15:18:06 UTC
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.
Comment 9 sparshpaliwal123@gmail.com 2015-03-28 19:54:15 UTC
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.
Comment 10 Federico Bruni 2016-07-06 13:16:14 UTC
perhaps nco:creator?
http://www.semanticdesktop.org/ontologies/2007/03/22/nco/#creator
Comment 11 GNOME Infrastructure Team 2021-07-05 11:30:43 UTC
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.