 Hello! Today I will talk about LibRafisistika examples overhaul. I must say nurekha, the developer, came in the architect for the Document Foundation TDF. So, these are the contents that I will present today. After a short self-introduction, I will talk about LibRafisistika, its use cases, and the programming languages that can be used with it. Then we will talk about LibRafisistika examples. Most of these examples should be compiled and executed using shell scripts right now. And you have to use CYGVN on Windows. But it is also possible to use modern build tools like QMake and CMake, and that's what I'm talking about today. After talking a little bit, I will show you a demo. And after demo, we will talk about some of the future work, like porting examples from different languages to each other, and also adding QMake and CMake support to these examples. I must say nurekha, PhD in Information Technology. I am the developer community architect for the Document Foundation. I'm a developer, university lecturer and FOSS advocate. So, if you want to get started in LibRafis Development, you can contact me, and I will try to help you. My email is hossainathsignlibrafis.org, and you can also find me in IRC Room LibRafis Dev in Libra Chat Network by the name of Hossein. So, these are some of the use cases of LibRafisistika, which is essentially a part of LibRafis that helps you to communicate with LibRafis via its API. You can create applications that work with office formats, different office programs from different companies across the world. As you know, LibRafis supports many office formats from different companies from different countries. Also, you can write extensions that extend the functionalities of LibRafis. At last, just like the first use case, you can create converters that read and write different formats and convert them together. There are several programming languages that can be used with LibRafisistika. Python is a great choice because it's easy to set up. A Python interpreter is usually shipped with LibRafis, and you can write simple programs very fast and run test them easily. Also, you can use C++, and using C++ is important because it helps you to better understand the language that is used to write LibRafis itself. Also, Java is used. Many examples are in Java. LibRafis basic is something that is used inside LibRafis and is also used for communicating with LibRafis API. Dutton languages like Csharp and VB.net are also usable, but you should note that the latest Dutton core is not usable right now. Oil and Activix are also usable. So, what about examples? Examples showcase the LibRafisistika capabilities. They are there to show you the capabilities that Esteka can provide. There are many languages, most of them are in Java, but there are examples in Python, C++, etc., and they work with LibRafis through its API. So, a working LibRafis process should be present in order to be able to respond to the requests. And you should note that not all the LibRafis examples, Esteka examples, are extensions. Some of them are standalone applications that communicate with LibRafis. So, where to find them? These examples are distributed both with the LibRafis source code and also the binary distribution. So, if you go to LibRafis.org, you can download both LibRafis and Esteka. And if you use the source code, you can find odk.examples via core repository. And also there is a dedicated Esteka examples repository in git.librafis.org that contains some examples. If you have installed LibRafis and LibRafis.esteka, you can find esteka.examples folder that contains all of these examples. So, what do they do? They actually do various things. They focus on C++ examples today. So, I will talk about some of these examples. Document loader and draw are the LibRafis examples. You can find them inside odk.examples.cpp inside the source code and also they are shipped with LibRafis binary Esteka. And document loader essentially loads the sample document. The draw creates some circles and other drawings inside LibRafis draw and the last one converter is something that I've written and you can find it in my github page that you can see the address. It essentially converts odt or other file format to PDF. So, how to compile and run these examples? These are the instructions that are recommended today. But after that I will talk about using modern build tools. So, first of all you should run LibRafis if you are using the latest version. You should invoke LibRafis 7.2 but after that you should provide some options in order to make LibRafis listen to the incoming connections. As you can see, it's dash-accept equal circuit, port equal 2083, semicolon URP, semicolon. After that you should go to Esteka folder, cd slash OPT slash LibRafis 7.2 slash Esteka. Then you invoke the script that sets up the environment variable set Esteka ENV underline unix. Then you go to examples folder and invoke make. As you can see I'm trying to compile and execute document loader. And after that by invoking make document loader dot run I can actually run the example. So, this is the result of set Esteka ENV underline unix a script that is usable in Linux and Unix. So, as you can see the Esteka folder, the Office folder and the path to several utilities and also C++ compiler and Java are set here and also the output directory is inside your home directory. I don't use Java here so it's not used here. On Windows the instructions are somehow the same. First of all, you should invoke savis.exe with the same parameters. Then you can use the VS 2019 command prompt or you set the compiler path manually. I go to program files above Esteka in a terminal and after that I add the CYG Win binary path and after that I invoke set Esteka ENV underline windows dot path that sets the environment variables on Windows. You should be aware that in some situations when you try to run the examples it complains about the lack of merged LO dot DLL. So, if that happens you should set the URE underline bootstrap variable manually. It is essentially the path to the fundamental INI file on Windows and in Linux. It's the path to fundamental RC file. After that you go to the folder and invoke make and just like Linux, after that you invoke make document loader dot run. So, this is the result of setting up environment on Windows. As you can see the utilities are provided by CYG Win and the C++ compiler path points to Microsoft Visual Studio 2019 compiler. So, the requirements are essentially Librafis plus Esteka and also C++ compiler but there are a lot of other dependencies like makes, it can't set, etc. These are provided by CYG Win for Windows and a lot of things are done with shell scripts both the compilation and execution are done by the shell script to set up environment variables. But what about modern build tools? What if requirements would be only Librafis plus Esteka plus C++ compiler and a modern build tool like CMake or QMake? In fact, this is possible. The main benefit of using CMake is that you can use idea of your choice for development like Visual Studio, Visual Studio Code, Qt Creator, Xcode and many others. So, with CMake you don't have to rely on shell scripts but you can use these build tools inside your idea of your choice. But you should know that generating headers, setting up environment variables and running the applications are mostly done by CMake and QMake with some tricks. These are some of the environment variables that are used inside Librafis. Salyus VCL plugin is something that sets the UI that is used with Librafis. By using Gen or GTK or things like that you can set the desired UI. GenOpath is something that is used with some of the examples and I've discussed URE underline bootstrap and as you can see it points to the fundamental RC in Linux. So, let's see these things in action at demo. Let's see some of these examples. I've essentially copied some of these examples to this folder so that I can compile and run them inside this folder. Let's go to Document Loader example and I'm creating a build folder. I'm going inside it. I invoke CMake for the top folder and I invoke Make. Everything goes just fine but in order to be able to run this example first I should set URE bootstrap. So, URE bootstrap, I'm exporting the URE bootstrap equals to essentially the path name I've talked about. So, this is okay but I have to have a LibRafis process in order to work with it. So, I'm executing LibRafis with the parameters I've discussed and these are the examples I was working on before. So, after that I can see the binary here. I invoke it with one parameter that is the file I want to load. This is test.odt and as you can see the separate process, Document Loader could be able to load a file inside LibRafis. That's it. It worked just fine. But what if I don't want to use this environment variable? I don't want to build from command line. I can, as you see, export dash and URE bootstrap and as I'm searching for URE bootstrap I no longer see that it is set because I've used export dash and to un-export it. But I have to edit the file and add some things to this file. So, I go to the main as you can see. We're using some special main here and this is the line I have to add. As you can see, RTL bootstrap set is something that can be used to set this variable that is used inside this STECO application. Also, I have to include RTL slash bootstrap dot page XX. That's it. I invoke make and as you can see the document loader example was built just fine. If I start LibRafis again I can invoke this application. I should provide the file I want to load and as you can see it works just fine. So, it is possible to use CMake with these examples. Also, QMake can be used and I will show you this later. You can use QMake and CMake inside your favorite IDE and without relying on these scripts you can build and run the applications. Let's see another example. I go to the top folder I go to draw and I create a build folder I go inside it I invoke CMake and it configures just fine and it builds just fine. So, in order to run this example I have to set another environment variable. It is the unopath and as you can see it's the path to the LibRafis binaries. After that I just invoke draw. So, the fun fact here was that I didn't have a LibRafis process waiting for the command. So, this example uses another bootstrapping method that doesn't need a working LibRafis process but if there is no such process it actually invokes it and creates such process using the binaries. So, that's it. Please note that setting unopath is somehow different with the previous variable. You can also use commands that set this environment variable inside the C++ example but I'm not talking more about it. Let's take a look inside the CMake file that we have here. So, it essentially contains standard CMake commands. Here we have a low root variable that we use for setting different environment variables. We're essentially setting include directories and there are different include directories. Some of them are inside the root but some of them are created from the headers that we have inside our build folder. So, if we go to the end of file we will see that we are using cpb-oomercare to generate these headers from fapi.rdb. So, there are a lot of hair files now inside the build folder. Also, we are linking our application to some of the libraries that are available inside LibRuffice folder. So, that's it and it may look somehow complicated but it is essentially the same for different examples. Instructions for compiling and running these examples inside. Windows is not much different from Windows. First of all, I should run LibRuffice with the same parameters that I had in Linux and after that I can do the next steps. I go to I invoke setstacaenv underlinewindows.bat The parameters that you see here are set by me before. As you can see utilities are provided by CYGV and the C++ compiler is Microsoft 2019 compiler. After that I go to examples folder cpb and then document loader and I invoke make and as you can see I built this example before. So, I want to run the example but if the URE environment variable URE bootstrap is not set you will see that it will complain about the lack of mergedLO.dll. So, I set it and after that as you can see I can invoke make documentloader.run So, it essentially loads the file and because it is inside program files it is redundant that's it but as I've told you before it is possible to use IDEs like Qt Creator. So, let's use it. I will open an example LO converter that I've talked about before. It gets an odity file and converts it to PDF. It contains both the CMake file and also the .pro file that is used in QMake. So, let's run it it compiles them wrong so it says the LibRafis is not there So, let's start LibRafis first and then if you run it you can see that it says output tested PDF generated So, what is this file? Let's go to the source code If you look at the source code you see that it takes tested odity as the document URL and tested PDF as the PDF URL that is the output. Everything is set inside the program, the connection string your Ibootstrap, you don't have to set it inside common and the other functions and methods that are used to create the PDF So, let's see the Iboot in Output I just close the LibRafis and I open the test.bodity This is the same quality file and this is the output. So, as you could see we can use modern built tools like CMake and Qmake for compiling and running these examples and this has a lot of benefits we don't rely on command line to compile and run the applications you can do everything inside your IDE and you don't need CYGV in Windows I think this can be very helpful for those who want to develop using C++ and LibRafis I hope you have enjoyed the demo So, these are the future works The road ahead is described here This demo was only a proof of concept So, the same thing can be done for other examples and there are a lot of things remaining to do First of all, we can port other examples to different languages The draw example is in Java and in C++, the document loader is in Java, C++ and Python but not all of the examples are in every language This is defined as an easy hack so it means that you can help and also it is possible to add Qmake and CMake support for other examples At last, we talk about some of the recommended readings for LibRafis STK Our LibRafis programming is a book written by Dr. Andrew Davison and it is a great book that discusses various aspects of LibRafis STK and it uses Java Also, you should note that a lot of good documentation is found inside api.libRafis.org so every STK developer should refer to this address Also, inside this address api.libRafis.org you will find a lot of good descriptions about the tools that can be used for LibRafis STK development And the last one, LibRafis extension website is a place that you can find great extensions and their source code and this is something that can help you to create extensions by learning stuff from other extension developers and others that have used LibRafis API Thank you very much, that's it