Skip to content

Commit 5e29c7c

Browse files
authored
Extensions for the AppProviders to improve the UI (#145)
1 parent 4967603 commit 5e29c7c

File tree

7 files changed

+214
-73
lines changed

7 files changed

+214
-73
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ pull:
88

99
build: pull
1010
docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-proto
11+
# restore ownership of the `docs` folder as docker runs as root
12+
chown -R `ls -ld . | awk '{print $$3 ":" $$4}'` docs
1113
python: pull
1214
docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-python
1315
go: pull

cs3/app/provider/v1beta1/provider_api.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import "cs3/types/v1beta1/types.proto";
5353
// Any method MAY return UNKNOWN.
5454
// Any method MAY return UNAUTHENTICATED.
5555
service ProviderAPI {
56-
// Returns the App provider URL
56+
// Returns the App URL and all necessary info to open a resource in an online editor.
5757
// MUST return CODE_NOT_FOUND if the resource does not exist.
5858
rpc OpenInApp(OpenInAppRequest) returns (OpenInAppResponse);
5959
}

cs3/app/registry/v1beta1/registry_api.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ service RegistryAPI {
5757
rpc AddAppProvider(AddAppProviderRequest) returns (AddAppProviderResponse);
5858
// Returns a list of the available app providers known by this registry.
5959
rpc ListAppProviders(ListAppProvidersRequest) returns (ListAppProvidersResponse);
60-
// Returns a list of the supported mime types along with the apps which they can opened with.
60+
// Returns a list of the supported mime types along with the apps which they can be opened with.
6161
rpc ListSupportedMimeTypes(ListSupportedMimeTypesRequest) returns (ListSupportedMimeTypesResponse);
6262
// Returns the default app provider which serves a specified mime type.
6363
rpc GetDefaultAppProviderForMimeType(GetDefaultAppProviderForMimeTypeRequest) returns (GetDefaultAppProviderForMimeTypeResponse);
@@ -136,8 +136,8 @@ message ListSupportedMimeTypesResponse {
136136
// Opaque information.
137137
cs3.types.v1beta1.Opaque opaque = 2;
138138
// REQUIRED.
139-
// The list of supported mime types with the apps which they can be opened with.
140-
map<string, AppProviderList> mime_types = 3;
139+
// The list of supported mime types and their properties.
140+
repeated MimeTypeInfo mime_types = 3;
141141
}
142142

143143
message GetDefaultAppProviderForMimeTypeRequest {

cs3/app/registry/v1beta1/resources.proto

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,53 @@ message ProviderInfo {
4242
// The address where the app provider can be reached.
4343
// For example, tcp://localhost:1099.
4444
string address = 3;
45+
// REQUIRED.
46+
// The capability of the underlying app.
47+
enum Capability {
48+
CAPABILITY_INVALID = 0;
49+
// The app is a simple viewer.
50+
CAPABILITY_VIEWER = 1;
51+
// The app is a full editor.
52+
CAPABILITY_EDITOR = 2;
53+
}
54+
Capability capability = 4;
4555
// OPTIONAL.
46-
// A human-readable name of the app provider.
47-
string name = 4;
56+
// A human-readable name of the underlying app.
57+
string name = 5;
4858
// OPTIONAL.
4959
// Information to describe the functionalities
50-
// offered by the app provider. Meant to be read
60+
// offered by the underlying app. Meant to be read
5161
// by humans.
52-
string description = 5;
62+
string description = 6;
5363
// OPTIONAL.
5464
// A URI to a static asset which represents the app icon.
55-
string icon = 6;
65+
string icon = 7;
5666
// OPTIONAL.
5767
// Whether the app can be opened only on desktop
58-
bool desktop_only = 7;
68+
bool desktop_only = 8;
5969
}
6070

61-
// Holds a list of app providers which can open a particular mime type.
62-
message AppProviderList {
63-
repeated ProviderInfo app_providers = 1;
71+
// Represents a mime type and its corresponding file extension.
72+
message MimeTypeInfo {
73+
// OPTIONAL.
74+
// Opaque information.
75+
cs3.types.v1beta1.Opaque opaque = 1;
76+
// REQUIRED.
77+
// The mime type.
78+
string mime_type = 2;
79+
// REQUIRED.
80+
// The file extension mapped to this mime type.
81+
string ext = 3;
82+
// REQUIRED.
83+
// The list of app providers which can open this mime type
84+
repeated ProviderInfo app_providers = 4;
85+
// OPTIONAL.
86+
// The friendly name of this mime type.
87+
string name = 5;
88+
// OPTIONAL.
89+
// Human-readable information to describe the mime type.
90+
string description = 6;
91+
// OPTIONAL.
92+
// A URI to a static asset which represents the mime type icon.
93+
string icon = 7;
6494
}

cs3/gateway/v1beta1/gateway_api.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ service GatewayAPI {
179179
// ************************ APP PROVIDER ********************/
180180
// *****************************************************************/
181181

182-
// Returns the App provider URL, which allows the user to open a resource in an online editor.
182+
// Returns the App URL and all necessary info to open a resource in an online editor.
183+
// MUST return CODE_NOT_FOUND if the resource does not exist.
183184
rpc OpenInApp(OpenInAppRequest) returns (cs3.app.provider.v1beta1.OpenInAppResponse);
184185
// *****************************************************************/
185186
// ************************ USER SHARE PROVIDER ********************/

docs/index.html

Lines changed: 101 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,6 @@ <h2>Table of Contents</h2>
582582
<a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse"><span class="badge">M</span>ListSupportedMimeTypesResponse</a>
583583
</li>
584584

585-
<li>
586-
<a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.MimeTypesEntry"><span class="badge">M</span>ListSupportedMimeTypesResponse.MimeTypesEntry</a>
587-
</li>
588-
589585
<li>
590586
<a href="#cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeRequest"><span class="badge">M</span>SetDefaultAppProviderForMimeTypeRequest</a>
591587
</li>
@@ -610,14 +606,18 @@ <h2>Table of Contents</h2>
610606
<ul>
611607

612608
<li>
613-
<a href="#cs3.app.registry.v1beta1.AppProviderList"><span class="badge">M</span>AppProviderList</a>
609+
<a href="#cs3.app.registry.v1beta1.MimeTypeInfo"><span class="badge">M</span>MimeTypeInfo</a>
614610
</li>
615611

616612
<li>
617613
<a href="#cs3.app.registry.v1beta1.ProviderInfo"><span class="badge">M</span>ProviderInfo</a>
618614
</li>
619615

620616

617+
<li>
618+
<a href="#cs3.app.registry.v1beta1.ProviderInfo.Capability"><span class="badge">E</span>ProviderInfo.Capability</a>
619+
</li>
620+
621621

622622

623623
</ul>
@@ -2779,7 +2779,8 @@ <h3 id="cs3.gateway.v1beta1.GatewayAPI">GatewayAPI</h3>
27792779
<td>OpenInApp</td>
27802780
<td><a href="#cs3.gateway.v1beta1.OpenInAppRequest">OpenInAppRequest</a></td>
27812781
<td><a href="#cs3.app.provider.v1beta1.OpenInAppResponse">.cs3.app.provider.v1beta1.OpenInAppResponse</a></td>
2782-
<td><p>Returns the App provider URL, which allows the user to open a resource in an online editor.
2782+
<td><p>Returns the App URL and all necessary info to open a resource in an online editor.
2783+
MUST return CODE_NOT_FOUND if the resource does not exist.
27832784

27842785
*****************************************************************/
27852786
************************ USER SHARE PROVIDER ********************/
@@ -5145,7 +5146,7 @@ <h3 id="cs3.app.provider.v1beta1.ProviderAPI">ProviderAPI</h3>
51455146
<td>OpenInApp</td>
51465147
<td><a href="#cs3.app.provider.v1beta1.OpenInAppRequest">OpenInAppRequest</a></td>
51475148
<td><a href="#cs3.app.provider.v1beta1.OpenInAppResponse">OpenInAppResponse</a></td>
5148-
<td><p>Returns the App provider URL
5149+
<td><p>Returns the App URL and all necessary info to open a resource in an online editor.
51495150
MUST return CODE_NOT_FOUND if the resource does not exist.</p></td>
51505151
</tr>
51515152

@@ -5621,41 +5622,10 @@ <h3 id="cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse">ListSupportedMi
56215622

56225623
<tr>
56235624
<td>mime_types</td>
5624-
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.MimeTypesEntry">ListSupportedMimeTypesResponse.MimeTypesEntry</a></td>
5625+
<td><a href="#cs3.app.registry.v1beta1.MimeTypeInfo">MimeTypeInfo</a></td>
56255626
<td>repeated</td>
56265627
<td><p>REQUIRED.
5627-
The list of supported mime types with the apps which they can be opened with. </p></td>
5628-
</tr>
5629-
5630-
</tbody>
5631-
</table>
5632-
5633-
5634-
5635-
5636-
5637-
<h3 id="cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.MimeTypesEntry">ListSupportedMimeTypesResponse.MimeTypesEntry</h3>
5638-
<p></p>
5639-
5640-
5641-
<table class="field-table">
5642-
<thead>
5643-
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
5644-
</thead>
5645-
<tbody>
5646-
5647-
<tr>
5648-
<td>key</td>
5649-
<td><a href="#string">string</a></td>
5650-
<td></td>
5651-
<td><p> </p></td>
5652-
</tr>
5653-
5654-
<tr>
5655-
<td>value</td>
5656-
<td><a href="#cs3.app.registry.v1beta1.AppProviderList">AppProviderList</a></td>
5657-
<td></td>
5658-
<td><p> </p></td>
5628+
The list of supported mime types and their properties. </p></td>
56595629
</tr>
56605630

56615631
</tbody>
@@ -5779,7 +5749,7 @@ <h3 id="cs3.app.registry.v1beta1.RegistryAPI">RegistryAPI</h3>
57795749
<td>ListSupportedMimeTypes</td>
57805750
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesRequest">ListSupportedMimeTypesRequest</a></td>
57815751
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse">ListSupportedMimeTypesResponse</a></td>
5782-
<td><p>Returns a list of the supported mime types along with the apps which they can opened with.</p></td>
5752+
<td><p>Returns a list of the supported mime types along with the apps which they can be opened with.</p></td>
57835753
</tr>
57845754

57855755
<tr>
@@ -5808,8 +5778,8 @@ <h2 id="cs3/app/registry/v1beta1/resources.proto">cs3/app/registry/v1beta1/resou
58085778
<p></p>
58095779

58105780

5811-
<h3 id="cs3.app.registry.v1beta1.AppProviderList">AppProviderList</h3>
5812-
<p>Holds a list of app providers which can open a particular mime type.</p>
5781+
<h3 id="cs3.app.registry.v1beta1.MimeTypeInfo">MimeTypeInfo</h3>
5782+
<p>Represents a mime type and its corresponding file extension.</p>
58135783

58145784

58155785
<table class="field-table">
@@ -5818,11 +5788,60 @@ <h3 id="cs3.app.registry.v1beta1.AppProviderList">AppProviderList</h3>
58185788
</thead>
58195789
<tbody>
58205790

5791+
<tr>
5792+
<td>opaque</td>
5793+
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
5794+
<td></td>
5795+
<td><p>OPTIONAL.
5796+
Opaque information. </p></td>
5797+
</tr>
5798+
5799+
<tr>
5800+
<td>mime_type</td>
5801+
<td><a href="#string">string</a></td>
5802+
<td></td>
5803+
<td><p>REQUIRED.
5804+
The mime type. </p></td>
5805+
</tr>
5806+
5807+
<tr>
5808+
<td>ext</td>
5809+
<td><a href="#string">string</a></td>
5810+
<td></td>
5811+
<td><p>REQUIRED.
5812+
The file extension mapped to this mime type. </p></td>
5813+
</tr>
5814+
58215815
<tr>
58225816
<td>app_providers</td>
58235817
<td><a href="#cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</a></td>
58245818
<td>repeated</td>
5825-
<td><p> </p></td>
5819+
<td><p>REQUIRED.
5820+
The list of app providers which can open this mime type </p></td>
5821+
</tr>
5822+
5823+
<tr>
5824+
<td>name</td>
5825+
<td><a href="#string">string</a></td>
5826+
<td></td>
5827+
<td><p>OPTIONAL.
5828+
The friendly name of this mime type. </p></td>
5829+
</tr>
5830+
5831+
<tr>
5832+
<td>description</td>
5833+
<td><a href="#string">string</a></td>
5834+
<td></td>
5835+
<td><p>OPTIONAL.
5836+
Human-readable information to describe the mime type. </p></td>
5837+
</tr>
5838+
5839+
<tr>
5840+
<td>icon</td>
5841+
<td><a href="#string">string</a></td>
5842+
<td></td>
5843+
<td><p>OPTIONAL.
5844+
A URI to a static asset which represents the mime type icon. </p></td>
58265845
</tr>
58275846

58285847
</tbody>
@@ -5867,12 +5886,19 @@ <h3 id="cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</h3>
58675886
For example, tcp://localhost:1099. </p></td>
58685887
</tr>
58695888

5889+
<tr>
5890+
<td>capability</td>
5891+
<td><a href="#cs3.app.registry.v1beta1.ProviderInfo.Capability">ProviderInfo.Capability</a></td>
5892+
<td></td>
5893+
<td><p> </p></td>
5894+
</tr>
5895+
58705896
<tr>
58715897
<td>name</td>
58725898
<td><a href="#string">string</a></td>
58735899
<td></td>
58745900
<td><p>OPTIONAL.
5875-
A human-readable name of the app provider. </p></td>
5901+
A human-readable name of the underlying app. </p></td>
58765902
</tr>
58775903

58785904
<tr>
@@ -5881,7 +5907,7 @@ <h3 id="cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</h3>
58815907
<td></td>
58825908
<td><p>OPTIONAL.
58835909
Information to describe the functionalities
5884-
offered by the app provider. Meant to be read
5910+
offered by the underlying app. Meant to be read
58855911
by humans. </p></td>
58865912
</tr>
58875913

@@ -5910,6 +5936,35 @@ <h3 id="cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</h3>
59105936

59115937

59125938

5939+
<h3 id="cs3.app.registry.v1beta1.ProviderInfo.Capability">ProviderInfo.Capability</h3>
5940+
<p>REQUIRED.</p><p>The capability of the underlying app.</p>
5941+
<table class="enum-table">
5942+
<thead>
5943+
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
5944+
</thead>
5945+
<tbody>
5946+
5947+
<tr>
5948+
<td>CAPABILITY_INVALID</td>
5949+
<td>0</td>
5950+
<td><p></p></td>
5951+
</tr>
5952+
5953+
<tr>
5954+
<td>CAPABILITY_VIEWER</td>
5955+
<td>1</td>
5956+
<td><p>The app is a simple viewer.</p></td>
5957+
</tr>
5958+
5959+
<tr>
5960+
<td>CAPABILITY_EDITOR</td>
5961+
<td>2</td>
5962+
<td><p>The app is a full editor.</p></td>
5963+
</tr>
5964+
5965+
</tbody>
5966+
</table>
5967+
59135968

59145969

59155970

0 commit comments

Comments
 (0)