Skip to content

Template Files for WebOffice - #10276

Merged
micbar merged 1 commit into
masterfrom
templates
Oct 17, 2024
Merged

micbar merged 1 commit into
masterfrom
templates

Conversation

@micbar

@micbar micbar commented Oct 9, 2024 •

Copy link
Copy Markdown
Contributor

Description

Adds server-side template processing for WebOffice

We are supporting the following mime types:

OnlyOffice

  • MimeType: application/vnd.ms-word.template.macroenabled.12
    TargetExtension: docx

  • MimeType: application/vnd.oasis.opendocument.text-template
    TargetExtension: docx

  • MimeType: application/vnd.openxmlformats-officedocument.wordprocessingml.template
    TargetExtension: docx

  • MimeType: application/vnd.oasis.opendocument.spreadsheet-template
    TargetExtension: xlsx

  • MimeType: application/vnd.ms-excel.template.macroenabled.12
    TargetExtension: xlsx

  • MimeType: application/vnd.openxmlformats-officedocument.spreadsheetml.template
    TargetExtension: xlsx

  • MimeType: application/vnd.oasis.opendocument.presentation-template
    TargetExtension: pptx

  • MimeType: application/vnd.ms-powerpoint.template.macroenabled.12
    TargetExtension: pptx

  • MimeType: application/vnd.openxmlformats-officedocument.presentationml.template
    TargetExtension: pptx

Collabora

  • MimeType: application/vnd.oasis.opendocument.spreadsheet-template
    TargetExtension: ods

  • MimeType: application/vnd.oasis.opendocument.text-template
    TargetExtension: odt

  • MimeType: application/vnd.oasis.opendocument.presentation-template
    TargetExtension: odp

API

app/list

We have one new property.

target_ext- string with the suggested file extension when creating a new empty file from that template.

    {
      "mime_type": "application/vnd.oasis.opendocument.spreadsheet-template",
      "app_providers": [
        {
          "address": "com.owncloud.api.collaboration.OnlyOffice",
          "name": "OnlyOffice",
          "description": "Open office documents with Collabora",
          "icon": "https://onlyoffice.owncloud.test/web-apps/apps/documenteditor/main/resources/img/favicon.ico",
          "secure_view": false,
          "target_ext": "xlsx"
        }
      ]
    }

app/open

There is a new parameter template_id which takes a fileid. It should be used to specify the template which should be loaded during the open request.

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@update-docs

update-docs Bot commented Oct 9, 2024

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@kulmann

kulmann commented Oct 14, 2024

Copy link
Copy Markdown
Contributor

@micbar the target_ext field should live in the mime type struct, not in the app struct, right? I think it should look like this:

 {
      "mime_type": "application/vnd.oasis.opendocument.spreadsheet-template",
      "target_ext": "xlsx",
      "app_providers": [
        {
          "address": "com.owncloud.api.collaboration.OnlyOffice",
          "name": "OnlyOffice",
          "description": "Open office documents with Collabora",
          "icon": "https://onlyoffice.owncloud.test/web-apps/apps/documenteditor/main/resources/img/favicon.ico",
          "secure_view": false,
          "template": true
        }
      ]
    }

Maybe we should also rename template to something like template_conversion?

@micbar

micbar commented Oct 15, 2024

Copy link
Copy Markdown
Contributor Author

@micbar the target_ext field should live in the mime type struct, not in the app struct, right? I think it should look like this:

 {
      "mime_type": "application/vnd.oasis.opendocument.spreadsheet-template",
      "target_ext": "xlsx",
      "app_providers": [
        {
          "address": "com.owncloud.api.collaboration.OnlyOffice",
          "name": "OnlyOffice",
          "description": "Open office documents with Collabora",
          "icon": "https://onlyoffice.owncloud.test/web-apps/apps/documenteditor/main/resources/img/favicon.ico",
          "secure_view": false,
          "template": true
        }
      ]
    }

Maybe we should also rename template to something like template_conversion?

We agreed to remove template and keep target_ext

 {
      "mime_type": "application/vnd.oasis.opendocument.spreadsheet-template",
      "app_providers": [
        {
          "address": "com.owncloud.api.collaboration.OnlyOffice",
          "name": "OnlyOffice",
          "description": "Open office documents with Collabora",
          "icon": "https://onlyoffice.owncloud.test/web-apps/apps/documenteditor/main/resources/img/favicon.ico",
          "secure_view": false,
          "target_ext": "xlsx",
        }
      ]
    }

@micbar
micbar force-pushed the templates branch 7 times, most recently from 4f466bc to b760377 Compare October 16, 2024 14:47
@micbar
micbar marked this pull request as ready for review October 16, 2024 14:50

@jvillafanez jvillafanez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a couple of minor things from me.

Signed-off-by: Michael Barz <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Oct 17, 2024 •

Copy link
Copy Markdown

@micbar
micbar merged commit 8b27e42 into master Oct 17, 2024
@micbar
micbar deleted the templates branch October 17, 2024 07:43
ownclouders pushed a commit that referenced this pull request Oct 17, 2024
Template Files for WebOffice
@micbar micbar mentioned this pull request Oct 21, 2024
18 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

POC: Click on Template file -> Create Document (Web, Backend, mobile, desktop)

4 participants