-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
67 changed files
with
224 additions
and
12,479 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
*.iml | ||
.idea | ||
.idea | ||
/.php-cs-fixer.cache | ||
/.php_cs.cache | ||
/build/ | ||
/vendor/ | ||
js/*hot-update.* | ||
node_modules/ | ||
js/ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | ||
Upstream-Name: Test | ||
Upstream-Name: Template App | ||
Upstream-Contact: Sebastian Stöcker <[email protected]> | ||
Source: https://github.com/nextcloud/profiler | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Nextcloud app development example | ||
|
||
This is an example nextcloud app development setup. | ||
|
||
This repository features a [Docker Compose setup](dev/compose.yaml) to develop against a specific Nextcloud version and supports | ||
hot module replacement of the app's frontend (Vue.js) components. | ||
|
||
## Building the app | ||
|
||
1. Install php dependencies: | ||
``` | ||
make composer | ||
``` | ||
2. Install npm dependencies: | ||
``` | ||
npm ci | ||
``` | ||
|
||
## Run the app | ||
|
||
1. Start the webpack dev server (see [package.json](package.json) from your development IDE: | ||
``` | ||
npm run serve | ||
``` | ||
2. Start the Nextcloud Docker environment from the `dev` folder: | ||
``` | ||
docker compose up -d | ||
``` | ||
|
||
This starts the [nextcloud-docker-dev](https://github.com/juliushaertl/nextcloud-docker-dev) container. | ||
|
||
## Enable apps | ||
|
||
In order for Hot module replacement (HMR) to work the [HMR Enabler](https://github.com/nextcloud/hmr_enabler) app | ||
which is already mounted into the container needs to be enabled. | ||
|
||
1. Login to `http://localhost:8080` with user `admin` and password `admin`. | ||
2. Go to _Apps_ and **HMR Enabler** and the **Template App** | ||
|
||
You can now go the App's navigation item at the top to see the example app from the | ||
[Nextcloud App Generator](https://apps.nextcloud.com/developer/apps/generate). | ||
|
||
Changes to the Vue.js frontend code should now trigger the webpack-dev-server to rebuild the code and the browser to | ||
reload the content. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,23 +5,23 @@ | |
SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
SPDX-License-Identifier: CC0-1.0 | ||
--> | ||
<id>test</id> | ||
<name>Test</name> | ||
<summary>Template app</summary> | ||
<description><![CDATA[This is template app]]></description> | ||
<id>templateapp</id> | ||
<name>Template App</name> | ||
<summary>Development example app</summary> | ||
<description><![CDATA[Development example app]]></description> | ||
<version>0.0.1</version> | ||
<licence>agpl</licence> | ||
<author mail="[email protected]" >Sebastian Stöcker</author> | ||
<namespace>Test</namespace> | ||
<namespace>TemplateApp</namespace> | ||
<category>tools</category> | ||
<bugs>https://github.com/diz-unimr/nc-template-app</bugs> | ||
<bugs>https://github.com/diz-unimr/nc-app-template</bugs> | ||
<dependencies> | ||
<nextcloud min-version="27" max-version="27"/> | ||
</dependencies> | ||
<navigations> | ||
<navigation> | ||
<name>Test</name> | ||
<route>test.page.index</route> | ||
<name>Template App</name> | ||
<route>templateapp.page.index</route> | ||
</navigation> | ||
</navigations> | ||
</info> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,15 +4,15 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\AppInfo; | ||
namespace OCA\TemplateApp\AppInfo; | ||
|
||
use OCP\AppFramework\App; | ||
use OCP\AppFramework\Bootstrap\IBootContext; | ||
use OCP\AppFramework\Bootstrap\IBootstrap; | ||
use OCP\AppFramework\Bootstrap\IRegistrationContext; | ||
|
||
class Application extends App implements IBootstrap { | ||
public const APP_ID = 'test'; | ||
public const APP_ID = 'templateapp'; | ||
|
||
public function __construct() { | ||
parent::__construct(self::APP_ID); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,11 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\Controller; | ||
namespace OCA\TemplateApp\Controller; | ||
|
||
use Closure; | ||
|
||
use OCA\Test\Service\NoteNotFound; | ||
use OCA\TemplateApp\Service\NoteNotFound; | ||
use OCP\AppFramework\Http; | ||
|
||
use OCP\AppFramework\Http\DataResponse; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,10 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\Controller; | ||
namespace OCA\TemplateApp\Controller; | ||
|
||
use OCA\Test\AppInfo\Application; | ||
use OCA\Test\Service\NoteService; | ||
use OCA\TemplateApp\AppInfo\Application; | ||
use OCA\TemplateApp\Service\NoteService; | ||
use OCP\AppFramework\ApiController; | ||
use OCP\AppFramework\Http\DataResponse; | ||
use OCP\IRequest; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,10 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\Controller; | ||
namespace OCA\TemplateApp\Controller; | ||
|
||
use OCA\Test\AppInfo\Application; | ||
use OCA\Test\Service\NoteService; | ||
use OCA\TemplateApp\AppInfo\Application; | ||
use OCA\TemplateApp\Service\NoteService; | ||
use OCP\AppFramework\Controller; | ||
use OCP\AppFramework\Http\DataResponse; | ||
use OCP\IRequest; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,9 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\Controller; | ||
namespace OCA\TemplateApp\Controller; | ||
|
||
use OCA\Test\AppInfo\Application; | ||
use OCA\TemplateApp\AppInfo\Application; | ||
use OCP\AppFramework\Controller; | ||
use OCP\AppFramework\Http\TemplateResponse; | ||
use OCP\IRequest; | ||
|
@@ -22,7 +22,7 @@ public function __construct(IRequest $request) { | |
* @NoCSRFRequired | ||
*/ | ||
public function index(): TemplateResponse { | ||
Util::addScript(Application::APP_ID, 'test-main'); | ||
Util::addScript(Application::APP_ID, 'templateapp-main'); | ||
|
||
return new TemplateResponse(Application::APP_ID, 'main'); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\Db; | ||
namespace OCA\TemplateApp\Db; | ||
|
||
use JsonSerializable; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\Db; | ||
namespace OCA\TemplateApp\Db; | ||
|
||
use OCP\AppFramework\Db\DoesNotExistException; | ||
use OCP\AppFramework\Db\QBMapper; | ||
|
@@ -16,7 +16,7 @@ | |
*/ | ||
class NoteMapper extends QBMapper { | ||
public function __construct(IDBConnection $db) { | ||
parent::__construct($db, 'test', Note::class); | ||
parent::__construct($db, 'templateapp', Note::class); | ||
} | ||
|
||
/** | ||
|
@@ -27,7 +27,7 @@ public function find(int $id, string $userId): Note { | |
/* @var $qb IQueryBuilder */ | ||
$qb = $this->db->getQueryBuilder(); | ||
$qb->select('*') | ||
->from('test') | ||
->from('templateapp') | ||
->where($qb->expr()->eq('id', $qb->createNamedParameter($id, IQueryBuilder::PARAM_INT))) | ||
->andWhere($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))); | ||
return $this->findEntity($qb); | ||
|
@@ -41,7 +41,7 @@ public function findAll(string $userId): array { | |
/* @var $qb IQueryBuilder */ | ||
$qb = $this->db->getQueryBuilder(); | ||
$qb->select('*') | ||
->from('test') | ||
->from('templateapp') | ||
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId))); | ||
return $this->findEntities($qb); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\Migration; | ||
namespace OCA\TemplateApp\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
|
@@ -23,8 +23,8 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt | |
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
|
||
if (!$schema->hasTable('test')) { | ||
$table = $schema->createTable('test'); | ||
if (!$schema->hasTable('templateapp')) { | ||
$table = $schema->createTable('templateapp'); | ||
$table->addColumn('id', 'integer', [ | ||
'autoincrement' => true, | ||
'notnull' => true, | ||
|
@@ -43,7 +43,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt | |
]); | ||
|
||
$table->setPrimaryKey(['id']); | ||
$table->addIndex(['user_id'], 'test_user_id_index'); | ||
$table->addIndex(['user_id'], 'templateapp_user_id_index'); | ||
} | ||
return $schema; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\Service; | ||
namespace OCA\TemplateApp\Service; | ||
|
||
class NoteNotFound extends \Exception { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,12 @@ | |
// SPDX-FileCopyrightText: Sebastian Stöcker <[email protected]> | ||
// SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
namespace OCA\Test\Service; | ||
namespace OCA\TemplateApp\Service; | ||
|
||
use Exception; | ||
|
||
use OCA\Test\Db\Note; | ||
use OCA\Test\Db\NoteMapper; | ||
use OCA\TemplateApp\Db\Note; | ||
use OCA\TemplateApp\Db\NoteMapper; | ||
|
||
use OCP\AppFramework\Db\DoesNotExistException; | ||
use OCP\AppFramework\Db\MultipleObjectsReturnedException; | ||
|
Oops, something went wrong.