Weblog entry #89 for dkg

set default margins for OpenOffice as a sysadmin?
Posted by dkg on Thu 6 Dec 2012 at 17:30
I'm maintaining a lab of debian squeeze machines that run OpenOffice.org (i'm considering upgrading to LibreOffice from squeeze-backports). I'd like to adjust the default page margins for all users of Writer. Most instructions i've found suggest ways to do this as a single user, but not how to make the change system-wide. I don't want to ask every user of these machines to do this (and i also don't want to tamper with each home directory directly -- that's not something i can maintain reliably).

Alas, i can find no documentation about how to change the default page margins system-wide for either Oo.o or LibreOffice. Surely this is something that can be done without a recompile. What am i missing?

 

Comments on this Entry

Posted by rjc (2a01:0xx:0xx:0xxx:0xxx:0xxx:xx) on Thu 6 Dec 2012 at 18:22
In registry directory edit main.xcd or other .xcd files if they already alter the default behaviour, i.e. are used for localization.

Regards,

rjc

[ Parent | Reply to this comment ]

Posted by dkg (2001:0xx:0xx:0xxx:0xxx:0xxx:xx) on Thu 6 Dec 2012 at 19:02
[ View dkg's Scratchpad | View Weblogs ]
Thanks for the quick answer, rjc!

Are you referring to /usr/lib/libreoffice/share/registry/writer.xcd? this file is managed by the system package manager. Can i just drop another .xcd file in /usr/lib/libreoffice/share/registry/ and have it be loaded as well?

if so, what do i need to put in that file to change the margins of the default page?

[ Parent | Reply to this comment ]

Posted by rjc (131.111.xx.xx) on Fri 7 Dec 2012 at 11:50
Hi,

Whether additional files you might put there are being sourced, that I don't know.

It would seem like editing writer.xcd should be enough, the reason why I've mentioned main is because it does contain several Margin-related settings.

rjc

[ Parent | Reply to this comment ]

Posted by dkg (2001:0xx:0xx:0xxx:0xxx:0xxx:xx) on Fri 7 Dec 2012 at 14:17
[ View dkg's Scratchpad | View Weblogs ]
Thanks for your feedback, rjc.

Which settings are you referring to in particular? How should they be changed?

[ Parent | Reply to this comment ]

Posted by dkg (2001:0xx:0xx:0xxx:0xxx:0xxx:xx) on Thu 6 Dec 2012 at 21:19
[ View dkg's Scratchpad | View Weblogs ]
I've just posted the question to LibreOfficeForum in the hopes of getting more details from that crowd. But i'd be happy to get suggestions here too :)

[ Parent | Reply to this comment ]

Posted by Anonymous (24.103.xx.xx) on Fri 7 Dec 2012 at 19:17
See the Personal configuration section of The Document Foundation Deployment and Migration guide:
These settings are mostly personal and stored in a specific file registrymodifications.xcu. So, if we replace this file after installation with a similar file with the correct above settings, we can control the selected feature. ...

Toolbars and icons are also personal, but cannot be transferred by means of copying. For example, custom Writer toolbars are in "%userprofile%\Application Data\LibreOffice\3\user\config\soffice.cfg\modules\swriter\toolba r". ...

In some situations, such as decreasing Macro security levels on a silent install, or configuring an option for the installation, can be carried by placing a XML file in the right place, after LibreOffice is installed and with the help of a script or automated tool.

For example the following XML file with .xcd extension can be placed in

%PROGRAMFILES%\LibreOffice 3.5\share\registry

and will set macro security level to Medium

OOo Admin Guide says re: paths:
To Add a Template For All Users of a OpenOffice.org Network Installation
1 Become root.
2 Copy the template to the network-install-dir/share/template/ directory.

To Add a Template to a Workstation Installation of OpenOffice.org
1 Become root.
2 Copy the template to the ooo-user-dir/user/template/ directory on the workstation.

Also see libreoffice-users 9 Feb 2012 thread re: Default path for templates:
$USER_LO_DIR/..../user/template are personal templates, only for each user.
$LO_INST_DIR/..../template/common are collective templates, for all user of
system.
> The path he needs to use ends in .../template/common because his LO
> installation is on a server. This permits people from other computers to
> use LO and the same templates.
> If templates are placed in the common folder, they will not be
> seen. A folder must first be created in the common folder and the
> templates placed in the created folder. (See my earlier post.)
> There is another path for templates which is in the user's LO
> folder. This path ends in .../user/template. Templates placed in the
> template folder of this path will be seen. Templates in this path are
> only visible on one computer which is why this path would not work for
> him.

[ Parent | Reply to this comment ]

Posted by dkg (216.254.xx.xx) on Fri 7 Dec 2012 at 20:06
[ View dkg's Scratchpad | View Weblogs ]
I don't see any links in the above, and i haven't been able to find the libreoffice-users thread you mention even though i searched at the archive where i think it should be. Could you point to your source documents?

Also, none of the text you've provided suggests anything about making a given template the default template without tampering with end user profiles, which i've already stated i do not want to do (based on years of sysadmin practice). Do you have any suggestions for how to set the default template for all users?

[ Parent | Reply to this comment ]

Posted by Anonymous (24.103.xx.xx) on Fri 7 Dec 2012 at 20:36
Sadly, links are disallowed for anon comments. You are looking in the right place, but wrong year. I saw the emails for Feb 8-9 2012 on pages 94-95 of the link you provided.

You are correct. Doing as you propose does not seem to be supported, and the recommendations are to script changes to the user files. Do note, though, that even should you work around that and fiddle with main.xcd or writer.xcd to affect global settings, the user can still at any time override it by creating his own user settings and make any template he wants the default--so it's not foolproof unless you disable the user from accessing/modifying the template settings. I suppose main.xcd makes sense, unless you care only about writer, but do not know exactly what to put in there.

But first, the template has to be accessible to all users of a network install, and what I posted discusses that a bit. Apparently, you need a dir in a dir to make it show with a category name from the global location.

[ Parent | Reply to this comment ]

Posted by dkg (216.254.xx.xx) on Fri 7 Dec 2012 at 20:46
[ View dkg's Scratchpad | View Weblogs ]
You can still paste URLs (they won't turn into automatic links) as an anonymous user. This is significantly more convenient than english descriptions of where the link might be. I think you are talking about the thread that derives from this initial post.

I'm perfectly fine with users overriding the sysadmin-declared defaults. They're called "defaults", and not "forced overrides". In fact, wanting to respect user preferences is the main reason i don't want to fiddle with each user's profile directory.

I guess i'll start by making sure that i can make a template visible to all users as a first step. I'm going to hold out hope that the LO or Oo.o teams haven't been silly enough to prevent an admin from tuning the default template for all users from the central installation.

[ Parent | Reply to this comment ]

Posted by Anonymous (173.56.xx.xx) on Fri 7 Dec 2012 at 22:08
You found the thread I was talking about. I initially tried to include the URLs but it would not post.

[ Parent | Reply to this comment ]

Posted by Anonymous (173.56.xx.xx) on Fri 7 Dec 2012 at 22:29
Trying a URL...nope "The comment you attempted to submit contains a link, and such comments may only be made by registered users."

See here http en.libreofficeforum.org/node/1760

[ Parent | Reply to this comment ]

Posted by dkg (216.254.xx.xx) on Fri 7 Dec 2012 at 22:41
[ View dkg's Scratchpad | View Weblogs ]
Thanks, that's a much easier description to figure out than the other hunting around i was doing. sorry about the hassle with the anonymous links. Dealing with forum spam is a major pain.

Unfortunately, that link appears to be related to the default save format -- nothing to do with page margins :(

[ Parent | Reply to this comment ]

Posted by Anonymous (24.103.xx.xx) on Tue 11 Dec 2012 at 20:35
I came across something I hope will point you in the right direction. From the slides [1], you might need to add oor:finalized="true" to your .xcd. The OOconfig extension [2] could also be useful.

[1] http www.linuxtag.org/2012/fileadmin/www.linuxtag.org/slides/Thorsten% 20Behrens%20-%20LibreOffice%20configuration%20management%20-%20To ols_%20approaches%20and%20best%20practices.p331.pdf
[2] http users.freedesktop.org/~thorsten/extensions/ooconfig.oxt

[ Parent | Reply to this comment ]

Posted by dkg (2001:0xx:0xx:0xxx:0xxx:0xxx:xx) on Fri 14 Dec 2012 at 05:20
[ View dkg's Scratchpad | View Weblogs ]
Hmm, this ooconfig extension seems to choke with libreoffice 1:3.5.4+dfsg-4 on wheezy amd64. When i go to look at the about:config settings, the application freezes.

Also: i'm not against a user who wants to choose their own default template doing so; i just want to change the system default for those users who never tweak it themselves. So i don't think oor:finalized="true" is relevant (or desirable, for that matter).

[ Parent | Reply to this comment ]

Posted by Anonymous (24.103.xx.xx) on Fri 14 Dec 2012 at 18:38
You seem to be having no luck. As I understand it, you should make an extension containing just an .xcu file as payload. If you make a system wide config, it will just be overridden by the users' existing margin settings. Example here: http users.freedesktop.org/~thorsten/extensions/config_only_sample.oxt

XML Spec, Sec 2.3 page-master, 3.11.19 L&R margins, 3.11.22 T&B margins
https www.openoffice.org/xml/xml_specification.pdf

Extension Manager use
http wiki.openoffice.org/wiki/Documentation/Administration_Guide/Using _Package_Manager

Thorsten Behren's slides on LibO config management
http www.linuxtag.org/2012/fileadmin/www.linuxtag.org/slides/Thorsten Behrens - LibreOffice configuration management - Tools_ approaches and best practices.p331.pdf

Florian Effenberger's slides on corporate deployment of OOo
http www.linux-kongress.org/2010/slides/ooo_netzwerk-effenberger.pdf

Florian Effenberger's article on OOo config with XCU files
German: http www.linux-magazin.de/Online-Artikel/Positive-Einstellung
English: http translate.google.com/translate?sl=auto&tl=en&js=n&pre v=_t&hl=en&ie=UTF-8&eotf=1&u=http%3A%2F%2Fwww.lin ux-magazin.de%2FOnline-Artikel%2FPositive-Einstellung

Not sure it's useful but for good measure...Template Files
http wiki.openoffice.org/wiki/Documentation/Administration_Guide/Addin g_Template_Files

[ Parent | Reply to this comment ]