Page 1 of 1
Developing extension on LibreOffice for Pardus OS
Posted: Thu May 21, 2020 3:16 pm
by ilker
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.
Re: Developing extension on LibreOffice for Pardus OS
Posted: Thu May 21, 2020 3:39 pm
by Lupp
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()?
...
Re: Developing extension on LibreOffice for Pardus OS
Posted: Thu May 21, 2020 3:47 pm
by ilker
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.
Re: Developing extension on LibreOffice for Pardus OS
Posted: Thu May 21, 2020 8:30 pm
by Lupp
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
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
Re: Developing extension on LibreOffice for Pardus OS
Posted: Fri May 22, 2020 5:26 am
by robleyd
Also posted on
AskLibreOffice
Re: Developing extension on LibreOffice for Pardus OS
Posted: Fri May 22, 2020 8:42 am
by ilker
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
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.
Re: Developing extension on LibreOffice for Pardus OS
Posted: Fri May 22, 2020 9:11 am
by Zizi64
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.
Re: Developing extension on LibreOffice for Pardus OS
Posted: Fri May 22, 2020 9:16 am
by Zizi64
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.
Re: Developing extension on LibreOffice for Pardus OS
Posted: Fri May 22, 2020 9:28 am
by ilker
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?
Re: Developing extension on LibreOffice for Pardus OS
Posted: Fri May 22, 2020 9:55 am
by robleyd
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.
Re: Developing extension on LibreOffice for Pardus OS
Posted: Fri May 22, 2020 1:21 pm
by Lupp
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...