Git Product home page Git Product logo

external's Introduction

External sites

This application allows an admin to add a link in the Nextcloud web interface Apps menu that points to an external website. By simply entering the URL and the name for the external site, an icon appears. When this icon is clicked by a user, the external website appears in the Nextcloud frame. For the user, this external site appears as if it is part of Nextcloud but, in fact, this can be any external URL.

OCS API

It is also possible to get the sites via an OCS endpoint. The request must be authenticated. Only sites for the userΒ΄s language are returned:

curl  -H "OCS-APIRequest: true" \
  https://admin:admin@localhost/ocs/v2.php/apps/external/api/v1

Response

<?xml version="1.0"?>
<ocs>
 <meta>
  <status>ok</status>
  <statuscode>200</statuscode>
  <message>OK</message>
 </meta>
 <data>
  <element>
   <id>23</id>
   <name>Homepage</name>
   <url>https://localhost/index.php</url>
   <type>link</type>
   <redirect>0</redirect>
   <icon>https://localhost/external.svg</icon>
  </element>
 </data>
</ocs>

Explanation

Field Type Description
id int Numeric identifier of the site
name string Name of the site, ready to use
url string URL that should be framed/linked to
redirect int Whether the link should be opened inline or in a new window
type string Can be one of link, settings or quota; see this issue for details
icon string Full URL of the icon that should be shown next to the name of the link

ETag / If-None-Match

The API provides an ETag for the sites array. In case the ETag matches the given value, a 304 Not Modified is delivered together with an empty response body.

Capability

The app registers a capability, so clients can check that before making the actual OCS request:

<?xml version="1.0"?>
<ocs>
 ...
 <data>
  <capabilities>
   ...
   <external>
    <v1>
     <element>sites</element>
     <element>device</element>
     <element>groups</element>
     <element>redirect</element>
    </v1>
   </external>
   ...

external's People

Contributors

christophwurst avatar jancborchardt avatar juliushaertl avatar lukasreschke avatar mariusbluem avatar morrisjobke avatar nextcloud-bot avatar nickvergessen avatar pierreozoux avatar rullzer avatar skjnldsv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.