Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@
use OCA\OpenRegister\Service\ObjectSource\FederatedObjectSourceProvider;
use OCA\OpenRegister\Service\ObjectSource\FilesObjectSourceProvider;
use OCA\OpenRegister\Service\ObjectSource\GroupObjectSourceProvider;
use OCA\OpenRegister\Service\ObjectSource\OrganisationObjectSourceProvider;
use OCA\OpenRegister\Service\ObjectSource\ObjectSourceRegistry;
use OCA\OpenRegister\Service\ObjectSource\TablesColumnMapper;
use OCA\OpenRegister\Service\ObjectSource\TablesObjectSourceProvider;
Expand Down Expand Up @@ -1474,6 +1475,18 @@ function (ContainerInterface $container) {
}
);

$context->registerService(
OrganisationObjectSourceProvider::class,
function (ContainerInterface $container) {
return new OrganisationObjectSourceProvider(
organisationMapper: $container->get('OCA\OpenRegister\Db\OrganisationMapper'),
userSession: $container->get('OCP\IUserSession'),
groupManager: $container->get('OCP\IGroupManager'),
logger: $container->get('Psr\Log\LoggerInterface')
);
}
);

$context->registerService(
ContactsObjectSourceProvider::class,
function (ContainerInterface $container) {
Expand Down Expand Up @@ -4436,6 +4449,7 @@ private function bootObjectSourceProviders($server): void {
CalDavVtodoObjectSourceProvider::class,
UserDirectoryObjectSourceProvider::class,
GroupObjectSourceProvider::class,
OrganisationObjectSourceProvider::class,
ContactsObjectSourceProvider::class,
CalendarEventObjectSourceProvider::class,
FilesObjectSourceProvider::class,
Expand Down
24 changes: 24 additions & 0 deletions lib/Repair/SeedDirectoryVirtualSchemas.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,30 @@ class SeedDirectoryVirtualSchemas implements IRepairStep {
'id' => ['type' => 'string', 'title' => 'Group ID', 'description' => 'The Nextcloud group id (gid).'],
'displayName' => ['type' => 'string', 'title' => 'Display name', 'description' => 'The group display name.'],
],
// The identity facet of an OpenRegister organisation, and nothing else.
// This set MUST stay in step with
// {@see \OCA\OpenRegister\Service\ObjectSource\OrganisationObjectSourceProvider}'s
// projection: a property declared here and not projected reads as
// permanently empty, and one projected but not declared is discarded by
// the store without a word.
//
// Tenancy administration (quota, users, groups, authorization) is
// deliberately absent. This schema exists so another record can REFERENCE
// an organisation, not so anyone can configure one through the object API.
'nc-organisation' => [
'id' => ['type' => 'string', 'title' => 'Organisation ID', 'description' => 'The organisation uuid.'],
'name' => ['type' => 'string', 'title' => 'Name', 'description' => 'The organisation name.'],
'description' => ['type' => 'string', 'title' => 'Description', 'description' => 'A description of the organisation.'],
'summary' => ['type' => 'string', 'title' => 'Summary', 'description' => 'A short summary.'],
'oin' => ['type' => 'string', 'title' => 'OIN', 'description' => 'Organisatie-identificatienummer.'],
'tooi' => ['type' => 'string', 'title' => 'TOOI', 'description' => 'TOOI register identifier.'],
'rsin' => ['type' => 'string', 'title' => 'RSIN', 'description' => 'Rechtspersonen en Samenwerkingsverbanden Informatienummer.'],
'kvk' => ['type' => 'string', 'title' => 'KVK', 'description' => 'Chamber of Commerce number.'],
'pki' => ['type' => 'string', 'title' => 'PKI', 'description' => 'PKIoverheid certificate identifier.'],
'image' => ['type' => 'string', 'title' => 'Image', 'description' => 'A logo or image URL.'],
'type' => ['type' => 'string', 'title' => 'Type', 'description' => 'What kind of organisation this row describes.'],
'registrationStatus' => ['type' => 'string', 'title' => 'Registration status', 'description' => 'Registration lifecycle state.'],
],
];

/**
Expand Down
16 changes: 16 additions & 0 deletions lib/Service/ObjectSource/NcEntitySemanticMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ final class NcEntitySemanticMap {
'requiredApp' => null,
'application' => 'openregister',
],
// OpenRegister's own organisation, projected so a leaf schema can point a
// `{"$ref": ...}` at it. Several apps declared their own `organization`
// SCHEMA precisely because there was nothing here to reference, and a
// schema slug is global per organisation, so those copies collide.
//
// `nc-`-prefixed for the reason the app-gated rows below are: it must not
// collide with the leaf-app `organization` schemas it exists to replace,
// which have to keep working until each app has migrated off them.
'organisation' => [
'register' => self::DIRECTORY_REGISTER,
'schema' => 'nc-organisation',
'schemaOrg' => 'schema:Organization',
'provider' => 'organisation-source',
'requiredApp' => null,
'application' => 'openregister',
],
// App-gated rows — each lives on its OWN app-named register (application =
// register slug) so the ADR-048 app-enabled gate degrades the projection
// when the backing app is uninstalled. Schemas are `nc-`-prefixed to avoid
Expand Down
Loading
Loading