Fixed property groups form Group and EPerson models and added comments

This commit is contained in:
Giuseppe Digilio
2019-03-17 16:52:07 +01:00
parent e90d80bce7
commit fa218abada
4 changed files with 96 additions and 12 deletions

View File

@@ -1,22 +1,50 @@
import { Observable } from 'rxjs';
import { DSpaceObject } from '../../shared/dspace-object.model'; import { DSpaceObject } from '../../shared/dspace-object.model';
import { Group } from './group.model'; import { Group } from './group.model';
import { RemoteData } from '../../data/remote-data';
import { PaginatedList } from '../../data/paginated-list';
export class EPerson extends DSpaceObject { export class EPerson extends DSpaceObject {
/**
* A string representing the unique handle of this Collection
*/
public handle: string; public handle: string;
public groups: Group[]; /**
* List of Groups that this EPerson belong to
*/
public groups: Observable<RemoteData<PaginatedList<Group>>>;
/**
* A string representing the netid of this EPerson
*/
public netid: string; public netid: string;
/**
* A string representing the last active date for this EPerson
*/
public lastActive: string; public lastActive: string;
/**
* A boolean representing if this EPerson can log in
*/
public canLogIn: boolean; public canLogIn: boolean;
/**
* The EPerson email address
*/
public email: string; public email: string;
/**
* A boolean representing if this EPerson require certificate
*/
public requireCertificate: boolean; public requireCertificate: boolean;
/**
* A boolean representing if this EPerson registered itself
*/
public selfRegistered: boolean; public selfRegistered: boolean;
/** Getter to retrieve the EPerson's full name as a string */ /** Getter to retrieve the EPerson's full name as a string */

View File

@@ -1,12 +1,28 @@
import { Observable } from 'rxjs';
import { DSpaceObject } from '../../shared/dspace-object.model'; import { DSpaceObject } from '../../shared/dspace-object.model';
import { PaginatedList } from '../../data/paginated-list';
import { RemoteData } from '../../data/remote-data';
export class Group extends DSpaceObject { export class Group extends DSpaceObject {
public groups: Group[]; /**
* List of Groups that this Group belong to
*/
public groups: Observable<RemoteData<PaginatedList<Group>>>;
/**
* A string representing the unique handle of this Group
*/
public handle: string; public handle: string;
/**
* A string representing the name of this Group
*/
public name: string; public name: string;
/**
* A string representing the name of this Group is permanent
*/
public permanent: boolean; public permanent: boolean;
} }

View File

@@ -1,37 +1,62 @@
import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'; import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
import { CacheableObject } from '../../cache/object-cache.reducer'; import { CacheableObject } from '../../cache/object-cache.reducer';
import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model'; import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model';
import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model'; import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model';
import { EPerson } from './eperson.model'; import { EPerson } from './eperson.model';
import { mapsTo } from '../../cache/builders/build-decorators'; import { mapsTo, relationship } from '../../cache/builders/build-decorators';
import { Group } from './group.model'; import { ResourceType } from '../../shared/resource-type';
import { NormalizedGroup } from './normalized-group.model';
@mapsTo(EPerson) @mapsTo(EPerson)
@inheritSerialization(NormalizedDSpaceObject) @inheritSerialization(NormalizedDSpaceObject)
export class NormalizedEPerson extends NormalizedDSpaceObject<EPerson> implements CacheableObject, ListableObject { export class NormalizedEPerson extends NormalizedDSpaceObject<EPerson> implements CacheableObject, ListableObject {
/**
* A string representing the unique handle of this EPerson
*/
@autoserialize @autoserialize
public handle: string; public handle: string;
@autoserializeAs(NormalizedGroup) /**
groups: Group[]; * List of Groups that this EPerson belong to
*/
@deserialize
@relationship(ResourceType.Group, true)
groups: string[];
/**
* A string representing the netid of this EPerson
*/
@autoserialize @autoserialize
public netid: string; public netid: string;
/**
* A string representing the last active date for this EPerson
*/
@autoserialize @autoserialize
public lastActive: string; public lastActive: string;
/**
* A boolean representing if this EPerson can log in
*/
@autoserialize @autoserialize
public canLogIn: boolean; public canLogIn: boolean;
/**
* The EPerson email address
*/
@autoserialize @autoserialize
public email: string; public email: string;
/**
* A boolean representing if this EPerson require certificate
*/
@autoserialize @autoserialize
public requireCertificate: boolean; public requireCertificate: boolean;
/**
* A boolean representing if this EPerson registered itself
*/
@autoserialize @autoserialize
public selfRegistered: boolean; public selfRegistered: boolean;
} }

View File

@@ -1,23 +1,38 @@
import { autoserialize, autoserializeAs, inheritSerialization } from 'cerialize'; import { autoserialize, deserialize, inheritSerialization } from 'cerialize';
import { CacheableObject } from '../../cache/object-cache.reducer'; import { CacheableObject } from '../../cache/object-cache.reducer';
import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model'; import { ListableObject } from '../../../shared/object-collection/shared/listable-object.model';
import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model'; import { NormalizedDSpaceObject } from '../../cache/models/normalized-dspace-object.model';
import { mapsTo } from '../../cache/builders/build-decorators'; import { mapsTo, relationship } from '../../cache/builders/build-decorators';
import { Group } from './group.model'; import { Group } from './group.model';
import { ResourceType } from '../../shared/resource-type';
@mapsTo(Group) @mapsTo(Group)
@inheritSerialization(NormalizedDSpaceObject) @inheritSerialization(NormalizedDSpaceObject)
export class NormalizedGroup extends NormalizedDSpaceObject<Group> implements CacheableObject, ListableObject { export class NormalizedGroup extends NormalizedDSpaceObject<Group> implements CacheableObject, ListableObject {
@autoserializeAs(NormalizedGroup) /**
groups: Group[]; * List of Groups that this Group belong to
*/
@deserialize
@relationship(ResourceType.Group, true)
groups: string[];
/**
* A string representing the unique handle of this Group
*/
@autoserialize @autoserialize
public handle: string; public handle: string;
/**
* A string representing the name of this Group
*/
@autoserialize @autoserialize
public name: string; public name: string;
/**
* A string representing the name of this Group is permanent
*/
@autoserialize @autoserialize
public permanent: boolean; public permanent: boolean;
} }