Bug 38812 - PackageKit / Help integration
Summary: PackageKit / Help integration
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other Linux (All)
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: reviewed:2024
Keywords: difficultyInteresting, easyHack, skillCpp
Depends on:
Blocks: Language-Help-Packs
  Show dependency treegraph
 
Reported: 2011-06-30 07:04 UTC by Björn Michaelsen
Modified: 2024-01-07 14:07 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Michaelsen 2011-06-30 07:04:55 UTC
PackageKit / Help integration

Background: currently many Linux distributions package help separately, since it is incredibly bulky. will not fit on a live-CD etc. It would be great to detect and trap those entry points (eg. sfx2/source/appl/appserv.cxx /SID_HELPINDEX/ -> vcl/inc/vcl/help.hxx) and allow PackageKit to be used to install the apropriate (localised) help if it is not present. Similarly it would be good to present a web fallback if not running on Linux. We should most likely integrate with PackageKit directly via its dbus interface to avoid desktop dependencies.

Skills: building, simple C++
Comment 1 Florian Reisinger 2012-05-18 09:47:59 UTC
Deleted "Easyhack" from summary.
Comment 2 Björn Michaelsen 2012-12-08 19:50:23 UTC
The Dbus/Sessioninstaller-bridge code as already here now:
http://opengrok.libreoffice.org/xref/core/shell/source/sessioninstall/SyncDbusSessionHelper.hxx

all it need now, is to plug that in at the right locations.
Comment 3 Björn Michaelsen 2013-10-04 18:46:41 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 4 Björn Michaelsen 2015-01-15 15:56:53 UTC
Still an EasyHack, note there is the lcl_tryLoadBibliography() function showing how to use the PackageKit helper:
http://opengrok.libreoffice.org/s?refs=lcl_tryLoadBibliography&project=core
Comment 5 Robinson Tryon (qubit) 2015-12-14 05:03:40 UTC Comment hidden (obsolete)
Comment 6 Michael Stahl (allotropia) 2016-01-26 17:40:34 UTC
oops, the skillLinux keyword isn't real, remove it again
Comment 7 Robinson Tryon (qubit) 2016-02-18 14:51:33 UTC Comment hidden (obsolete)
Comment 8 Asela 2016-10-13 07:01:49 UTC
I like to do this hack. Can anyone give me more hints about this
Comment 9 jani 2016-10-13 07:13:31 UTC
(In reply to Asela from comment #8)
> I like to do this hack. Can anyone give me more hints about this

Welcome, you are aware that this is one of the more difficult easy hacks ?


Have a look at 
https://wiki.documentfoundation.org/Development/GetInvolved

to get you started.


You have a code pointer in comment #2, and that is all you should need.

happy hacking
jan i.
Comment 10 Asela 2016-10-13 07:37:59 UTC
(In reply to jan iversen from comment #9)
> (In reply to Asela from comment #8)
> > I like to do this hack. Can anyone give me more hints about this
> 
> Welcome, you are aware that this is one of the more difficult easy hacks ?
> 
> 
> Have a look at 
> https://wiki.documentfoundation.org/Development/GetInvolved
> 
> to get you started.
> 
> 
> You have a code pointer in comment #2, and that is all you should need.
> 
> happy hacking
> jan i.

Thanks I will try
Comment 11 John 2021-02-22 02:52:05 UTC
I was taking a look at this and made what looked like a maybe-correct change, but I'm having trouble testing, so let me ask a strange question followed by some observations that may explain...

Do we have a docker or a known current version of a distro I can build a VM from where this would be expected to work? In particular one where the Bibliography Database menu option can successfully install libreoffice-base and also having libreoffice-help installed would allow me to see the help files through the menu.

The two environments I tried to test in are 

1) My new laptop. It's so new I haven't bothered to distrohop or change much yet. It's still on the manufacturer's default: PopOS 20.10. I did change the default browser, which will come up.

2) The family desktop. It's on Ubuntu 20.04.2 LTS with pretty much stock everything.

On the laptop the org.freedesktop.PackageKit.Modify2 interface is not available. Modify is. PopOS apparently uses a lot of package manager manager code from Enlightenment (rebranded, of course). So of course 

Also, installing libreoffice-help-en-us (that is my locale, BTW) causes it to attempt open those HTML files in my default browser, which is ungoogled-chromium from a flatpak that doesn't have permission to see those files. I know I could fix that, but I have to imagine this could confuse someone.

On the desktop (where both Modify and Modify2 exist) if I try the Bibliography Database it asks me only asks me to restart LO (no prompting for authentication or anything). Looking at dbus-monitor indicates to me it did make a DBus call, but nothing ever was visible. journalctl shows me that Ubuntu Software wasn't allowed to communicate with me?

apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/org/gtk/Notifications" interface="org.gtk.Notifications" member="AddNotification" mask="send" name="org.gtk.Notifications" pid=3023 label="snap.snap-store.ubuntu-software" peer_pid=2653 peer_label="unconfined"

Note that pkcon works on both these machines, so the dbus approach should in theory be doable. 

A couple limitations to this approach occurred to me, though. For one thing installing software requires auth from a user who can do such things (i.e. a sudoer). If I were to try to use LibreOffice at my current employer, for example, I (and most employees) do not have such privileges on any machines. This would just be rubbing it in 😉.

But also... at least with the minimalist change I was making, there's no querying the package to see where it installed the help files - I was going to just assume the approot would be the same. Which it should be if the same person (or two reasonable people) made both packages. But what if LO isn't running from a package. If I wanted to run LO at work I'd be either building from source or downloading someone's archive file of some sort and running it from some arbitrary user directory. My current build directory for LO certainly can't find the files installed by libreoffice-help. 

Perhaps that latter point should be a part of the requirement for fixing this ticket? That sfxhelp.cxx file does also contain logic of where to look for the files. The PK APIs (both gobject and also dbus) certainly do contain calls to check if the package is installed and to list the files installed by a given package. You already have a a call for IsInstalled and GetFiles() is documented here:
https://www.freedesktop.org/software/PackageKit/gtk-doc/Transaction.html


But maybe another approach could be better? I know y'all know LO much better than I, and I don't know the reasoning for the status quo, so feel free to slap this down. Maybe LO could have a built-in html viewer to avoid weird issues that could come up with the default browser, and if it can't find the HTML files yes start grabbing online help for the right version but your "Help Browser" could have a button to "Download for Offline Viewing"?

But then that's not an easy hack anymore, but rather a significant restructuring of how Help works. Just a thought.
Comment 12 Buovjaga 2021-02-22 06:54:31 UTC
Olivier: check the previous comment, we have a dev interested in Help
Comment 13 John 2021-02-23 21:34:14 UTC Comment hidden (obsolete)
Comment 14 John 2021-02-23 21:36:43 UTC Comment hidden (obsolete)
Comment 15 John 2021-02-24 00:56:01 UTC Comment hidden (obsolete)
Comment 16 Hossein 2024-01-07 12:33:02 UTC
Re-evaluating the EasyHack in 2024

This enhancement is still relevant, as this feature it is not implemented yet.

Some other parts of LibreOffice like language packs are already integrated with PackageKit, but not the help.

The expected behavior is that if you choose help and it's not there, it should provide option to install it. In that case, if you choose "Help > LibreOffice Help", or press F1, you will see the dialog box titled: "LibreOffice Help Not Installed". There, you are only offered to "Read Help Online".

To see some of the current integrations of Packagekit with LibreOffice, grep for it in git log:

$ git log -i --grep="Packagekit"

Developer should have in mind that not every LO installation on Linux is from the distro packages. There are other means like RPM/DEB packages from libreoffice.org, and also Snap, Flatpak, AppImage, etc.