Repository: owncloud/ocis
Pull request #7781 (2023-11-22 10:37:22)

Add form mimetype
Enhancement: Add support for .docxf files

We have added the missing .docxf mime-type to the list of supported mime-types.

https://github.com/owncloud/ocis/issues/6989

update-docs[bot]: Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a [changelog](https://github.com/owncloud/ocis/blob/master/changelog/README.md) item based on your changes.


Patch:
diff --git a/deployments/examples/ocis_wopi/config/ocis/app-registry.yaml b/deployments/examples/ocis_wopi/config/ocis/app-registry.yaml
index 4cf4262a8ea..b7cf0decf9a 100644
--- a/deployments/examples/ocis_wopi/config/ocis/app-registry.yaml
+++ b/deployments/examples/ocis_wopi/config/ocis/app-registry.yaml
@@ -35,6 +35,13 @@ app_registry:
     icon: ''
     default_app: OnlyOffice
     allow_creation: true
+  - mime_type: application/vnd.openxmlformats-officedocument.wordprocessingml.form
+    extension: docxf
+    name: Form Document
+    description: Form Document
+    icon: ''
+    default_app: OnlyOffice
+    allow_creation: true
   - mime_type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
     extension: xlsx
     name: Microsoft Excel
diff --git a/go.mod b/go.mod
index 4b938333286..4dfd0002c31 100644
--- a/go.mod
+++ b/go.mod
@@ -13,7 +13,7 @@ require (
 	github.com/coreos/go-oidc v2.2.1+incompatible
 	github.com/coreos/go-oidc/v3 v3.7.0
 	github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781
-	github.com/cs3org/reva/v2 v2.16.1-0.20231121150727-6f872b2efd27
+	github.com/cs3org/reva/v2 v2.16.1-0.20231122103032-e6cbb1241c54
 	github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25
 	github.com/disintegration/imaging v1.6.2
 	github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
diff --git a/go.sum b/go.sum
index afeb7505cf7..3d549164e9b 100644
--- a/go.sum
+++ b/go.sum
@@ -1013,8 +1013,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c=
 github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME=
 github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781 h1:BUdwkIlf8IS2FasrrPg8gGPHQPOrQ18MS1Oew2tmGtY=
 github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
-github.com/cs3org/reva/v2 v2.16.1-0.20231121150727-6f872b2efd27 h1:eIwU0jW2qIwQHaAbV65ekUnJ5dwQhaIPdoX6tPKfKGA=
-github.com/cs3org/reva/v2 v2.16.1-0.20231121150727-6f872b2efd27/go.mod h1:utPCNSrWDdAwz2biLrKvzO6nDH9L7vRVGNzof13r8Kw=
+github.com/cs3org/reva/v2 v2.16.1-0.20231122103032-e6cbb1241c54 h1:oavpeTAA3FN0yKpgZHxY93Wry+7w5fRzcPH3EVcilmg=
+github.com/cs3org/reva/v2 v2.16.1-0.20231122103032-e6cbb1241c54/go.mod h1:utPCNSrWDdAwz2biLrKvzO6nDH9L7vRVGNzof13r8Kw=
 github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
diff --git a/services/app-registry/pkg/config/defaults/defaultconfig.go b/services/app-registry/pkg/config/defaults/defaultconfig.go
index 5cbc26c7153..121ea6eeb83 100644
--- a/services/app-registry/pkg/config/defaults/defaultconfig.go
+++ b/services/app-registry/pkg/config/defaults/defaultconfig.go
@@ -71,6 +71,13 @@ func defaultMimeTypeConfig() []config.MimeTypeConfig {
 			Description:   "Microsoft Word document",
 			AllowCreation: true,
 		},
+		{
+			MimeType:      "application/vnd.openxmlformats-officedocument.wordprocessingml.form",
+			Extension:     "docxf",
+			Name:          "Form Document",
+			Description:   "Form Document",
+			AllowCreation: true,
+		},
 		{
 			MimeType:      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
 			Extension:     "xlsx",
diff --git a/services/search/pkg/query/bleve/compiler.go b/services/search/pkg/query/bleve/compiler.go
index da6cbd07695..2d0eace100b 100644
--- a/services/search/pkg/query/bleve/compiler.go
+++ b/services/search/pkg/query/bleve/compiler.go
@@ -296,6 +296,7 @@ func mimeType(k, v string) (bleveQuery.Query, bool) {
 		return bleveQuery.NewDisjunctionQuery(newQueryStringQueryList(k,
 			"application/msword",
 			"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+			"application/vnd.openxmlformats-officedocument.wordprocessingml.form",
 			"application/vnd.oasis.opendocument.text",
 			"text/plain",
 			"text/markdown",
diff --git a/vendor/github.com/cs3org/reva/v2/pkg/mime/mime.go b/vendor/github.com/cs3org/reva/v2/pkg/mime/mime.go
index 91024917109..d2678b014b3 100644
--- a/vendor/github.com/cs3org/reva/v2/pkg/mime/mime.go
+++ b/vendor/github.com/cs3org/reva/v2/pkg/mime/mime.go
@@ -215,6 +215,7 @@ var mimeTypes = map[string]string{
 	"doc":                      "application/msword",
 	"docm":                     "application/vnd.ms-word.document.macroenabled.12",
 	"docx":                     "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
+	"docxf":                    "application/vnd.openxmlformats-officedocument.wordprocessingml.form",
 	"dot":                      "application/msword",
 	"dotm":                     "application/vnd.ms-word.template.macroenabled.12",
 	"dotx":                     "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
diff --git a/vendor/modules.txt b/vendor/modules.txt
index e01eb6e577f..7482585af25 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -357,7 +357,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1
 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1
 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1
 github.com/cs3org/go-cs3apis/cs3/types/v1beta1
-# github.com/cs3org/reva/v2 v2.16.1-0.20231121150727-6f872b2efd27
+# github.com/cs3org/reva/v2 v2.16.1-0.20231122103032-e6cbb1241c54
 ## explicit; go 1.20
 github.com/cs3org/reva/v2/cmd/revad/internal/grace
 github.com/cs3org/reva/v2/cmd/revad/runtime


Test patch:
diff --git a/services/search/pkg/query/bleve/compiler_test.go b/services/search/pkg/query/bleve/compiler_test.go
index f1e5fc307ac..597ce4c29e5 100644
--- a/services/search/pkg/query/bleve/compiler_test.go
+++ b/services/search/pkg/query/bleve/compiler_test.go
@@ -396,6 +396,7 @@ func Test_compile(t *testing.T) {
 			want: query.NewDisjunctionQuery([]query.Query{
 				query.NewQueryStringQuery(`MimeType:application/msword`),
 				query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.document`),
+				query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.form`),
 				query.NewQueryStringQuery(`MimeType:application/vnd.oasis.opendocument.text`),
 				query.NewQueryStringQuery(`MimeType:text/plain`),
 				query.NewQueryStringQuery(`MimeType:text/markdown`),
@@ -417,6 +418,7 @@ func Test_compile(t *testing.T) {
 				query.NewDisjunctionQuery([]query.Query{
 					query.NewQueryStringQuery(`MimeType:application/msword`),
 					query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.document`),
+					query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.form`),
 					query.NewQueryStringQuery(`MimeType:application/vnd.oasis.opendocument.text`),
 					query.NewQueryStringQuery(`MimeType:text/plain`),
 					query.NewQueryStringQuery(`MimeType:text/markdown`),
@@ -441,6 +443,7 @@ func Test_compile(t *testing.T) {
 			want: query.NewDisjunctionQuery([]query.Query{
 				query.NewQueryStringQuery(`MimeType:application/msword`),
 				query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.document`),
+				query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.form`),
 				query.NewQueryStringQuery(`MimeType:application/vnd.oasis.opendocument.text`),
 				query.NewQueryStringQuery(`MimeType:text/plain`),
 				query.NewQueryStringQuery(`MimeType:text/markdown`),
@@ -470,6 +473,7 @@ func Test_compile(t *testing.T) {
 				query.NewDisjunctionQuery([]query.Query{
 					query.NewQueryStringQuery(`MimeType:application/msword`),
 					query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.document`),
+					query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.form`),
 					query.NewQueryStringQuery(`MimeType:application/vnd.oasis.opendocument.text`),
 					query.NewQueryStringQuery(`MimeType:text/plain`),
 					query.NewQueryStringQuery(`MimeType:text/markdown`),
@@ -499,6 +503,7 @@ func Test_compile(t *testing.T) {
 					query.NewQueryStringQuery(`MimeType:application/pdf`),
 					query.NewQueryStringQuery(`MimeType:application/msword`),
 					query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.document`),
+					query.NewQueryStringQuery(`MimeType:application/vnd.openxmlformats-officedocument.wordprocessingml.form`),
 					query.NewQueryStringQuery(`MimeType:application/vnd.oasis.opendocument.text`),
 					query.NewQueryStringQuery(`MimeType:text/plain`),
 					query.NewQueryStringQuery(`MimeType:text/markdown`),