summaryrefslogtreecommitdiffstats
path: root/features/plugins/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'features/plugins/index.html')
-rw-r--r--features/plugins/index.html836
1 files changed, 836 insertions, 0 deletions
diff --git a/features/plugins/index.html b/features/plugins/index.html
new file mode 100644
index 000000000..6c2b59dd8
--- /dev/null
+++ b/features/plugins/index.html
@@ -0,0 +1,836 @@
+
+<!doctype html>
+<html lang="en" class="no-js">
+ <head>
+
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width,initial-scale=1">
+
+ <meta name="description" content="Documentation for the Nextcloud News App">
+
+
+ <meta name="author" content="Nextcloud News Team">
+
+
+ <link rel="canonical" href="https://nextcloud.github.io/news/features/plugins/">
+
+
+ <link rel="prev" href="../customCSS/">
+
+
+ <link rel="next" href="../themes/">
+
+ <link rel="icon" href="../../assets/favicon.png">
+ <meta name="generator" content="mkdocs-1.4.2, mkdocs-material-9.0.6">
+
+
+
+ <title>Plugins - Nextcloud News App</title>
+
+
+
+ <link rel="stylesheet" href="../../assets/stylesheets/main.558e4712.min.css">
+
+
+ <link rel="stylesheet" href="../../assets/stylesheets/palette.2505c338.min.css">
+
+
+
+
+
+
+
+
+
+ <script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
+
+
+
+
+
+
+ </head>
+
+
+
+
+
+
+
+
+
+ <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo">
+
+
+
+ <script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
+
+ <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
+ <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
+ <label class="md-overlay" for="__drawer"></label>
+ <div data-md-component="skip">
+
+
+ <a href="#plugins" class="md-skip">
+ Skip to content
+ </a>
+
+ </div>
+ <div data-md-component="announce">
+
+ </div>
+
+
+
+
+<header class="md-header" data-md-component="header">
+ <nav class="md-header__inner md-grid" aria-label="Header">
+ <a href="../.." title="Nextcloud News App" class="md-header__button md-logo" aria-label="Nextcloud News App" data-md-component="logo">
+
+ <img src="../../assets/logo.svg" alt="logo">
+
+ </a>
+ <label class="md-header__button md-icon" for="__drawer">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
+ </label>
+ <div class="md-header__title" data-md-component="header-title">
+ <div class="md-header__ellipsis">
+ <div class="md-header__topic">
+ <span class="md-ellipsis">
+ Nextcloud News App
+ </span>
+ </div>
+ <div class="md-header__topic" data-md-component="header-topic">
+ <span class="md-ellipsis">
+
+ Plugins
+
+ </span>
+ </div>
+ </div>
+ </div>
+
+ <form class="md-header__option" data-md-component="palette">
+
+
+ <input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">
+
+ <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
+ </label>
+
+
+
+ <input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_2">
+
+ <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h10a5 5 0 0 0 5-5 5 5 0 0 0-5-5m0 8a3 3 0 0 1-3-3 3 3 0 0 1 3-3 3 3 0 0 1 3 3 3 3 0 0 1-3 3Z"/></svg>
+ </label>
+
+
+ </form>
+
+
+
+ <label class="md-header__button md-icon" for="__search">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
+ </label>
+ <div class="md-search" data-md-component="search" role="dialog">
+ <label class="md-search__overlay" for="__search"></label>
+ <div class="md-search__inner" role="search">
+ <form class="md-search__form" name="search">
+ <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
+ <label class="md-search__icon md-icon" for="__search">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
+ </label>
+ <nav class="md-search__options" aria-label="Search">
+
+ <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
+ </button>
+ </nav>
+
+ </form>
+ <div class="md-search__output">
+ <div class="md-search__scrollwrap" data-md-scrollfix>
+ <div class="md-search-result" data-md-component="search-result">
+ <div class="md-search-result__meta">
+ Initializing search
+ </div>
+ <ol class="md-search-result__list" role="presentation"></ol>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+ <div class="md-header__source">
+ <a href="https://github.com/nextcloud/news" title="Go to repository" class="md-source" data-md-component="source">
+ <div class="md-source__icon md-icon">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
+ </div>
+ <div class="md-source__repository">
+ GitHub
+ </div>
+</a>
+ </div>
+
+ </nav>
+
+</header>
+
+ <div class="md-container" data-md-component="container">
+
+
+
+
+
+
+ <main class="md-main" data-md-component="main">
+ <div class="md-main__inner md-grid">
+
+
+
+ <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+
+<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
+ <label class="md-nav__title" for="__drawer">
+ <a href="../.." title="Nextcloud News App" class="md-nav__button md-logo" aria-label="Nextcloud News App" data-md-component="logo">
+
+ <img src="../../assets/logo.svg" alt="logo">
+
+ </a>
+ Nextcloud News App
+ </label>
+
+ <div class="md-nav__source">
+ <a href="https://github.com/nextcloud/news" title="Go to repository" class="md-source" data-md-component="source">
+ <div class="md-source__icon md-icon">
+
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
+ </div>
+ <div class="md-source__repository">
+ GitHub
+ </div>
+</a>
+ </div>
+
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../.." class="md-nav__link">
+ Introduction
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../install/" class="md-nav__link">
+ Installation/Update & Uninstall
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../clients/" class="md-nav__link">
+ Clients
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../admin/" class="md-nav__link">
+ Admin
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../developer/" class="md-nav__link">
+ Developer
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../troubleshooting/" class="md-nav__link">
+ Troubleshooting
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
+
+
+
+
+ <input class="md-nav__toggle md-toggle " data-md-toggle="__nav_7" type="checkbox" id="__nav_7" checked>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <label class="md-nav__link" for="__nav_7" tabindex="0" aria-expanded="true">
+ Features
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" aria-label="Features" data-md-level="1">
+ <label class="md-nav__title" for="__nav_7">
+ <span class="md-nav__icon md-icon"></span>
+ Features
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../integration/" class="md-nav__link">
+ Integration
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../customCSS/" class="md-nav__link">
+ Custom CSS
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active">
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
+
+
+
+
+
+ <label class="md-nav__link md-nav__link--active" for="__toc">
+ Plugins
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <a href="./" class="md-nav__link md-nav__link--active">
+ Plugins
+ </a>
+
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#the-basics" class="md-nav__link">
+ The Basics
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#server-side-plugin" class="md-nav__link">
+ Server-Side Plugin
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../themes/" class="md-nav__link">
+ Themes
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--section md-nav__item--nested">
+
+
+
+
+
+
+ <input class="md-nav__toggle md-toggle md-toggle--indeterminate" data-md-toggle="__nav_8" type="checkbox" id="__nav_8" >
+
+
+
+
+
+
+
+
+
+
+
+ <label class="md-nav__link" for="__nav_8" tabindex="0" aria-expanded="false">
+ REST API
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <nav class="md-nav" aria-label="REST API" data-md-level="1">
+ <label class="md-nav__title" for="__nav_8">
+ <span class="md-nav__icon md-icon"></span>
+ REST API
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../api/api-v1-2/" class="md-nav__link">
+ API v1.2
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../api/api-v1-3/" class="md-nav__link">
+ API v1.3
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../api/api-v2/" class="md-nav__link">
+ API v2
+ </a>
+ </li>
+
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="../../maintenance/" class="md-nav__link">
+ Maintenance
+ </a>
+ </li>
+
+
+
+ </ul>
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#the-basics" class="md-nav__link">
+ The Basics
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#server-side-plugin" class="md-nav__link">
+ Server-Side Plugin
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-content" data-md-component="content">
+ <article class="md-content__inner md-typeset">
+
+
+
+
+
+
+
+
+<h1 id="plugins">Plugins</h1>
+<p>Plugins were created to keep the app maintainable while still making it possible to easily implement additional functionality.</p>
+<p>There are essentially three different use cases for plugins:</p>
+<ul>
+<li>Creating or extending server-side functionality, e.g. creating additional REST API endpoints</li>
+<li>Offering article actions such as share via Twitter or E-Mail</li>
+<li>Dropping in additional CSS or JavaScript</li>
+</ul>
+<h2 id="the-basics">The Basics</h2>
+<p>Whatever plugin you want to create, you first need to create a basic structure. A plugin is basically just an app, so you can take advantage of the full <a href="https://docs.nextcloud.org/server/latest/developer_manual/app/index.html">Nextcloud app API</a>. <a href="https://docs.nextcloud.com/server/latest/developer_manual/app_development/index.html">Take a look at the developer docs</a> or <a href="https://docs.nextcloud.com/server/latest/developer_manual/app_development/tutorial.html">dig into the tutorial</a>.</p>
+<p>However, if you just want to start slow, the full process is described below.</p>
+<p>First create a skeleton app using the <a href="https://apps.nextcloud.com/developer/apps/generate">web interface</a></p>
+<p>The application name affects the name and namespace of your plugin and only one app can exist using the same name. Choose wisely. This will become the directory name in the Nextcloud <code>apps/</code> directory</p>
+<ul>
+<li><strong>newsplugin/</strong></li>
+<li><strong>appinfo/</strong><ul>
+<li><strong>app.php</strong></li>
+<li><strong>info.xml</strong></li>
+</ul>
+</li>
+</ul>
+<p><strong>Note</strong>: You must license your app under the <a href="https://www.gnu.org/licenses/agpl-3.0.en.html">AGPL 3 or later</a> to comply with the News app's license. Don't forget to add the license as plain text file if you want to distribute your app!</p>
+<p>Then we want to make sure that our code is only run if the News app is enabled. To do that put the following PHP code into the <strong>newsplugin/lib/AppInfo/Application.php</strong> file:</p>
+<div class="language-php highlight"><pre><span></span><code><span id="code-line-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="cp">&lt;?php</span>
+</span><span id="code-line-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="k">declare</span><span class="p">(</span><span class="nx">strict_types</span><span class="o">=</span><span class="mi">1</span><span class="p">);</span>
+</span><span id="code-line-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a>
+</span><span id="code-line-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="k">namespace</span> <span class="nx">OCA\NewsBookmarkPlugin\AppInfo</span><span class="p">;</span>
+</span><span id="code-line-0-5"><a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a>
+</span><span id="code-line-0-6"><a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a><span class="k">use</span> <span class="nx">OCP\AppFramework\App</span><span class="p">;</span>
+</span><span id="code-line-0-7"><a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a><span class="k">use</span> <span class="nx">OCP\Util</span><span class="p">;</span>
+</span><span id="code-line-0-8"><a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a><span class="k">use</span> <span class="nx">OCP\App</span> <span class="k">as</span> <span class="nx">Test</span><span class="p">;</span>
+</span><span id="code-line-0-9"><a id="__codelineno-0-9" name="__codelineno-0-9" href="#__codelineno-0-9"></a>
+</span><span id="code-line-0-10"><a id="__codelineno-0-10" name="__codelineno-0-10" href="#__codelineno-0-10"></a><span class="k">class</span> <span class="nc">Application</span> <span class="k">extends</span> <span class="nx">App</span> <span class="p">{</span>
+</span><span id="code-line-0-11"><a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a> <span class="k">public</span> <span class="k">const</span> <span class="no">APP_ID</span> <span class="o">=</span> <span class="s1">&#39;newsbookmarkplugin&#39;</span><span class="p">;</span>
+</span><span id="code-line-0-12"><a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a>
+</span><span id="code-line-0-13"><a id="__codelineno-0-13" name="__codelineno-0-13" href="#__codelineno-0-13"></a> <span class="k">public</span> <span class="k">function</span> <span class="fm">__construct</span><span class="p">()</span> <span class="p">{</span>
+</span><span id="code-line-0-14"><a id="__codelineno-0-14" name="__codelineno-0-14" href="#__codelineno-0-14"></a> <span class="k">parent</span><span class="o">::</span><span class="na">__construct</span><span class="p">(</span><span class="nx">self</span><span class="o">::</span><span class="na">APP_ID</span><span class="p">);</span>
+</span><span id="code-line-0-15"><a id="__codelineno-0-15" name="__codelineno-0-15" href="#__codelineno-0-15"></a>
+</span><span id="code-line-0-16"><a id="__codelineno-0-16" name="__codelineno-0-16" href="#__codelineno-0-16"></a>
+</span><span id="code-line-0-17"><a id="__codelineno-0-17" name="__codelineno-0-17" href="#__codelineno-0-17"></a> <span class="c1">// your code here</span>
+</span><span id="code-line-0-18"><a id="__codelineno-0-18" name="__codelineno-0-18" href="#__codelineno-0-18"></a> <span class="p">}</span>
+</span><span id="code-line-0-19"><a id="__codelineno-0-19" name="__codelineno-0-19" href="#__codelineno-0-19"></a><span class="p">}</span>
+</span></code></pre></div>
+<h2 id="server-side-plugin">Server-Side Plugin</h2>
+<p>A Server-Side plugin is a plugin that uses the same infrastructure as the News app for its own purposes. An example would be a plugin that makes the starred entries of a user available via an interface or a bookmark app that also shows starred articles as bookmarks.</p>
+<p>It's very easy to interface with the News app. Because all Classes are registered in the <strong>news/app/application.php</strong> it takes almost no effort to use the same infrastructure.</p>
+<p><strong>Note</strong>: Keep in mind that these classes are essentially private which means they might break if the News app changes. There is no real public API so use at your own risk ;)</p>
+<p>Since you don't want to extend the app but use its resources, its advised that you don't inherit from the <strong>Application</strong> class but rather include it in your own container in <strong>newsplugin/appinfo/application.php</strong>:</p>
+<div class="language-php highlight"><pre><span></span><code><span id="code-line-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="cp">&lt;?php</span>
+</span><span id="code-line-1-2"><a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="k">namespace</span> <span class="nx">OCA\NewsPlugin\AppInfo</span><span class="p">;</span>
+</span><span id="code-line-1-3"><a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a>
+</span><span id="code-line-1-4"><a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a><span class="k">use</span> <span class="nx">OCP\AppFramework\App</span><span class="p">;</span>
+</span><span id="code-line-1-5"><a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a><span class="k">use</span> <span class="nx">OCA\News\AppInfo\Application</span> <span class="k">as</span> <span class="nx">News</span><span class="p">;</span>
+</span><span id="code-line-1-6"><a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a>
+</span><span id="code-line-1-7"><a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a><span class="k">class</span> <span class="nc">Application</span> <span class="k">extends</span> <span class="nx">App</span> <span class="p">{</span>
+</span><span id="code-line-1-8"><a id="__codelineno-1-8" name="__codelineno-1-8" href="#__codelineno-1-8"></a>
+</span><span id="code-line-1-9"><a id="__codelineno-1-9" name="__codelineno-1-9" href="#__codelineno-1-9"></a> <span class="k">public</span> <span class="k">function</span> <span class="fm">__construct</span> <span class="p">(</span><span class="k">array</span> <span class="nv">$urlParams</span><span class="o">=</span><span class="p">[])</span> <span class="p">{</span>
+</span><span id="code-line-1-10"><a id="__codelineno-1-10" name="__codelineno-1-10" href="#__codelineno-1-10"></a> <span class="k">parent</span><span class="o">::</span><span class="na">__construct</span><span