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 81507 - Popup a dialog when user don't have there docbook catalog setup correctly
Popup a dialog when user don't have there docbook catalog setup correctly
Status: RESOLVED FIXED
Product: yelp
Classification: Applications
Component: General
unspecified
Other Linux
: High normal
: ---
Assigned To: Mikael Hallendal
Malcolm Tredinnick
: 81508 81835 82758 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-05-12 04:10 UTC by Joshua R. Odom
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.0


Attachments
a patch to check for docbook DTD and XSL in catalog on startup (3.48 KB, patch)
2002-05-29 02:28 UTC, James Henstridge
none Details | Review
new version. Moves check to yelp-base.c, reduces string duplication a bit. (2.70 KB, patch)
2002-05-30 12:16 UTC, James Henstridge
none Details | Review

Description Joshua R. Odom 2002-05-12 04:10:55 UTC
When clicking on 'Help Contents' a help browser window opens and a white
rectangle appears on the left and the rest of the area where the help page
is expected is grey. While yelp is in this state, you cannot close the
window without killing the process. When I left yelp running for several
minutes the help page finally displayed properly. This appears to occur for
all applications that currently support the help function.

Using yelp 0.7

Related Gnome2 libs:
gtk 2.0.2
libgnomeui 1.116.1
libgnome 1.116
libgtkhtml 1.99.7
Comment 1 Luis Villa 2002-05-14 22:21:58 UTC
I have no idea if this is really a useful bug or not, Hallski; please
close if you are already aware of this issue. Otherwise, if you want
to use it for a tracker or something, feel free to leave open.

Wipro: you may wish to look at this issue if performance is an issue
for you.
Comment 2 Luis Villa 2002-05-14 22:33:59 UTC
*** Bug 81508 has been marked as a duplicate of this bug. ***
Comment 3 Luis Villa 2002-05-17 22:59:50 UTC
I'm adding a dependency to bug 47606 as per Hallski's comments in IRC,
but that still doesn't solve the whole problem.
Comment 4 Mikael Hallendal 2002-05-17 23:59:43 UTC
ok, I have no ide why I missed this bug, sorry

this is due to the fact that you don't have your xml catalog set up
correctly. What happens is that it downloads the stylesheets from the
Internet instead of from your local disk.

When GNOME 2.0 is released this should be handled by the distributions.

I'd like to mark this as NOT A BUG, but I think it would be nice if it
where some way for Yelp to check if the xml catalog is set up
correctly (other than searching your entire hard disk in places where
libxml is looking), would have to ask DV about that one though.


Comment 5 Mikael Hallendal 2002-05-18 00:16:27 UTC
*** Bug 81835 has been marked as a duplicate of this bug. ***
Comment 6 Daniel Veillard 2002-05-18 07:05:23 UTC
Simply use either the xmlcatalog command (part of libxml2)
or the catalog API <libxml/catalog.h> to find out if the 
DocBook resources (DTD and staylesheet) canonical URLs can be
found in the catalog. If not the catalog need to be rebuilt
(assuming the resources are indeed present). Scripts to rebuild
the catalogs can be found in Yelp install I think, or on the 
catalog page in xmlsoft.org, but the proper place where this
happen is when the DocBook resources packages are installed,
that's where the resources MUST be added to the local catalog.
Any other way is seriously unsafe. That's why it's really part of
the distribution job to set the environment up, like managing
properly the Yelp dependancies on DocBook resources, the maintainance
of the XML (and SGML) catalogs are really part of that framework
layer.

Daniel
Comment 7 Mikael Hallendal 2002-05-20 12:31:44 UTC
hmm .. both the command xmlcatalog and the catalog.h API seems to
assume that you know where to find the catalog file. Is there someway
to just call xmlcatalog or preferably in the C API to just ask if a
given URL can be resolved against a local file.

boolean catalog_exists_local (gchar *url);

or something like that.
Comment 8 Daniel Veillard 2002-05-20 16:42:50 UTC
Hum ... 
include/libxml/catalog.h

xmlChar *       xmlCatalogResolve       (const xmlChar *pubID,
                                         const xmlChar *sysID);
xmlChar *       xmlCatalogResolveSystem (const xmlChar *sysID);
xmlChar *       xmlCatalogResolvePublic (const xmlChar *pubID);
xmlChar *       xmlCatalogResolveURI    (const xmlChar *URI);

  What about actually reading the include file ?

Daniel
Comment 9 Mikael Hallendal 2002-05-21 01:48:01 UTC
ok, this will have to wait for 0.9, I need to get 0.8 out now.
Comment 10 Mikael Hallendal 2002-05-23 13:24:18 UTC
*** Bug 82758 has been marked as a duplicate of this bug. ***
Comment 11 Mikael Hallendal 2002-05-26 23:47:10 UTC
Changing summary on this bug to reflect what it's about.
Comment 12 James Henstridge 2002-05-29 02:28:46 UTC
Created attachment 8804 [details] [review]
a patch to check for docbook DTD and XSL in catalog on startup
Comment 13 James Henstridge 2002-05-29 02:35:47 UTC
Just attached a simple patch to display a dialog if the Docbook/XML
DTD or stylesheets are missing from the catalog.  It is based on the
sample code Sander posted on desktop-devel-list:

http://mail.gnome.org/archives/desktop-devel-list/2002-May/msg00708.html

It pops up a dialog explaining what will happen if the files are
missing from the system, and gives a pointer to the scrollkeeper
website where people can download the required files.  This should
also get around the "spyware" concerns some people expressed, as it
clearly states that files will be downloaded over the internet if they
can't be found locally.

Unfortunately, the window gets popped up below the main window
(because it is created first).  Maybe the check_catalog() function
should be moved somewhere else, so that we can set the parent window
for the dialog correctly.
Comment 14 Luis Villa 2002-05-29 03:27:53 UTC
Removing perf keyword.

Would be nice to get this in for 2.0.0.
Comment 15 Mikael Hallendal 2002-05-29 08:37:04 UTC
Yes, this will be fixed for 2.0.0, I'm out of town right now but I
will fix this during the week (getting back home tonight).

James, I don't think you need to check this everytime you run yelp but
just once per session (so it can be checked in yelp-base). Thanks,
I'll include it.
Comment 16 James Henstridge 2002-05-30 12:16:19 UTC
Created attachment 8847 [details] [review]
new version.  Moves check to yelp-base.c, reduces string duplication a bit.
Comment 17 Mikael Hallendal 2002-05-31 00:01:54 UTC
OK, I'm shipping Docbook stylesheets 1.48 with Yelp now so we don't
need to look in the catalog for that.
About the DTD we should probably add a check for the catalog in there
but that would require a string change which might be to late at this
moment. Also the only visible thing that happens is that you get a
warning on STDOUT so it can perhaps wait until after 2.0.0?
Comment 18 James Henstridge 2002-05-31 02:51:26 UTC
When you say you are shipping the stylesheets with yelp, are you
installing them in the catalog?  IMHO, it would be best to do the
following (given you are shipping the stylesheets):

1. create an XML catalog file under under $(pkgdatadir) (or where ever
the stylesheets are going to go) that has all the correct entries for
the 1.48 stylesheet URIs (but not the "current" version ones).

2. try to put a reference to this catalog in /etc/xml/catalog, but
don't error out if this fails.  This way, other tools (like
scrollkeeper) can make use of the stylesheets.

3. on startup, adjust the XML_CATALOG_FILES environment variable to
include yelp's catalog, so libxml can find the stylesheets using the
standard system identifiers.

4. use some code similar to the one I attached as a sanity check.

The benefits of this is that if you switch over to requiring that the
stylesheets be installed separately, you simply stop distributing them
and don't adjust the XML_CATALOG_FILES environment variable.

You could also distribute the DTD like this as well.
Comment 19 Mikael Hallendal 2002-05-31 09:59:47 UTC
From what I know Scrollkeeper doesn't use the stylesheets. I've done
it the absolute simplest way now. I install the stylesheets together
with yelp-customization.xsl and then instead of referencing as uri I
do it by a relative address (docbook/html/docbookx.xsl). This works
just fine and is the absolutely easiest way instead of going the long
way around creating your own catalog. (I also don't include the full
package of xsl stylesheets)

It's another thing for the DTD though, this might very well be the
best way to handle the DTD. Though I'm confused whether the DTD is
really needed, I know it's looked for but I haven't seen any problems
when it's not found. I figure it won't be able to validate the
document, but what will happen if you give it a broken document and it
tries to parse it?
Comment 20 Mikael Hallendal 2002-06-01 13:57:06 UTC
I currently disabled the external loading of the DTD since it doesn't
seem to matter to the end result if it's there or not. Thus we
currently don't need any dialogs since it will just work out of the box.

Going to close this bug and in the future when we move to use
"current" instead with XML catalog a new bug can be opened.
Comment 21 Mikael Hallendal 2002-06-02 12:48:25 UTC
reopinging, jamesh notified me that the DTD was needed.
Comment 22 Mikael Hallendal 2002-06-02 15:41:34 UTC
OK, now shipping the DTD and XSL together with Yelp. Also creating my
own catalog-file (in $prefix/share/yelp/catalog) and pointing to it so
that I can have the correct URI's in the yelp-customization.xsl and we
can use the DTD for whatever it's needed for.