[DEV] big upgrade...

This commit is contained in:
Edouard DUPIN 2022-06-06 23:52:44 +02:00
parent a50e9535e0
commit ff5e479dcb
30 changed files with 144 additions and 215 deletions

View File

@ -392,26 +392,40 @@ public class DataResource {
// || value.mimeType.contentEquals("image/webp")
) {
// reads input image
System.out.println("Read path: " + filePathName);
File inputFile = new File(filePathName);
System.out.println(" ==> file exist: "+ inputFile.exists());
if (!inputFile.exists()) {
return Response.status(500).
entity("Internal Error: Media is NOT FOUNDABLE: " + id).
type("text/plain").
build();
}
BufferedImage inputImage = ImageIO.read(inputFile);
System.out.println(" ==> in buffer ready");
int scaledWidth = 250;
int scaledHeight = (int)((float)inputImage.getHeight() / (float)inputImage.getWidth() * (float) scaledWidth);
// creates output image
BufferedImage outputImage = new BufferedImage(scaledWidth,
scaledHeight, inputImage.getType());
System.out.println(" ==> out buffer ready");
// scales the input image to the output image
Graphics2D g2d = outputImage.createGraphics();
g2d.drawImage(inputImage, 0, 0, scaledWidth, scaledHeight, null);
g2d.dispose();
System.out.println(" ==> configure Resize Done");
// create the oputput stream:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(outputImage, "JPG", baos);
System.out.println(" ==> resize done");
byte[] imageData = baos.toByteArray();
System.out.println(" ==> generate response");
Response.ok(new ByteArrayInputStream(imageData)).build();
Response.ResponseBuilder out = Response.ok(imageData)
.header(HttpHeaders.CONTENT_LENGTH, imageData.length);
out.type("image/jpeg");
System.out.println(" ==> SSSSSSSSSSSSend");
return out.build();
}
return buildStream(filePathName, range, value.mimeType);

View File

@ -3,7 +3,7 @@
* @copyright 2018, Edouard DUPIN, all right reserved
* @license PROPRIETARY (see license file)
*/
import { Injectable, Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { ModelResponseHttp } from '../../service/http-wrapper';
import { DataService } from '../../service/data';
@ -12,7 +12,6 @@ import { DataService } from '../../service/data';
templateUrl: './data-image.html',
styleUrls: [ './data-image.less' ]
})
@Injectable()
export class ElementDataImageComponent implements OnInit {
// input parameters
@Input() id:number = -1;

View File

@ -3,17 +3,15 @@
* @copyright 2018, Edouard DUPIN, all right reserved
* @license PROPRIETARY (see license file)
*/
import { Injectable, Component, OnInit, Input } from '@angular/core';
import {Component, OnInit, Input } from '@angular/core';
import { SeasonService } from '../../service/season';
import { SeasonService, DataService } from '../../service';
@Component({
selector: 'app-element-season',
templateUrl: './element-season.html',
styleUrls: [ './element-season.less' ]
})
@Injectable()
export class ElementSeasonComponent implements OnInit {
// input parameters
@Input() idSeason:number = -1;
@ -25,7 +23,9 @@ export class ElementSeasonComponent implements OnInit {
covers:Array<string> = [];
description:string = '';
constructor(private seasonService: SeasonService) {
constructor(
private seasonService: SeasonService,
private dataService: DataService) {
}
ngOnInit() {
@ -42,7 +42,7 @@ export class ElementSeasonComponent implements OnInit {
} else {
self.cover = response.covers[0];//self.seasonService.getCoverThumbnailUrl(response.covers[0]);
for(let iii = 0; iii < response.covers.length; iii++) {
self.covers.push(self.seasonService.getCoverThumbnailUrl(response.covers[iii]));
self.covers.push(self.dataService.getCoverThumbnailUrl(response.covers[iii]));
}
}
}).catch((response) => {

View File

@ -3,17 +3,15 @@
* @copyright 2018, Edouard DUPIN, all right reserved
* @license PROPRIETARY (see license file)
*/
import { Injectable, Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { SeriesService } from '../../service/series';
import { SeriesService, DataService } from '../../service';
@Component({
selector: 'app-element-series',
templateUrl: './element-series.html',
styleUrls: [ './element-series.less' ]
})
@Injectable()
export class ElementSeriesComponent implements OnInit {
// input parameters
@Input() idSeries:number = -1;
@ -28,7 +26,9 @@ export class ElementSeriesComponent implements OnInit {
cover:string = '';
covers:Array<string> = [];
constructor(private seriesService: SeriesService) {
constructor(
private seriesService: SeriesService,
private dataService: DataService) {
}
ngOnInit() {
@ -43,9 +43,9 @@ export class ElementSeriesComponent implements OnInit {
self.cover = null;
// self.covers = [];
} else {
self.cover = self.seriesService.getCoverThumbnailUrl(response.covers[0]);
self.cover = self.dataService.getCoverThumbnailUrl(response.covers[0]);
for(let iii = 0; iii < response.covers.length; iii++) {
self.covers.push(self.seriesService.getCoverThumbnailUrl(response.covers[iii]));
self.covers.push(self.dataService.getCoverThumbnailUrl(response.covers[iii]));
}
}
}).catch((response) => {

View File

@ -3,61 +3,49 @@
* @copyright 2018, Edouard DUPIN, all right reserved
* @license PROPRIETARY (see license file)
*/
import { Injectable, Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { isArrayOf, isNumberFinite } from '../../utils';
import { TypeService } from '../../service/type';
import { NodeData } from '../..//model';
import { TypeService, DataService } from '../../service';
import { NodeData } from '../../model';
@Component({
selector: 'app-element-type',
templateUrl: './element-type.html',
styleUrls: [ './element-type.less' ]
})
//@Injectable()
export class ElementTypeComponent implements OnInit {
// input parameters
@Input() idType:number = -1;
@Input() element:NodeData;
public name: string = 'rr';
public description: string = 'sdqdfqsd';
public imageSource:string; // TODO: remove this ...
public error:string;
public countvideo:number;
public countserie:number;
public covers: string[];
constructor(private typeService: TypeService) {
constructor(
private typeService: TypeService,
private dataService: DataService) {
}
ngOnInit() {
let self = this;
//console.log(`get parameter id: ${ this.idType}`);
this.typeService.get(this.idType)
.then((response: NodeData) => {
//console.log("Get element ! " + JSON.stringify(response));
self.error = '';
self.name = response.name;
self.description = response.description;
if(!isArrayOf(response.covers, isNumberFinite) || response.covers.length === 0) {
self.covers = undefined;
} else {
self.covers = [];
for(let iii = 0; iii < response.covers.length; iii++) {
self.covers.push(self.typeService.getCoverThumbnailUrl(response.covers[iii]));
}
}
}).catch((response) => {
self.error = 'Can not get the data';
self.name = undefined;
self.description = undefined;
self.imageSource = undefined;
self.covers = [];
});
this.typeService.countVideo(this.idType)
console.log(" ??? Get element ! " + JSON.stringify(this.element));
self.name = this.element.name;
self.description = this.element.description;
if(!isArrayOf(this.element.covers, isNumberFinite) || this.element.covers.length === 0) {
self.covers = undefined;
} else {
self.covers = [];
for(let iii = 0; iii < this.element.covers.length; iii++) {
self.covers.push(self.dataService.getCoverThumbnailUrl(this.element.covers[iii]));
}
}
this.typeService.countVideo(this.element.id)
.then((response: number) => {
self.countvideo = response;
}).catch((response) => {

View File

@ -5,8 +5,7 @@
*/
import { Injectable, Component, OnInit, Input } from '@angular/core';
import { VideoService } from '../../service/video';
import { HttpWrapperService } from '../../service/http-wrapper';
import { VideoService, DataService, HttpWrapperService } from '../../service';
@Component({
selector: 'app-element-video',
@ -39,8 +38,10 @@ export class ElementVideoComponent implements OnInit {
cover:string = '';
covers:string[] = [];
constructor(private videoService: VideoService,
private httpService: HttpWrapperService) {
constructor(
private videoService: VideoService,
private dataService: DataService,
private httpService: HttpWrapperService) {
}
OnDestroy() {
@ -79,9 +80,9 @@ export class ElementVideoComponent implements OnInit {
self.cover = null;
// self.covers = [];
} else {
self.cover = self.videoService.getCoverThumbnailUrl(response.covers[0]);
self.cover = self.dataService.getCoverThumbnailUrl(response.covers[0]);
for(let iii = 0; iii < response.covers.length; iii++) {
self.covers.push(self.videoService.getCoverThumbnailUrl(response.covers[iii]));
self.covers.push(self.dataService.getCoverThumbnailUrl(response.covers[iii]));
}
}
// console.log("101010 " + self.videoEnable + " " + self.videoSource);

View File

@ -14,7 +14,6 @@ import { PopInService } from '../../service';
templateUrl: './popin.html',
styleUrls: [ './popin.less' ]
})
export class PopInComponent implements OnInit, OnDestroy {
@Input() id: string;
@Input() popTitle: string = 'No title';

View File

@ -3,10 +3,7 @@
* @copyright 2018, Edouard DUPIN, all right reserved
* @license PROPRIETARY (see license file)
*/
import { Injectable, Component, OnInit } from '@angular/core';
// import { AppRoutingModule } from "../app-routing.module";
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { UserService, SessionService, SSOService, ArianeService } from '../../service';
@ -15,7 +12,6 @@ import { UserService, SessionService, SSOService, ArianeService } from '../../se
templateUrl: './top-menu.html',
styleUrls: [ './top-menu.less' ]
})
@Injectable()
export class TopMenuComponent implements OnInit {
public login: string = null;// Session.getLogin();
public avatar: string = null;// Session.getAvatar();

View File

@ -11,7 +11,6 @@ import { Component } from '@angular/core';
templateUrl: './upload-file.html',
styleUrls: [ './upload-file.less' ]
})
export class UploadFileComponent {
files: any = [];
uploadFile(event) {

View File

@ -3,7 +3,7 @@
* @copyright 2018, Edouard DUPIN, all right reserved
* @license PROPRIETARY (see license file)
*/
import { Injectable, Component, OnInit } from '@angular/core';
import { Component, OnInit } from '@angular/core';
import { PopInService } from '../../service/popin';
@ -12,8 +12,6 @@ import { PopInService } from '../../service/popin';
templateUrl: './create-type.html',
styleUrls: [ './create-type.less' ]
})
@Injectable()
export class PopInCreateType implements OnInit {
name: string = '';
description: string = '';

View File

@ -4,7 +4,7 @@
* @license PROPRIETARY (see license file)
*/
import { Injectable, Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { PopInService } from '../../service';
@ -13,8 +13,6 @@ import { PopInService } from '../../service';
templateUrl: './delete-confirm.html',
styleUrls: [ './delete-confirm.less' ]
})
@Injectable()
export class PopInDeleteConfirm implements OnInit {
@Input() comment: string = null;
@Input() imageUrl: string = null;

View File

@ -4,7 +4,7 @@
* @license PROPRIETARY (see license file)
*/
import { Injectable, Component, OnInit, Input, SimpleChanges } from '@angular/core';
import { Component, OnInit, Input, SimpleChanges } from '@angular/core';
import { Router } from '@angular/router';
import { PopInService } from '../../service';
@ -14,8 +14,6 @@ import { PopInService } from '../../service';
templateUrl: './upload-progress.html',
styleUrls: [ './upload-progress.less' ]
})
@Injectable()
export class PopInUploadProgress implements OnInit {
@Input() mediaTitle: string = '';
@Input() mediaUploaded: number = 0;

View File

@ -4,7 +4,7 @@
</div>
<div class="fill-all colomn_mutiple">
<div *ngFor="let data of dataList" class="item-home" (click)="onSelectType($event, data.id)" (auxclick)="onSelectType($event, data.id)">
<app-element-type [idType]="data.id"></app-element-type>
<app-element-type [element]="data"></app-element-type>
</div>
<div class="clear"></div>
</div>

View File

@ -7,10 +7,9 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { SeasonService } from '../../service/season';
import { ArianeService } from '../../service/ariane';
import { SeasonService , ArianeService, DataService, PopInService} from '../../service';
import { UploadProgress } from '../../popin/upload-progress/upload-progress';
import { PopInService } from '../../service/popin';
export interface ElementList {
value: number;
@ -65,10 +64,12 @@ export class SeasonEditScene implements OnInit {
}
constructor(private route: ActivatedRoute,
private seasonService: SeasonService,
private arianeService: ArianeService,
private popInService: PopInService) {
constructor(
private route: ActivatedRoute,
private seasonService: SeasonService,
private arianeService: ArianeService,
private popInService: PopInService,
private dataService: DataService) {
}
@ -105,7 +106,7 @@ export class SeasonEditScene implements OnInit {
for(let iii = 0; iii < covers.length; iii++) {
this.coversDisplay.push({
id:covers[iii],
url:this.seasonService.getCoverThumbnailUrl(covers[iii])
url:this.dataService.getCoverThumbnailUrl(covers[iii])
});
}
} else {
@ -182,7 +183,7 @@ export class SeasonEditScene implements OnInit {
removeCover(id:number) {
this.cleanConfirm();
this.confirmDeleteComment = `Delete the cover ID: ${ id}`;
this.confirmDeleteImageUrl = this.seasonService.getCoverThumbnailUrl(id);
this.confirmDeleteImageUrl = this.dataService.getCoverThumbnailUrl(id);
this.deleteCoverId = id;
this.popInService.open('popin-delete-confirm');
}

View File

@ -7,9 +7,7 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { SeasonService } from '../../service/season';
import { SeriesService } from '../../service/series';
import { ArianeService } from '../../service/ariane';
import { SeasonService, DataService, SeriesService, ArianeService } from '../../service';
@Component({
selector: 'app-season',
@ -26,10 +24,12 @@ export class SeasonScene implements OnInit {
idSeason = -1;
videosError = '';
videos = [];
constructor(private route: ActivatedRoute,
private seasonService: SeasonService,
private seriesService: SeriesService,
private arianeService: ArianeService) {
constructor(
private route: ActivatedRoute,
private seasonService: SeasonService,
private seriesService: SeriesService,
private arianeService: ArianeService,
private dataService: DataService) {
}
@ -49,9 +49,9 @@ export class SeasonScene implements OnInit {
self.cover = null;
self.covers = [];
} else {
self.cover = self.seriesService.getCoverUrl(response.covers[0]);
self.cover = self.dataService.getCoverUrl(response.covers[0]);
for(let iii = 0; iii < response.covers.length; iii++) {
self.covers.push(self.seriesService.getCoverUrl(response.covers[iii]));
self.covers.push(self.dataService.getCoverUrl(response.covers[iii]));
}
}
self.seriesService.get(self.seriesId)

View File

@ -5,22 +5,15 @@
*/
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
import { SeriesService } from '../../service/series';
import { DataService } from '../../service/data';
import { TypeService } from '../../service/type';
import { ArianeService } from '../../service/ariane';
import { SeriesService, DataService, TypeService, ArianeService, PopInService } from '../../service';
import { UploadProgress } from '../../popin/upload-progress/upload-progress';
import { PopInService } from '../../service/popin';
export class ElementList {
value: number;
label: string;
constructor(_value: number, _label: string) {
this.value = _value;
this.label = _label;
constructor(
public value: number,
public label: string) {
}
}
@ -81,8 +74,6 @@ export class SeriesEditScene implements OnInit {
constructor(private route: ActivatedRoute,
private router: Router,
private locate: Location,
private dataService: DataService,
private typeService: TypeService,
private seriesService: SeriesService,
@ -144,7 +135,7 @@ export class SeriesEditScene implements OnInit {
for(let iii = 0; iii < covers.length; iii++) {
this.coversDisplay.push({
id:covers[iii],
url:this.seriesService.getCoverThumbnailUrl(covers[iii])
url:this.dataService.getCoverThumbnailUrl(covers[iii])
});
}
} else {
@ -230,7 +221,7 @@ export class SeriesEditScene implements OnInit {
removeCover(id:number) {
this.cleanConfirm();
this.confirmDeleteComment = `Delete the cover ID: ${ id}`;
this.confirmDeleteImageUrl = this.seriesService.getCoverThumbnailUrl(id);
this.confirmDeleteImageUrl = this.dataService.getCoverThumbnailUrl(id);
this.deleteCoverId = id;
this.popInService.open('popin-delete-confirm');
}

View File

@ -7,8 +7,7 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { SeriesService } from '../../service/series';
import { ArianeService } from '../../service/ariane';
import { SeriesService, DataService, ArianeService } from '../../service';
import { NodeData } from '../../model';
@Component({
@ -27,9 +26,11 @@ export class SeriesScene implements OnInit {
seasons: NodeData[] = [];
videosError: string = '';
videos: Array<any> = [];
constructor(private route: ActivatedRoute,
private seriesService: SeriesService,
private arianeService: ArianeService) {
constructor(
private route: ActivatedRoute,
private seriesService: SeriesService,
private arianeService: ArianeService,
private dataService: DataService) {
}
@ -52,9 +53,9 @@ export class SeriesScene implements OnInit {
self.cover = null;
self.covers = [];
} else {
self.cover = self.seriesService.getCoverUrl(response.covers[0]);
self.cover = self.dataService.getCoverUrl(response.covers[0]);
for(let iii = 0; iii < response.covers.length; iii++) {
self.covers.push(self.seriesService.getCoverUrl(response.covers[iii]));
self.covers.push(self.dataService.getCoverUrl(response.covers[iii]));
}
}
updateEnded.seriesMetadata = true;

View File

@ -6,7 +6,7 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ArianeService } from '../../service/ariane';
import { ArianeService, DataService } from '../../service';
@Component({
selector: 'app-settings',
@ -16,8 +16,11 @@ import { ArianeService } from '../../service/ariane';
export class SettingsScene implements OnInit {
page = '';
constructor(private route: ActivatedRoute,
private arianeService: ArianeService) { }
constructor(
private route: ActivatedRoute,
private arianeService: ArianeService) {
// nothing to do.
}
ngOnInit() {
this.arianeService.updateManual(this.route.snapshot.paramMap);

View File

@ -7,8 +7,7 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { TypeService } from '../../service/type';
import { ArianeService } from '../../service/ariane';
import { TypeService, DataService, ArianeService } from '../../service';
@Component({
selector: 'app-type',
@ -26,9 +25,11 @@ export class TypeScene implements OnInit {
seriess = [];
videosError = '';
videos = [];
constructor(private route: ActivatedRoute,
private typeService: TypeService,
private arianeService: ArianeService) {
constructor(
private route: ActivatedRoute,
private typeService: TypeService,
private arianeService: ArianeService,
private dateService: DataService) {
/*
this.route.params.subscribe(params => {
@ -54,9 +55,9 @@ export class TypeScene implements OnInit {
self.cover = null;
self.covers = [];
} else {
self.cover = self.typeService.getCoverUrl(response.covers[0]);
self.cover = self.dateService.getCoverUrl(response.covers[0]);
for(let iii = 0; iii < response.covers.length; iii++) {
self.covers.push(self.typeService.getCoverUrl(response.covers[iii]));
self.covers.push(self.dateService.getCoverUrl(response.covers[iii]));
}
}
}).catch((response) => {

View File

@ -8,12 +8,7 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { PopInService } from '../../service/popin';
import { TypeService } from '../../service/type';
import { UniverseService } from '../../service/universe';
import { SeriesService } from '../../service/series';
import { VideoService } from '../../service/video';
import { ArianeService } from '../../service/ariane';
import { PopInService, DataService, TypeService, UniverseService, SeriesService, VideoService, ArianeService } from '../../service';
import { UploadProgress } from '../../popin/upload-progress/upload-progress';
import { NodeData } from '../../model';
@ -113,13 +108,15 @@ export class VideoEditScene implements OnInit {
listSeason: ElementList[] = [
{ value: undefined, label: '---' },
];
constructor(private route: ActivatedRoute,
private typeService: TypeService,
private universeService: UniverseService,
private seriesService: SeriesService,
private videoService: VideoService,
private arianeService: ArianeService,
private popInService: PopInService) {
constructor(
private route: ActivatedRoute,
private typeService: TypeService,
private universeService: UniverseService,
private seriesService: SeriesService,
private videoService: VideoService,
private arianeService: ArianeService,
private popInService: PopInService,
private dataService: DataService) {
}
@ -160,7 +157,7 @@ export class VideoEditScene implements OnInit {
this.data.covers.push(covers[iii]);
this.coversDisplay.push({
id:covers[iii],
url:this.videoService.getCoverThumbnailUrl(covers[iii])
url:this.dataService.getCoverThumbnailUrl(covers[iii])
});
}
} else {
@ -437,7 +434,7 @@ export class VideoEditScene implements OnInit {
removeCover(id:number) {
this.cleanConfirm();
this.confirmDeleteComment = `Delete the cover ID: ${ id}`;
this.confirmDeleteImageUrl = this.seriesService.getCoverThumbnailUrl(id);
this.confirmDeleteImageUrl = this.dataService.getCoverThumbnailUrl(id);
this.deleteCoverId = id;
this.popInService.open('popin-delete-confirm');
}

View File

@ -6,11 +6,7 @@
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { HttpWrapperService } from '../../service/http-wrapper';
import { VideoService } from '../../service/video';
import { SeriesService } from '../../service/series';
import { SeasonService } from '../../service/season';
import { ArianeService } from '../../service/ariane';
import { HttpWrapperService, DataService, VideoService, SeriesService, SeasonService, ArianeService } from '../../service';
import { isNullOrUndefined } from '../..//utils';
@Component({
@ -26,21 +22,21 @@ export class VideoScene implements OnInit {
if(el !== null && el !== undefined) {
this.videoGlobal = el.nativeElement;
}
}
}
videoPlayer: HTMLVideoElement;
@ViewChild('videoPlayer')
set mainVideoEl(el: ElementRef) {
if(el !== null && el !== undefined) {
this.videoPlayer = el.nativeElement;
}
}
}
videoCanva: any;
@ViewChild('canvascreenshoot')
set mainCanvaEl(el: ElementRef) {
if(el !== null && el !== undefined) {
this.videoCanva = el.nativeElement;
}
}
}
haveNext = null;
havePrevious = null;
idVideo:number = -1;
@ -82,7 +78,8 @@ export class VideoScene implements OnInit {
private seriesService: SeriesService,
private seasonService: SeasonService,
private httpService: HttpWrapperService,
private arianeService: ArianeService) {
private arianeService: ArianeService,
private dataService: DataService) {
}
@ -221,9 +218,9 @@ export class VideoScene implements OnInit {
if(response.covers === undefined || response.covers === null || response.covers.length === 0) {
self.cover = null;
} else {
self.cover = self.videoService.getCoverUrl(response.covers[0]);
self.cover = self.dataService.getCoverUrl(response.covers[0]);
for(let iii = 0; iii < response.covers.length; iii++) {
self.covers.push(self.videoService.getCoverUrl(response.covers[iii]));
self.covers.push(self.dataService.getCoverUrl(response.covers[iii]));
}
}
self.generateName();
@ -266,7 +263,7 @@ export class VideoScene implements OnInit {
self.haveNext = response6[iii];
}
}
self.covers.push(self.seriesService.getCoverUrl(response6[iii]));
self.covers.push(self.dataService.getCoverUrl(response6[iii]));
}
}).catch((response7:any) => {

View File

@ -57,7 +57,7 @@ export class HttpWrapperService {
}
addTokenIfNeeded(headerOption:any): any {
if(this.session.sessionData !== null) {
if(!isNullOrUndefined(this.session.getToken())) {
if(headerOption.Authorization === undefined) {
headerOption.Authorization = `Yota ${this.session.getToken()}`;
}
@ -182,14 +182,15 @@ export class HttpWrapperService {
out = out + "=" + options[keys[iii]];
}
}
if (!isNullOrUndefined(this.session.sessionData)) {
console.log(`try to get session : ${this.session.getToken()}`);
if (!isNullOrUndefined(this.session.getToken())) {
if (addURLToken !== undefined && addURLToken === true) {
if(first === false) {
out = `${out }&`;
} else {
out = `${out }?`;
}
out = out + `Authorization=Yota ${this.session.sessionData.userId}:${this.session.sessionData.token}`;
out = out + `Authorization=Yota ${this.session.getToken()}`;
}
}
return out;

View File

@ -96,19 +96,6 @@ export class SeasonService {
let ret = this.http.deleteSpecific(this.serviceName, id);
return this.bdd.delete(this.serviceName, id, ret);
}
// deprecated ???
getCoverUrl(coverId:number):any {
return this.http.createRESTCall2({
api: `data/${coverId}`,
addURLToken: true,
});
}
getCoverThumbnailUrl(coverId:number):any {
return this.http.createRESTCall2({
api: `data/thumbnail/${coverId}`,
addURLToken: true,
});
}
deleteCover(nodeId:number,
coverId:number) {
let self = this;

View File

@ -155,20 +155,6 @@ export class SeriesService {
return this.bdd.delete(this.serviceName, id, ret);
}
getCoverUrl(coverId:number):any {
return this.http.createRESTCall2({
api: `data/${coverId}`,
addURLToken: true,
});
}
getCoverThumbnailUrl(coverId:number):any {
return this.http.createRESTCall2({
api: `data/thumbnail/${coverId}`,
addURLToken: true,
});
}
getLike(nameSeries:string):any {
let self = this;
return new Promise((resolve, reject) => {

View File

@ -15,7 +15,7 @@ export enum UserRoles222 {
@Injectable()
export class SessionService {
private tokenJwt = null;
public sessionData = null;
public sessionId = null;
public userLogin = null;
public userAdmin = null;
public userEMail = null;
@ -31,22 +31,22 @@ export class SessionService {
/**
* @brief Create a new session.
*
* @param sessionData -
* @param sessionId -
* @param userId -
* @param userLogin -
* @param userEMail -
* @param userAdmin -
* @param userAvatar -
*/
create(sessionData,
create(sessionId,
userId: string,
userLogin: string,
userEMail: string,
userAdmin: boolean,
userAvatar: string) {
console.log(`Session Create: userId=${userId} userLogin=${userLogin} userEMail=${userEMail} userAdmin=${userAdmin} userAvatar=${userAvatar} `);
console.log(`Session Create: userId=${userId} userLogin=${userLogin} userEMail=${userEMail} userAdmin=${userAdmin} userAvatar=${userAvatar} sessionId = ${sessionId}`);
this.tokenJwt = undefined;
this.sessionData = sessionData;
this.sessionId = sessionId;
this.userId = userId;
this.userLogin = userLogin;
this.userAdmin = userAdmin;
@ -60,8 +60,8 @@ export class SessionService {
*/
destroy() {
console.log('Session REMOVE');
let last = this.sessionData;
this.sessionData = null;
let last = this.sessionId;
this.sessionId = null;
this.tokenJwt = undefined;
this.userId = null;
this.userLogin = null;
@ -77,7 +77,7 @@ export class SessionService {
return this.tokenJwt;
}
islogged() {
return this.sessionData !== null;
return this.sessionId !== null;
}
hasRight(type) {
if(type === UserRoles222.admin) {
@ -86,7 +86,7 @@ export class SessionService {
}
if(type === UserRoles222.user) {
// is connected ==> is user
return this.sessionData !== null;
return this.sessionId !== null;
}
if(type === UserRoles222.guest) {
// all the other ... maybe unneeded

View File

@ -14,6 +14,7 @@ export class SSOService {
console.log('Start SSOService');
}
utf8_to_b64( str:string ): string {
// remove unneeded "=" padding
return window.btoa(unescape(encodeURIComponent( str ))).replace("=", "");
}

View File

@ -151,17 +151,5 @@ export class TypeService {
});
}
getCoverUrl(coverId:number): string {
return this.http.createRESTCall2({
api: `data/${coverId}`,
addURLToken: true,
});
}
getCoverThumbnailUrl(coverId:number): string {
return this.http.createRESTCall2({
api: `data/thumbnail/${coverId}`,
addURLToken: true,
});
}
}

View File

@ -62,9 +62,6 @@ export class UniverseService {
let ret = this.http.putSpecific(this.serviceName, id, data);
return this.bdd.setAfterPut(this.serviceName, id, ret);
}
getCoverUrl(coverId:number):any {
return this.http.createRESTCall(`data/${ coverId}`);
}
deleteCover(nodeId:number,
coverId:number) {
let self = this;

View File

@ -85,8 +85,8 @@ export class UserService {
// Need to use the windows global route to prevent the log in cycle ...
// And in the mlain application position, the route does not have curently root the page
let pathName = window.location.pathname;
console.log("start Path-name: '" + pathName + "'");
console.log("check with: '" + environment.applName + "/sso/" + "'");
//console.log("start Path-name: '" + pathName + "'");
//console.log("check with: '" + environment.applName + "/sso/" + "'");
if (pathName.startsWith("/sso/") || pathName.startsWith(environment.applName + "/sso/")) {
console.log(" ==> SSo section");
reject();

View File

@ -47,18 +47,6 @@ export class VideoService {
let ret = this.http.deleteSpecific(this.serviceName, id);
return this.bdd.delete(this.serviceName, id, ret);
}
getCoverUrl(coverId:number):any {
return this.http.createRESTCall2({
api: `data/${coverId}`,
addURLToken: true,
});
}
getCoverThumbnailUrl(coverId:number):any {
return this.http.createRESTCall2({
api: `data/thumbnail/${coverId}`,
addURLToken: true,
});
}
uploadFile(file:File,
universe?:string,