@@ -234,13 +234,17 @@ func (p *wopiProvider) GetAppURL(ctx context.Context, resource *provider.Resourc
234234 }
235235 q .Add ("usertype" , string (ut ))
236236
237+ access := "view"
238+ if viewMode == appprovider .ViewMode_VIEW_MODE_EMBEDDED {
239+ access = "embedview"
240+ }
237241 var viewAppURL string
238- if viewAppURLs , ok := p .appURLs ["view" ]; ok {
242+ if viewAppURLs , ok := p .appURLs [access ]; ok {
239243 if viewAppURL , ok = viewAppURLs [ext ]; ok {
240244 q .Add ("appviewurl" , viewAppURL )
241245 }
242246 }
243- var access = "edit"
247+ access = "edit"
244248 if resource .GetSize () == 0 {
245249 if _ , ok := p .appURLs ["editnew" ]; ok {
246250 access = "editnew"
@@ -429,11 +433,13 @@ func getAppURLs(c *config) (map[string]map[string]string, error) {
429433 appURLs = make (map [string ]map [string ]string )
430434 appURLs ["view" ] = make (map [string ]string )
431435 appURLs ["edit" ] = make (map [string ]string )
436+ appURLs ["embedview" ] = make (map [string ]string )
432437 for _ , m := range c .MimeTypes {
433438 exts := mime .GetFileExts (m )
434439 for _ , e := range exts {
435440 appURLs ["view" ]["." + e ] = c .AppURL
436441 appURLs ["edit" ]["." + e ] = c .AppURL
442+ appURLs ["embedview" ]["." + e ] = c .AppURL
437443 }
438444 }
439445 }
@@ -474,7 +480,7 @@ func parseWopiDiscovery(body io.Reader) (map[string]map[string]string, error) {
474480 for _ , app := range netzone .SelectElements ("app" ) {
475481 for _ , action := range app .SelectElements ("action" ) {
476482 access := action .SelectAttrValue ("name" , "" )
477- if access == "view" || access == "edit" || access == "editnew" {
483+ if access == "view" || access == "edit" || access == "editnew" || access == "embedview" {
478484 ext := action .SelectAttrValue ("ext" , "" )
479485 urlString := action .SelectAttrValue ("urlsrc" , "" )
480486
0 commit comments