Skip to content

Commit

Permalink
Collection view (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvanheller authored Apr 26, 2022
1 parent 7b7e0be commit e6977e8
Show file tree
Hide file tree
Showing 19 changed files with 7,043 additions and 10,103 deletions.
1 change: 1 addition & 0 deletions openapi/cineast/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ model/featuresByCategoryQueryResult.ts
model/featuresByEntityQueryResult.ts
model/featuresTextCategoryQueryResult.ts
model/idList.ts
model/integerMessage.ts
model/mediaObjectDescriptor.ts
model/mediaObjectMetadataDescriptor.ts
model/mediaObjectMetadataQueryResult.ts
Expand Down
60 changes: 60 additions & 0 deletions openapi/cineast/api/misc.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { ColumnSpecification } from '../model/columnSpecification';
// @ts-ignore
import { DistinctElementsResult } from '../model/distinctElementsResult';
// @ts-ignore
import { IntegerMessage } from '../model/integerMessage';
// @ts-ignore
import { SelectResult } from '../model/selectResult';
// @ts-ignore
import { SelectSpecification } from '../model/selectSpecification';
Expand Down Expand Up @@ -93,6 +95,64 @@ export class MiscService {
return httpParams;
}

/**
* Count objects
* Equivalent to calling SELECT count(*) FROM table. Used to determined #pages for pagination in a frontend or statistical purposes
* @param table
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public countRows(table: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<IntegerMessage>;
public countRows(table: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpResponse<IntegerMessage>>;
public countRows(table: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpEvent<IntegerMessage>>;
public countRows(table: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<any> {
if (table === null || table === undefined) {
throw new Error('Required parameter table was null or undefined when calling countRows.');
}

let localVarHeaders = this.defaultHeaders;

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}


let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

return this.httpClient.get<IntegerMessage>(`${this.configuration.basePath}/api/v1/count/table/${encodeURIComponent(String(table))}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
}
);
}

/**
* Find all distinct elements of a given column
* Find all distinct elements of a given column. Please note that this operation does cache results.
Expand Down
64 changes: 63 additions & 1 deletion openapi/cineast/api/object.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class ObjectService {
* Find object by specified attribute value. I.e by id, name or path
* Find object by specified attribute value. I.e by id, name or path
* @param attribute The attribute type of the value. One of: id, name, path
* @param value
* @param value The actual value that you want to filter for
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
Expand Down Expand Up @@ -270,4 +270,66 @@ export class ObjectService {
);
}

/**
* Get a fixed amount of objects from the sorted list
* Equivalent to calling SELECT * FROM multimediaobject ORDER BY objectid ASC LIMIT limit SKIP skip. Mostly used for pagination when wanting to retrieve all objects
* @param skip How many objects should be skipped
* @param limit How many object at most should be fetched
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public findObjectsPagination(skip: number, limit: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<MediaObjectQueryResult>;
public findObjectsPagination(skip: number, limit: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpResponse<MediaObjectQueryResult>>;
public findObjectsPagination(skip: number, limit: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<HttpEvent<MediaObjectQueryResult>>;
public findObjectsPagination(skip: number, limit: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext}): Observable<any> {
if (skip === null || skip === undefined) {
throw new Error('Required parameter skip was null or undefined when calling findObjectsPagination.');
}
if (limit === null || limit === undefined) {
throw new Error('Required parameter limit was null or undefined when calling findObjectsPagination.');
}

let localVarHeaders = this.defaultHeaders;

let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
'application/json'
];
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}


let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

return this.httpClient.get<MediaObjectQueryResult>(`${this.configuration.basePath}/api/v1/find/object/all/${encodeURIComponent(String(skip))}/${encodeURIComponent(String(limit))}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
}
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { QueryTerm } from './queryTerm';


export interface QueryComponent {
terms?: Array<QueryTerm>;
containerId?: number;
export interface IntegerMessage {
value?: number;
}

1 change: 1 addition & 0 deletions openapi/cineast/model/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export * from './featuresByCategoryQueryResult';
export * from './featuresByEntityQueryResult';
export * from './featuresTextCategoryQueryResult';
export * from './idList';
export * from './integerMessage';
export * from './mediaObjectDescriptor';
export * from './mediaObjectMetadataDescriptor';
export * from './mediaObjectMetadataQueryResult';
Expand Down
6 changes: 3 additions & 3 deletions openapi/cineast/model/queryConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export interface QueryConfig {
maxResults?: number;
relevantSegmentIds?: Set<string>;
correspondenceFunctionIfEmpty?: QueryConfig;
distanceIfEmpty?: QueryConfig;
distanceWeightsIfEmpty?: QueryConfig;
normIfEmpty?: QueryConfig;
correspondenceFunction?: object;
normIfEmpty?: QueryConfig;
distanceWeightsIfEmpty?: QueryConfig;
distanceIfEmpty?: QueryConfig;
rawResultsPerModule?: number;
}
export namespace QueryConfig {
Expand Down
4 changes: 2 additions & 2 deletions openapi/cineast/model/temporalQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export interface TemporalQuery {
queries: Array<StagedSimilarityQuery>;
config?: TemporalQueryConfig;
metadataAccessSpec?: Array<MetadataAccessSpecification>;
timeDistances?: Array<number>;
temporalQueryConfig?: TemporalQueryConfig;
maxLength?: number;
messageType?: TemporalQuery.MessageTypeEnum;
timeDistances?: Array<number>;
temporalQueryConfig?: TemporalQueryConfig;
}
export namespace TemporalQuery {
export type MessageTypeEnum = 'PING' | 'Q_SIM' | 'Q_MLT' | 'Q_NESEG' | 'Q_SEG' | 'M_LOOKUP' | 'Q_TEMPORAL' | 'SESSION_START' | 'QR_START' | 'QR_END' | 'QR_ERROR' | 'QR_OBJECT' | 'QR_METADATA_O' | 'QR_METADATA_S' | 'QR_SEGMENT' | 'QR_SIMILARITY' | 'QR_TEMPORAL';
Expand Down
6 changes: 3 additions & 3 deletions openapi/cineast/model/temporalQueryConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export interface TemporalQueryConfig {
maxResults?: number;
relevantSegmentIds?: Set<string>;
correspondenceFunctionIfEmpty?: QueryConfig;
distanceIfEmpty?: QueryConfig;
distanceWeightsIfEmpty?: QueryConfig;
normIfEmpty?: QueryConfig;
correspondenceFunction?: object;
normIfEmpty?: QueryConfig;
distanceWeightsIfEmpty?: QueryConfig;
distanceIfEmpty?: QueryConfig;
rawResultsPerModule?: number;
}
export namespace TemporalQueryConfig {
Expand Down
Loading

0 comments on commit e6977e8

Please sign in to comment.