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 514553 - Implementing GetTextContents method
Implementing GetTextContents method
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: General
unspecified
Other All
: Normal normal
: ---
Assigned To: Jamie McCracken
Jamie McCracken
Depends on:
Blocks:
 
 
Reported: 2008-02-05 15:13 UTC by Ivan Frade
Modified: 2008-03-27 09:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implements the GetTextContents method (3.83 KB, patch)
2008-02-05 15:18 UTC, Ivan Frade
none Details | Review
Implementation of the GetTextContents method (new version) (3.91 KB, patch)
2008-02-18 13:09 UTC, Ivan Frade
committed Details | Review

Description Ivan Frade 2008-02-05 15:13:00 UTC
Please describe the problem:
The method "GetTextContents" in the dbus interface is unusable. It is not completely implemented.

Steps to reproduce:
1. Start tracker indexing some text files
2. Call the method GetTextContents 
 For example:
"dbus-send --dest='org.freedesktop.Tracker' --type=method_call --print-reply /org/freedesktop/tracker org.freedesktop.Tracker.Files.GetTextContents string:/home/xxxxx/test/yyyy.rtf int32:0 int32:100""


Actual results:
There is no answer, and a message in the log:
 ERROR: prepared query GetFileContents not found
 ERROR: incorrect no of parameters 4 supplied to GetFileContents
 ERROR: parameter 0 could not be bound to GetFileContents
 ERROR: parameter 1 could not be bound to GetFileContents
 ERROR: parameter 2 could not be bound to GetFileContents
 ERROR: parameter 3 could not be bound to GetFileContent


Expected results:
It must return the first 100 characters of the contents of the file

Does this happen every time?
Yes

Other information:
I have a patch which I will attach here that fixes this.
Comment 1 Ivan Frade 2008-02-05 15:18:46 UTC
Created attachment 104487 [details] [review]
Implements the GetTextContents method

This patch adds a new stored procedure (GetFileContents), and adds the required logic to use it in tracker-dbus-files.c
Comment 2 Jamie McCracken 2008-02-14 18:03:38 UTC
service_id = tracker_db_get_id (db_con, "Documents", uri);

i think the above line should be :

service_id = tracker_db_get_id (db_con, "Files" uri);

that should work for all files objects

if service_id < 1 then replace files with "Emails"

Other than that it should be fine.

Reattach patch once above is fixed - thanks
Comment 3 Ivan Frade 2008-02-18 13:09:00 UTC
Created attachment 105493 [details] [review]
Implementation of the GetTextContents method (new version)

New version using "Files" (and "Emails" in a second try) instead of "Documents" to obtain the service id.
Comment 4 Martyn Russell 2008-03-27 09:41:50 UTC
Committed!