mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
remove normalized models part 1
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
|
||||
import { Observable } from 'rxjs';
|
||||
import { link } from '../cache/builders/build-decorators';
|
||||
import { link, resourceType } from '../cache/builders/build-decorators';
|
||||
import { PaginatedList } from '../data/paginated-list';
|
||||
import { RemoteData } from '../data/remote-data';
|
||||
import { Bitstream } from './bitstream.model';
|
||||
@@ -10,14 +11,49 @@ import { COMMUNITY } from './community.resource-type';
|
||||
import { DSpaceObject } from './dspace-object.model';
|
||||
import { HALLink } from './hal-link.model';
|
||||
|
||||
@resourceType(Community.type)
|
||||
@inheritSerialization(DSpaceObject)
|
||||
export class Community extends DSpaceObject {
|
||||
static type = COMMUNITY;
|
||||
|
||||
/**
|
||||
* A string representing the unique handle of this Community
|
||||
*/
|
||||
@autoserialize
|
||||
handle: string;
|
||||
|
||||
/**
|
||||
* The HALLinks for this Community
|
||||
*/
|
||||
@deserialize
|
||||
_links: {
|
||||
collections: HALLink;
|
||||
logo: HALLink;
|
||||
subcommunities: HALLink;
|
||||
self: HALLink;
|
||||
};
|
||||
|
||||
/**
|
||||
* The logo for this Community
|
||||
* Will be undefined unless the logo HALLink has been resolved.
|
||||
*/
|
||||
@link(BITSTREAM)
|
||||
logo?: Observable<RemoteData<Bitstream>>;
|
||||
|
||||
/**
|
||||
* The list of Collections that are direct children of this Community
|
||||
* Will be undefined unless the collections HALLink has been resolved.
|
||||
*/
|
||||
@link(COLLECTION, true)
|
||||
collections?: Observable<RemoteData<PaginatedList<Collection>>>;
|
||||
|
||||
/**
|
||||
* The list of Communities that are direct children of this Community
|
||||
* Will be undefined unless the subcommunities HALLink has been resolved.
|
||||
*/
|
||||
@link(COMMUNITY, true)
|
||||
subcommunities?: Observable<RemoteData<PaginatedList<Community>>>;
|
||||
|
||||
/**
|
||||
* The introductory text of this Community
|
||||
* Corresponds to the metadata field dc.description
|
||||
@@ -49,23 +85,4 @@ export class Community extends DSpaceObject {
|
||||
get sidebarText(): string {
|
||||
return this.firstMetadataValue('dc.description.tableofcontents');
|
||||
}
|
||||
|
||||
/**
|
||||
* The Bitstream that represents the logo of this Community
|
||||
*/
|
||||
@link(BITSTREAM)
|
||||
logo?: Observable<RemoteData<Bitstream>>;
|
||||
|
||||
@link(COLLECTION, true)
|
||||
collections?: Observable<RemoteData<PaginatedList<Collection>>>;
|
||||
|
||||
@link(COMMUNITY, true)
|
||||
subcommunities?: Observable<RemoteData<PaginatedList<Community>>>;
|
||||
|
||||
_links: {
|
||||
collections: HALLink;
|
||||
logo: HALLink;
|
||||
subcommunities: HALLink;
|
||||
self: HALLink;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user