Skip to content

Commit

Permalink
Extensions for the AppProviders to improve the UI (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern authored Sep 22, 2021
1 parent 4967603 commit 5e29c7c
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 73 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ pull:

build: pull
docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-proto
# restore ownership of the `docs` folder as docker runs as root
chown -R `ls -ld . | awk '{print $$3 ":" $$4}'` docs
python: pull
docker run -v ${pwd}:/root/cs3apis cs3org/cs3apis cs3apis-build -build-python
go: pull
Expand Down
2 changes: 1 addition & 1 deletion cs3/app/provider/v1beta1/provider_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import "cs3/types/v1beta1/types.proto";
// Any method MAY return UNKNOWN.
// Any method MAY return UNAUTHENTICATED.
service ProviderAPI {
// Returns the App provider URL
// Returns the App URL and all necessary info to open a resource in an online editor.
// MUST return CODE_NOT_FOUND if the resource does not exist.
rpc OpenInApp(OpenInAppRequest) returns (OpenInAppResponse);
}
Expand Down
6 changes: 3 additions & 3 deletions cs3/app/registry/v1beta1/registry_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ service RegistryAPI {
rpc AddAppProvider(AddAppProviderRequest) returns (AddAppProviderResponse);
// Returns a list of the available app providers known by this registry.
rpc ListAppProviders(ListAppProvidersRequest) returns (ListAppProvidersResponse);
// Returns a list of the supported mime types along with the apps which they can opened with.
// Returns a list of the supported mime types along with the apps which they can be opened with.
rpc ListSupportedMimeTypes(ListSupportedMimeTypesRequest) returns (ListSupportedMimeTypesResponse);
// Returns the default app provider which serves a specified mime type.
rpc GetDefaultAppProviderForMimeType(GetDefaultAppProviderForMimeTypeRequest) returns (GetDefaultAppProviderForMimeTypeResponse);
Expand Down Expand Up @@ -136,8 +136,8 @@ message ListSupportedMimeTypesResponse {
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 2;
// REQUIRED.
// The list of supported mime types with the apps which they can be opened with.
map<string, AppProviderList> mime_types = 3;
// The list of supported mime types and their properties.
repeated MimeTypeInfo mime_types = 3;
}

message GetDefaultAppProviderForMimeTypeRequest {
Expand Down
48 changes: 39 additions & 9 deletions cs3/app/registry/v1beta1/resources.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,53 @@ message ProviderInfo {
// The address where the app provider can be reached.
// For example, tcp://localhost:1099.
string address = 3;
// REQUIRED.
// The capability of the underlying app.
enum Capability {
CAPABILITY_INVALID = 0;
// The app is a simple viewer.
CAPABILITY_VIEWER = 1;
// The app is a full editor.
CAPABILITY_EDITOR = 2;
}
Capability capability = 4;
// OPTIONAL.
// A human-readable name of the app provider.
string name = 4;
// A human-readable name of the underlying app.
string name = 5;
// OPTIONAL.
// Information to describe the functionalities
// offered by the app provider. Meant to be read
// offered by the underlying app. Meant to be read
// by humans.
string description = 5;
string description = 6;
// OPTIONAL.
// A URI to a static asset which represents the app icon.
string icon = 6;
string icon = 7;
// OPTIONAL.
// Whether the app can be opened only on desktop
bool desktop_only = 7;
bool desktop_only = 8;
}

// Holds a list of app providers which can open a particular mime type.
message AppProviderList {
repeated ProviderInfo app_providers = 1;
// Represents a mime type and its corresponding file extension.
message MimeTypeInfo {
// OPTIONAL.
// Opaque information.
cs3.types.v1beta1.Opaque opaque = 1;
// REQUIRED.
// The mime type.
string mime_type = 2;
// REQUIRED.
// The file extension mapped to this mime type.
string ext = 3;
// REQUIRED.
// The list of app providers which can open this mime type
repeated ProviderInfo app_providers = 4;
// OPTIONAL.
// The friendly name of this mime type.
string name = 5;
// OPTIONAL.
// Human-readable information to describe the mime type.
string description = 6;
// OPTIONAL.
// A URI to a static asset which represents the mime type icon.
string icon = 7;
}
3 changes: 2 additions & 1 deletion cs3/gateway/v1beta1/gateway_api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ service GatewayAPI {
// ************************ APP PROVIDER ********************/
// *****************************************************************/

// Returns the App provider URL, which allows the user to open a resource in an online editor.
// Returns the App URL and all necessary info to open a resource in an online editor.
// MUST return CODE_NOT_FOUND if the resource does not exist.
rpc OpenInApp(OpenInAppRequest) returns (cs3.app.provider.v1beta1.OpenInAppResponse);
// *****************************************************************/
// ************************ USER SHARE PROVIDER ********************/
Expand Down
147 changes: 101 additions & 46 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,6 @@ <h2>Table of Contents</h2>
<a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse"><span class="badge">M</span>ListSupportedMimeTypesResponse</a>
</li>

<li>
<a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.MimeTypesEntry"><span class="badge">M</span>ListSupportedMimeTypesResponse.MimeTypesEntry</a>
</li>

<li>
<a href="#cs3.app.registry.v1beta1.SetDefaultAppProviderForMimeTypeRequest"><span class="badge">M</span>SetDefaultAppProviderForMimeTypeRequest</a>
</li>
Expand All @@ -610,14 +606,18 @@ <h2>Table of Contents</h2>
<ul>

<li>
<a href="#cs3.app.registry.v1beta1.AppProviderList"><span class="badge">M</span>AppProviderList</a>
<a href="#cs3.app.registry.v1beta1.MimeTypeInfo"><span class="badge">M</span>MimeTypeInfo</a>
</li>

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


<li>
<a href="#cs3.app.registry.v1beta1.ProviderInfo.Capability"><span class="badge">E</span>ProviderInfo.Capability</a>
</li>



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

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

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

<tr>
<td>mime_types</td>
<td><a href="#cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.MimeTypesEntry">ListSupportedMimeTypesResponse.MimeTypesEntry</a></td>
<td><a href="#cs3.app.registry.v1beta1.MimeTypeInfo">MimeTypeInfo</a></td>
<td>repeated</td>
<td><p>REQUIRED.
The list of supported mime types with the apps which they can be opened with. </p></td>
</tr>

</tbody>
</table>





<h3 id="cs3.app.registry.v1beta1.ListSupportedMimeTypesResponse.MimeTypesEntry">ListSupportedMimeTypesResponse.MimeTypesEntry</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>key</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>value</td>
<td><a href="#cs3.app.registry.v1beta1.AppProviderList">AppProviderList</a></td>
<td></td>
<td><p> </p></td>
The list of supported mime types and their properties. </p></td>
</tr>

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

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


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


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

<tr>
<td>opaque</td>
<td><a href="#cs3.types.v1beta1.Opaque">cs3.types.v1beta1.Opaque</a></td>
<td></td>
<td><p>OPTIONAL.
Opaque information. </p></td>
</tr>

<tr>
<td>mime_type</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The mime type. </p></td>
</tr>

<tr>
<td>ext</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>REQUIRED.
The file extension mapped to this mime type. </p></td>
</tr>

<tr>
<td>app_providers</td>
<td><a href="#cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</a></td>
<td>repeated</td>
<td><p> </p></td>
<td><p>REQUIRED.
The list of app providers which can open this mime type </p></td>
</tr>

<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
The friendly name of this mime type. </p></td>
</tr>

<tr>
<td>description</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
Human-readable information to describe the mime type. </p></td>
</tr>

<tr>
<td>icon</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
A URI to a static asset which represents the mime type icon. </p></td>
</tr>

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

<tr>
<td>capability</td>
<td><a href="#cs3.app.registry.v1beta1.ProviderInfo.Capability">ProviderInfo.Capability</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>OPTIONAL.
A human-readable name of the app provider. </p></td>
A human-readable name of the underlying app. </p></td>
</tr>

<tr>
Expand All @@ -5881,7 +5907,7 @@ <h3 id="cs3.app.registry.v1beta1.ProviderInfo">ProviderInfo</h3>
<td></td>
<td><p>OPTIONAL.
Information to describe the functionalities
offered by the app provider. Meant to be read
offered by the underlying app. Meant to be read
by humans. </p></td>
</tr>

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



<h3 id="cs3.app.registry.v1beta1.ProviderInfo.Capability">ProviderInfo.Capability</h3>
<p>REQUIRED.</p><p>The capability of the underlying app.</p>
<table class="enum-table">
<thead>
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>CAPABILITY_INVALID</td>
<td>0</td>
<td><p></p></td>
</tr>

<tr>
<td>CAPABILITY_VIEWER</td>
<td>1</td>
<td><p>The app is a simple viewer.</p></td>
</tr>

<tr>
<td>CAPABILITY_EDITOR</td>
<td>2</td>
<td><p>The app is a full editor.</p></td>
</tr>

</tbody>
</table>




Expand Down
Loading

0 comments on commit 5e29c7c

Please sign in to comment.