Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Bookmarks Plugin

Bernhard Posselt edited this page Apr 19, 2016 · 10 revisions

This should be implemented using a clientside plugin, see https://github.com/owncloud/news/wiki/How-to-write-Plugins#clientside-plugin

Take a look at the share via mail plugin if you want to check out a real world client side plugin example.

After clicking a bookmarks icon button (first idea: simply copy the bookmarks app's icon) it should send a request to the bookmarks app looking like this:

POST /apps/bookmarks/bookmarks

{
  "url": article.url,
  "name": article.title
}

The following cases for the response exist:

  • Success (HTTP 200-299)
  • Error (HTTP 400-599)

A successful request should probably show a notification using the notification API (I'm not sure about this yet).

Error messages should be shown using the ownCloud notification API:

var text = $('<p>').text('error message goes here').html();
OC.Notification.showTemporary(text);

The Bookmarks app does not expose an API for this yet but there is an open issue:https://github.com/owncloud/bookmarks/issues/215

Implementation Hints

The URL to the bookmarks app can be generated like this:

OC.generateUrl('/apps/bookmarks');

Related Issues

Clone this wiki locally