Developing extension on LibreOffice for Pardus OS

Creating a macro - Writing a Script - Using the API

Developing extension on LibreOffice for Pardus OS

Postby ilker » Thu May 21, 2020 3:16 pm

Hello there.

I want to develop an extension(Add-in / Add-on).
This extension will works on Pardus operating system.
With all the content, this extension must make an http request while saving the doc.
Is it possible to do that ? And how i to do that ?
I will use windows for the development environment. I need a cross platform solution(for run this extension in windows and Pardus).

I will be grateful if you could help me.

Thanks.
LibreOffice : Version: 6.4.3.2 (x64)
ilker
 
Posts: 4
Joined: Thu May 21, 2020 2:41 pm
Location: Ankara / Türkiye

Re: Developing extension on LibreOffice for Pardus OS

Postby Lupp » Thu May 21, 2020 3:39 pm

ilker wrote:...make an http request while saving the doc.
This looks very unspecific to me. Might you be more precise, please.
Shall the request use a software assigned to html-calls on the system?
Can you get your response using WEBSERVICE() and FILTERXML()?
...
On Windows 10: LibreOffice 7.0 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2896
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Developing extension on LibreOffice for Pardus OS

Postby ilker » Thu May 21, 2020 3:47 pm

Hi Lupp.
Thank you for the answer.

In this section(while saving the doc), I would like to call a .asmx(c#) Web Service.
I would like to get whole doc content string, and send a .asmx webservice as parameter.
Can LibreOffice run a http request directly with extension ?

If it can, I need a solution to run this extension on the pardus, regardless of the programming language.

Thanks.
LibreOffice : Version: 6.4.3.2 (x64)
ilker
 
Posts: 4
Joined: Thu May 21, 2020 2:41 pm
Location: Ankara / Türkiye

Re: Developing extension on LibreOffice for Pardus OS

Postby Lupp » Thu May 21, 2020 8:30 pm

Please don't misunderstand the fact that I answered as a claim to be an expert in the field. My experiences are very few and rather old.
However, you can use the function WEBSERVICE() to get the stream.
If it is well-formed XML you can apply FILTERXML() with XPath filters (queries) to it. Both functions were probably implemented in LibreOffice for compatibility with MS-Office. There they may only be available in Excel. Since LibO is "monolithic" you can use standard functions of Calc in every situation as soon as you have created a FunctionAccess service. Of course, you may also evluate the stream you got by WEBSERVICE() in a different way.
Raw frame of an example:
Code: Select all   Expand viewCollapse view
Sub example()
fa = CreateUnoService("com.sun.star.sheet.FunctionAccess")
url = "https://server.domain.tld?service..."
xPathQuery = "..."
response = fa.callFunction("WEBSERVICE", Array(url))
selection = fa.callFunction("FILTERXML" , Array(response, xPathQuery))
End Sub
On Windows 10: LibreOffice 7.0 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2896
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Developing extension on LibreOffice for Pardus OS

Postby robleyd » Fri May 22, 2020 5:26 am

Also posted on AskLibreOffice
Cheers
David
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 3393
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Developing extension on LibreOffice for Pardus OS

Postby ilker » Fri May 22, 2020 8:42 am

Lupp wrote:Please don't misunderstand the fact that I answered as a claim to be an expert in the field. My experiences are very few and rather old.
However, you can use the function WEBSERVICE() to get the stream.
If it is well-formed XML you can apply FILTERXML() with XPath filters (queries) to it. Both functions were probably implemented in LibreOffice for compatibility with MS-Office. There they may only be available in Excel. Since LibO is "monolithic" you can use standard functions of Calc in every situation as soon as you have created a FunctionAccess service. Of course, you may also evluate the stream you got by WEBSERVICE() in a different way.
Raw frame of an example:
Code: Select all   Expand viewCollapse view
Sub example()
fa = CreateUnoService("com.sun.star.sheet.FunctionAccess")
url = "https://server.domain.tld?service..."
xPathQuery = "..."
response = fa.callFunction("WEBSERVICE", Array(url))
selection = fa.callFunction("FILTERXML" , Array(response, xPathQuery))
End Sub


Hi Lupp.

Where does this piece of code you write belong to (looks like vba)? Where can I write and how can I use this piece of code you provided? As I said, I will install and use this extension in pardus.

Thank you very much for your valuable help.
LibreOffice : Version: 6.4.3.2 (x64)
ilker
 
Posts: 4
Joined: Thu May 21, 2020 2:41 pm
Location: Ankara / Türkiye

Re: Developing extension on LibreOffice for Pardus OS

Postby Zizi64 » Fri May 22, 2020 9:11 am

looks like vba


It is absolutely not a VBA code. It is StarBasic code with some calling of API functions. API: Application Programming Interface. It is an excellent feature of the AOO/LO.
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 9431
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Developing extension on LibreOffice for Pardus OS

Postby Zizi64 » Fri May 22, 2020 9:16 am

Where can I write and how can I use this piece of code you provided? As I said, I will install and use this extension in pardus.

Do not try to create an extension, if you not know how you can use the sample code.
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 9431
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Developing extension on LibreOffice for Pardus OS

Postby ilker » Fri May 22, 2020 9:28 am

Hi Zizi64.

First of all, thank you for your response.
I'm a little newbie in programming with LibreOffice, not programming :)
I understand the code snippets written by lupp, yes, but I don't know exactly where to write this code. Is there a section in Libreoffice where I can write plugins?
LibreOffice : Version: 6.4.3.2 (x64)
ilker
 
Posts: 4
Joined: Thu May 21, 2020 2:41 pm
Location: Ankara / Türkiye

Re: Developing extension on LibreOffice for Pardus OS

Postby robleyd » Fri May 22, 2020 9:55 am

You might care to look at https://wiki.documentfoundation.org/Dev ... evelopment as a starting point; another useful reference will be the SDK and LO api pages.
Cheers
David
Apache OpenOffice 420m2(Build:9821) - Slackware 14.2 - 64 bit
LibreOffice 6.0.7.3 - Slackware 14.2 - 64 bit
Apache OpenOffice 4.1.4 - Windows 7 Virtual machine
User avatar
robleyd
Moderator
 
Posts: 3393
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Developing extension on LibreOffice for Pardus OS

Postby Lupp » Fri May 22, 2020 1:21 pm

Somebody may be interested in the example I made for myself (to refresh a little bit my poor knowledge in the xml field) with LibreOffice 6.4.3.2 (also tested with V 7.0.0.0.alpha1). AOO cannot run the code due to lacking used Calc functions.
There may be a way to get the xml stream with the help of the dispatcher...
On Windows 10: LibreOffice 7.0 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2896
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 3 guests