GNOME Bugzilla – Bug 81507
Popup a dialog when user don't have there docbook catalog setup correctly
Last modified: 2004-12-22 21:47:04 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
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.
*** Bug 81508 has been marked as a duplicate of this bug. ***
I'm adding a dependency to bug 47606 as per Hallski's comments in IRC, but that still doesn't solve the whole problem.
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.
*** Bug 81835 has been marked as a duplicate of this bug. ***
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
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.
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
ok, this will have to wait for 0.9, I need to get 0.8 out now.
*** Bug 82758 has been marked as a duplicate of this bug. ***
Changing summary on this bug to reflect what it's about.
Created attachment 8804 [details] [review] a patch to check for docbook DTD and XSL in catalog on startup
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.
Removing perf keyword. Would be nice to get this in for 2.0.0.
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.
Created attachment 8847 [details] [review] new version. Moves check to yelp-base.c, reduces string duplication a bit.
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?
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.
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?
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.
reopinging, jamesh notified me that the DTD was needed.
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.