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 116629 - Dashboard crack
Dashboard crack
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
0.x
Other Linux
: Normal normal
: ---
Assigned To: Marco Pesenti Gritti
Marco Pesenti Gritti
Depends on:
Blocks:
 
 
Reported: 2003-07-03 14:29 UTC by Xan Lopez
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Possible implementation (16.09 KB, patch)
2003-07-08 14:44 UTC, Marco Pesenti Gritti
none Details | Review

Description Xan Lopez 2003-07-03 14:29:51 UTC
<Nat> so, basically here's what you guys can do to make me really happy
<Nat> 1. provide a simple C library for accessing the url history and the
bookmarks.  mainly the bookmarks.
<Nat> 2. add a little hook so i can plugin in .so's that fire whenever you
hit a page, and expose sufficient internal interfaces to the plugin  so i
can get title, url, and html of the page

'nuff said.
Comment 1 Dave Bordoley [Not Reading Bug Mail] 2003-07-03 14:32:08 UTC
For the sake of mentioning it i'd find this useful for openapplet too :)
Comment 2 Marco Pesenti Gritti 2003-07-03 14:35:46 UTC
Xan, can you explain the use of this stuff ?
Prolly the title say it but I dont get it ;)
Comment 3 Dave Bordoley [Not Reading Bug Mail] 2003-07-03 14:39:08 UTC
dashboard is this cool little app that harvests data and provides the
user information related to what they are doing.
http://www.nat.org/dashboard/
Comment 4 Xan Lopez 2003-07-03 14:41:54 UTC
Ok, more information so people who wasn't in the channel can know what
the hell I'm talking about.
The lines above are what Nat thinks it's needed so Dashboard
(http://www.nat.org/dashboard) and Epiphany could cooperate in peace
and harmony and rock the world. It's that, basically.
Comment 5 Marco Pesenti Gritti 2003-07-03 14:49:04 UTC
Yay, that's stuff freedesktop people should take in consideration, not
stupid xbel crap :)
It sounds like a fun project too. Dave, we need to meet and work on an
interface I guess, maybe I'll try to think to something ...
Comment 6 Nat Friedman 2003-07-03 15:49:45 UTC
A few notes.

Plugins
-------

For the plugin system, basically I want hooks for the following
events:

    - The browser loads a new page.

    - Bookmarks change (bookmark added, bookmark deleted, bookmark
      edited).

You can basically create a BrowserPlugin object and the plugin can
connect to page_load and bookmark_change signals.

From the page_load signal handler I need to be able to get at the url,
title, and full page content.

From the bookmark_change signal, I just need to get an object which
represents the new, changed or deleted bookmark.

You can do all this stuff synchronously in the same thread as the rest
of the browser, since I'm never going to block.

Bookmark Access Library
-----------------------

This should be a simple C library I can use to read the bookmarks
file.  I just want to be able to enumerate the bookmarks as simple
structures or objects, so this can be dead simple:

    typedef struct _Bookmark {
        char *url;
        char *title;
        char **categories;
    } Bookmark;

    GList *load_bookmarks (char *path);

This is just an example, do it however you want, but for me, this is
all I care about.

The URL history thing should be just the same.
Comment 7 Nat Friedman 2003-07-03 15:56:47 UTC
One thing I just remembered that's very important.

I need a way, from within the plugin, of finding out if the browser
window/tab for a page load is focused.  And I need a focus_changed
event, which should give me the url and stuff for the newly-focused
tab/window/thing.

Comment 8 Marco Pesenti Gritti 2003-07-05 07:52:42 UTC
Snorp, could you explain what part of this you are/plan to work on ? I
dont want to work on stuff that you are already doing.
Comment 9 Marco Pesenti Gritti 2003-07-06 09:12:11 UTC
>This should be a simple C library I can use to read the bookmarks
>file

What about the let access this data with the epiphany corba interface
? Trying to access the same file would require locks. Also if a way to
add bookmarks will be required by dashboard or another application,
syncing will be a pain.
Obviously the corba interface would require to startup epiphany.
Comment 10 Nat Friedman 2003-07-06 10:22:09 UTC
Starting up epiphany - does this mean you need the GUI around?  That
sounds like a real problem.

In the worst case I can just monitor and read whatever file you write
out.  I don't need to add bookmarks.
Comment 11 Marco Pesenti Gritti 2003-07-06 11:14:07 UTC
> Starting up epiphany - does this mean you need the GUI around?

Nope, the process would be started but no windows opened. Something
similar to epiphany/galeon --server
Comment 12 Dave Bordoley [Not Reading Bug Mail] 2003-07-06 18:36:09 UTC
Just to chime in, it might be nice to have a simple c api that hides
all the corba details from implementor. 
Comment 13 Marco Pesenti Gritti 2003-07-06 19:15:55 UTC
Dave, yeah, that would require a library though.

Nat, if you are ok with the corba interface please let me know and
I'll give a try to implement it in the next days.
Otherwise, proposals on how to do it differently are welcome.
Comment 14 James Willcox 2003-07-07 16:37:12 UTC
Marco:  I have only done the frontend code -- it simply passes
cluepackets to dashboard every time you open a page.  Needs more work
though.....see dashboard/frontends/ephy-cvs-dashboard.patch 
Comment 15 Nat Friedman 2003-07-07 16:47:08 UTC
If you provide me a CORBA interface, I am going to have to write a C
wrapper so I can bind it into C#.

James - you might want to check out my new version of your patch,
which now tries and fails to get the Focused attribute right.
Comment 16 Marco Pesenti Gritti 2003-07-08 14:44:12 UTC
Created attachment 18137 [details] [review]
Possible implementation
Comment 17 Marco Pesenti Gritti 2003-07-08 14:52:42 UTC
The patch add a corba interface to let access epiphany resources.

Basically:

epiphany_resource_select ("Bookmarks");
epiphany_resource_get_description ();

A string containing an rdf description of bookmarks is returned. The C
library could parse this string and return it with an api like the one
Nat described.
For OpenApplet pourpouses this should probably be extended with a way
to filter elements.

Other possible implementation would have been:

- The same api Nat proposed but implemented in Corba, with a C wrapper.

Disadvantages: You cant add properties without breaking api

- a get_n_items, get_propery (prop_name, item_n) api.

Disadvantages: What happen if bookmarks are added/remove while you are
iterating ?

- a C library that reads directly the epiphany xml file.

Disadvantages: Locks required, no way to allow to add resources (not
requires by dashboard but ...).

Opinions ?

(The implementation is largely unfinished, but I dont want to waste
time on it, if it's not ok ...)
Comment 18 Marco Pesenti Gritti 2003-07-08 16:22:49 UTC
Nat, I'm really a bit lost with this, mainly because I dont exactly
understand dashboard architecture.
I talked a bit with teuf and it seem that the worst damage we could
get by reading the same file is to not be able to write on disk
bookmarks from epiphany. Considering that it's probably never going to
happen to write/read at the same time, maybe it could be acceptable.
Writing a parser for bookmarks in C is trivial, if that's your
preferred solution I can do it.
I was plannig to find a solution useful for other applications too,
but that's harder and would require a lot more thinking ... so I'd
prolly give up on it for now.
Comment 19 Christophe Fergeau 2003-07-08 18:06:29 UTC
I didn't say that :) Actually if you save your bookmarks in a
temporary file, and then replace the real bookmark file with it, there
shouldn't be any issue
Comment 20 Nat Friedman 2003-07-08 18:42:09 UTC
Okay, I'm happy to just parse your XML files if you write to them
atomically.  Sorry about all the confusion on that.

I do think you need a simple plugin system though.
Comment 21 Nat Friedman 2003-07-09 07:32:36 UTC
I found the bookmarks file; where do you store your URL history?

Also - any opinions on a simple plugin system?
Comment 22 James Willcox 2003-07-09 15:18:51 UTC
Looks like history is in ~/.gnome2/epiphany/ephy-history.xml
Comment 23 Marco Pesenti Gritti 2003-07-09 18:04:56 UTC
Yeah that's the history. For bookmarks please use bookmarks.rdf.

About plugins. We sort of planned to have a simple plugin system at
some point so I think there is no problem.
Comment 24 Marco Pesenti Gritti 2003-07-12 11:09:07 UTC
I checked in a very simple plugin framework.
The sample plugin get notification when bookmarks changes.

Now we need to decide the set of api to expose.
The worst problem with this is that ephy-shell.c include all services
instead of using a base type for them.
Comment 25 Marco Pesenti Gritti 2003-07-13 08:59:31 UTC
The plugin stuff should be done. I'm now installing useful headers and
the sample plugin does what you asked.
Comment 26 Marco Pesenti Gritti 2003-08-12 16:19:03 UTC
I guess this can be closed. Dashboard can parse bookmarks/history and
we have a plugin system that allows to get the stuff you need.