mirror of
https://github.com/antos-rde/antosdk-apps.git
synced 2025-07-24 17:59:47 +02:00
add draft version of libreOffice
This commit is contained in:
15
LibreOffice/build/debug/README.md
Normal file
15
LibreOffice/build/debug/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Libre Office Onlie
|
||||
This is an example project, generated by AntOS Development Kit
|
||||
|
||||
## Howto
|
||||
Use the Antedit command palette to access to the SDK functionalities:
|
||||
|
||||
1. Create new project
|
||||
2. Init the project from the current folder located in side bar
|
||||
3. Build and run the project
|
||||
4. Release the project in zip package
|
||||
|
||||
## Set up build target
|
||||
|
||||
Open the `build.json` file from the current project tree and add/remove
|
||||
build target entries and jobs. Save the file
|
82
LibreOffice/build/debug/api/api.lua
Normal file
82
LibreOffice/build/debug/api/api.lua
Normal file
@ -0,0 +1,82 @@
|
||||
local args=...
|
||||
if not args then
|
||||
args = REQUEST
|
||||
end
|
||||
local vfs = require("vfs")
|
||||
local DLCMD="wget --no-check-certificate -O"
|
||||
local handle = {}
|
||||
|
||||
local result = function(data)
|
||||
return { error = false, result = data }
|
||||
end
|
||||
|
||||
local error = function(msg)
|
||||
return {error = msg, result = false}
|
||||
end
|
||||
|
||||
handle.token = function(data)
|
||||
local file = vfs.ospath(data.file)
|
||||
local stat = ulib.file_stat(file)
|
||||
local ret = {
|
||||
sid = "access_token="..SESSION.sessionid,
|
||||
key = std.sha1(file..":"..stat.mtime)
|
||||
}
|
||||
return result(ret)
|
||||
end
|
||||
|
||||
handle.discover = function(data)
|
||||
local tmpfile = "/tmp/libreoffice_discover.xml"
|
||||
local cmd = DLCMD.." "..tmpfile..' '..data.uri
|
||||
os.execute(cmd)
|
||||
-- move file to correct position
|
||||
if ulib.exists(tmpfile) then
|
||||
local f = assert(io.open(tmpfile, "rb"))
|
||||
local content = f:read("*all")
|
||||
f:close()
|
||||
return result(content)
|
||||
else
|
||||
return error("Unable to discover data")
|
||||
end
|
||||
end
|
||||
|
||||
handle.file = function(data)
|
||||
local rq = REQUEST.r
|
||||
if not rq then
|
||||
return error("Unknown request")
|
||||
end
|
||||
local ret, stat = vfs.fileinfo(data.file)
|
||||
if not ret then
|
||||
return error("Unable to query file info")
|
||||
end
|
||||
local path = vfs.ospath(data.file)
|
||||
if rq:match("/wopi/files/[^/]*/contents$") then
|
||||
if REQUEST.method == "GET" then
|
||||
std.sendFile(path)
|
||||
return nil
|
||||
elseif REQUEST.method == "POST" then
|
||||
local clen = tonumber(HEADER['Content-Length'])
|
||||
local barr = bytes.unew(REQUEST["octet-stream"],clen)
|
||||
bytes.write(barr, path)
|
||||
return result(true)
|
||||
else
|
||||
return error("Unknown request method")
|
||||
end
|
||||
elseif rq:match("/wopi/files/[^/]*$") then
|
||||
return {
|
||||
BaseFileName = stat.name,
|
||||
Size = math.floor(stat.size),
|
||||
UserCanWrite = vfs.checkperm(data.file,"write"),
|
||||
mime = stat.mime,
|
||||
PostMessageOrigin = "*"
|
||||
}
|
||||
else
|
||||
return error("Unknown request")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if args.action and handle[args.action] then
|
||||
return handle[args.action](args.args)
|
||||
else
|
||||
return error("Invalid action parameter")
|
||||
end
|
8
LibreOffice/build/debug/main.css
Normal file
8
LibreOffice/build/debug/main.css
Normal file
@ -0,0 +1,8 @@
|
||||
afx-app-window[data-id="LibreOffice"] div[data-id="editor-area"] p{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
afx-app-window[data-id="LibreOffice"] div[data-id="editor-area"] button {
|
||||
width: 250px;
|
||||
|
||||
}
|
1
LibreOffice/build/debug/main.js
Normal file
1
LibreOffice/build/debug/main.js
Normal file
File diff suppressed because one or more lines are too long
26
LibreOffice/build/debug/package.json
Normal file
26
LibreOffice/build/debug/package.json
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"pkgname": "LibreOffice",
|
||||
"app":"LibreOffice",
|
||||
"name":"Libre Office Online",
|
||||
"description":"Wrapper for Libre Office Online service",
|
||||
"info":{
|
||||
"author": "Dany LE",
|
||||
"email": "contact@iohub.dev"
|
||||
},
|
||||
"version":"0.1.0-a",
|
||||
"category":"Office",
|
||||
"iconclass":"bi bi-person-workspace",
|
||||
"mimes":[
|
||||
"application/vnd.oasis.opendocument.text",
|
||||
"application/vnd.oasis.opendocument.spreadsheet",
|
||||
"application/vnd.oasis.opendocument.presentation",
|
||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
||||
"application/msword",
|
||||
"application/vnd.ms-excel",
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
||||
"application/vnd.ms-powerpoint",
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
||||
],
|
||||
"dependencies":[],
|
||||
"locale": {}
|
||||
}
|
19
LibreOffice/build/debug/scheme.html
Normal file
19
LibreOffice/build/debug/scheme.html
Normal file
@ -0,0 +1,19 @@
|
||||
<afx-app-window apptitle="Libre Office Online" width="700" height="500" data-id="LibreOffice" blur-overlay="true">
|
||||
<afx-hbox >
|
||||
<div data-id="editor-area">
|
||||
<p>
|
||||
<afx-button data-id="btn-open-file" text="__(Open file)" iconclass="fa fa-folder-open" ></afx-button>
|
||||
</p>
|
||||
<p>
|
||||
<afx-button data-id="btn-new-doc" text="__(Create Document)" iconclass="fa fa-file-word-o"></afx-button>
|
||||
</p>
|
||||
<p>
|
||||
<afx-button data-id="btn-new-cell" text="__(Create Spreadsheet)" iconclass="fa fa-file-excel-o"></afx-button>
|
||||
</p>
|
||||
<p>
|
||||
<afx-button data-id="btn-new-slide" text="__(Create Presentation)" iconclass="fa fa-file-powerpoint-o"></afx-button>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</afx-hbox>
|
||||
</afx-app-window>
|
BIN
LibreOffice/build/debug/templates/model.docx
Normal file
BIN
LibreOffice/build/debug/templates/model.docx
Normal file
Binary file not shown.
BIN
LibreOffice/build/debug/templates/model.pptx
Normal file
BIN
LibreOffice/build/debug/templates/model.pptx
Normal file
Binary file not shown.
BIN
LibreOffice/build/debug/templates/model.xlsx
Normal file
BIN
LibreOffice/build/debug/templates/model.xlsx
Normal file
Binary file not shown.
BIN
LibreOffice/build/release/LibreOffice.zip
Normal file
BIN
LibreOffice/build/release/LibreOffice.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user