Песочница
Материал из Forumooo wiki
Clio (Обсуждение | вклад) м (→Где OpenOffice.org / LibreOffice / Go-OO хранит пользовательские настройки) |
Clio (Обсуждение | вклад) |
||
Строка 24: | Строка 24: | ||
Doc = ThisComponent | Doc = ThisComponent | ||
Cursor = Doc.Text.createTextCursor() | Cursor = Doc.Text.createTextCursor() | ||
+ | </source> | ||
+ | |||
+ | Java, BeanShell | ||
+ | <source lang="java"> | ||
+ | com.sun.star.uno.XComponentContext xContext = null; | ||
+ | xContext = com.sun.star.comp.helper.Bootstrap.bootstrap(); | ||
+ | </source> | ||
+ | |||
+ | xml | ||
+ | <source lang=xml> | ||
+ | <?xml version="1.0" encoding="UTF-8"?> | ||
+ | <!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd"> | ||
+ | <manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest"> | ||
+ | <manifest:file-entry manifest:media-type="application/vnd.oasis.opendocument.text" manifest:full-path="/"/> | ||
+ | </manifest:manifest> | ||
+ | </source> | ||
+ | |||
+ | Python | ||
+ | <source lang=python> | ||
+ | # ... here is the python script code | ||
+ | import unohelper | ||
+ | g_ImplementationHelper = unohelper.ImplementationHelper() | ||
+ | g_ImplementationHelper.addImplementation( \ | ||
+ | None,"org.openoffice.script.DummyImplementationForPythonScripts", \ | ||
+ | ("org.openoffice.script.DummyServiceForPythonScripts",),) | ||
</source> | </source> | ||
Версия 05:21, 19 октября 2010
Для проб и ошибок.
Тестовая страница
<html>
<body>
<% Response.Write "Hello World!" %>
</body>
</html>
Basic
Dim Doc As Object Dim Cursor As Object Doc = ThisComponent Cursor = Doc.Text.createTextCursor()
Java, BeanShell
com.sun.star.uno.XComponentContext xContext = null; xContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd"> <manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest"> <manifest:file-entry manifest:media-type="application/vnd.oasis.opendocument.text" manifest:full-path="/"/> </manifest:manifest>
Python
# ... here is the python script code import unohelper g_ImplementationHelper = unohelper.ImplementationHelper() g_ImplementationHelper.addImplementation( \ None,"org.openoffice.script.DummyImplementationForPythonScripts", \ ("org.openoffice.script.DummyServiceForPythonScripts",),)
Где OpenOffice.org / LibreOffice / Go-OO хранит пользовательские настройки
По умолчанию настройки хранятся в папке C:\Documents and Settings\<имя_пользователя>\Application Data\OpenOffice.org на Windows XP, папке /home/<имя_пользователя>/.openoffice на линуксе, папке C:\USERS\<имя_пользователя>\AppData\Roaming\OpenOffice.org на Windows Vista и Windows 7. Openoffice.org нужно заменить LibreOffice, Go-OO, OOo-dev в зависимости от варианта установленного офиса.
Можно указать любое место для сохранения настроек, отредактировав файл C:\Program Files\OpenOffice.org 3\program\bootstrap.ini на Windows или /opt/openoffice.org3/program/bootstraprc на линуксе. В этом файле нужно отредактировать одну строчку:
UserInstallation=$SYSUSERCONFIG/OpenOffice.org/3
В этой стрчке можно использовать такие параметры:
UserInstallation=$SYSUSERHOME/OpenOffice.org/3
будет хранить профиль в домашней папке
UserInstallation=$ORIGIN/..
будет хранить профиль в папке, где установлена программа (C:\Program Files\OpenOffice.org 3 на Windows)
На Windows:
UserInstallation=file:///F:/OpenOffice.org/3,
где F - имя диска, на котором будут храниться настройки профиля, OpenOffice.org/3 - папка, в которой будут храниться настройки. На линуксе:
UserInstallation=file:///home/user/OOo