Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61036375
models.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, May 4, 03:21
Size
3 KB
Mime Type
text/x-java
Expires
Mon, May 6, 03:21 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17456018
Attached To
rNIETZSCHEBETAAPP Nietzsche-Beta-App
models.ts
View Options
// class for Everything: extended by NavigationEntity, Manuscript, Page, Word with all common properties
import {SafeUrl} from '@angular/platform-browser';
export class TlnEntity {
id: string; // Short id, iri in most cases
iri: string; // iri
type: string; // rdfs:type
navIndex: number;
label?: string;
constructor(id: string, iri: string, type: string, navIndex: number, label?: string) {
this.id = id;
this.iri = iri;
this.type = type;
this.navIndex = navIndex;
this.label = label;
}
}
export class TlnQueryParams {
navBarOpenState: boolean;
navTabIndex: number;
manuscript: string;
page: string;
selectedLines: string;
selectedWords: string;
viewMode: string;
fullscreen: boolean;
zoom: number;
constructor(navBarOpenState: boolean, navTabIndex: number, manuscript: string, page: string, selectedLines: string, selectedWords: string, viewMode: string, fullscreen: boolean, zoom: number ) {
this.navBarOpenState = navBarOpenState;
this.navTabIndex = navTabIndex;
this.manuscript = manuscript;
this.page = page;
this.selectedLines = selectedLines;
this.selectedWords = selectedWords;
this.viewMode = viewMode;
this.fullscreen = fullscreen;
this.zoom = zoom;
}
setParam(prop: string, val: string) {
this[prop] = val;
}
}
// The navigation entries in each tree for each viewtab (TlnManuscript, TlnPage, PositionalEntity) used by navigation
// TODO: add several idxes? Or choosing another order will reload all, hence there is only one idx
//
export class NavigationEntity {
idx: number;
tlnEntity: TlnEntity;
thumb?: SafeUrl; // url of image (Thumbnail)
img?: SafeUrl; // full image url
svg?: SafeUrl; // svg url
constructor(idx: number, tlnEntity: TlnEntity, thumb?: string, img?, svg?: SafeUrl ) {
this.idx = idx;
this.tlnEntity = tlnEntity;
this.thumb = thumb;
this.img = img;
this.svg = svg;
}
}
export interface NavTreeDef {
id: number;
label: string;
qParam: string;
entries: NavigationEntity[];
description?: string;
apiDef?: ApiDef;
isActive?: boolean;
}
export class Annotation {
id: string;
text: string;
styles: Array<string>;
}
// Only relevant if we create an svg ourselves?
export interface PositionalEntity { // used for word rectangles as well as for line numbering
id: string;
text: string;
left: number;
top: number;
width: number;
height: number;
row?: number;
iri?: string; // TODO, change this. will be the id later when change data source to rdf ...
}
export class ApiDef {
type: number; // 0 === sparql 1.1., 1 === nietzscheSource API, 2 === existDB
baseUrl: string;
dataArray: string;
query?: string;
mapping?: TlnEntityMapping; // positive Filter ids: only these id's should be loaded into manuscript nav tree
constructor( type: number, baseUrl: string, dataArray: string, query?: string, mapping?: TlnEntityMapping) {
this.type = type;
this.baseUrl = baseUrl;
this.dataArray = dataArray;
this.query = query;
this.mapping = mapping;
}
}
export class TlnEntityMapping { // Is used for mapping the response from any given apiDef/response to a TlnEntity Instance
id: string; // Short id, iri in most cases
iri?: string; // iri
idx?: string;
type?: string; // rdfs:type
label?: string;
img?: string;
svg?: string;
thumb?: string;
constructor(id: string, iri?: string, idx?: string, type?: string, label?: string, img?: string, svg?: string, thumb?: string) {
this.id = id; this.iri = iri; this.idx = idx; this.type = type; this.label = label; this.img = img; this.svg = svg, this.thumb = thumb;
}
}
Event Timeline
Log In to Comment