- add classes inside app/library for creting Tethys xml: Field.ts, Strategy.ts, XmlModel.ts
Some checks failed
CI Pipeline / japa-tests (push) Failing after 51s
Some checks failed
CI Pipeline / japa-tests (push) Failing after 51s
- added model DocumentXmlCache.ts - npm updates - changed all models inside app/Models to use corrected BaseModel.ts - added extra extension class DatasetExtension.ts for app/dataset.ts for caching internal and external fields
This commit is contained in:
parent
4ad281bcd4
commit
ebb24cc75c
24 changed files with 1170 additions and 324 deletions
|
@ -33,6 +33,8 @@ import ClamScan from 'clamscan';
|
|||
import { ValidationException } from '@ioc:Adonis/Core/Validator';
|
||||
import Drive from '@ioc:Adonis/Core/Drive';
|
||||
import { Exception } from '@adonisjs/core/build/standalone';
|
||||
import XmlModel from 'App/Library/XmlModel';
|
||||
import { XMLBuilder } from 'xmlbuilder2/lib/interfaces';
|
||||
|
||||
export default class DatasetController {
|
||||
public async index({ auth, request, inertia }: HttpContextContract) {
|
||||
|
@ -342,9 +344,9 @@ export default class DatasetController {
|
|||
// Create a new instance of the Dataset model:
|
||||
const dataset = new Dataset();
|
||||
dataset.type = request.input('type');
|
||||
dataset.creatingCorporation = request.input('creating_corporation');
|
||||
dataset.creating_corporation = request.input('creating_corporation');
|
||||
dataset.language = request.input('language');
|
||||
dataset.embargoDate = request.input('embargo_date');
|
||||
dataset.embargo_date = request.input('embargo_date');
|
||||
//await dataset.related('user').associate(user); // speichert schon ab
|
||||
// Dataset.$getRelation('user').boot();
|
||||
// Dataset.$getRelation('user').setRelated(dataset, user);
|
||||
|
@ -577,6 +579,23 @@ export default class DatasetController {
|
|||
'files.extnames': 'file extension is not supported',
|
||||
};
|
||||
|
||||
private async getDatasetXmlDomNode(dataset: Dataset) {
|
||||
// dataset.fetchValues();
|
||||
const xmlModel = new XmlModel(dataset);
|
||||
// xmlModel.setModel(dataset);
|
||||
xmlModel.excludeEmptyFields();
|
||||
xmlModel.caching = true;
|
||||
// const cache = dataset.xmlCache ? dataset.xmlCache : null;
|
||||
// dataset.load('xmlCache');
|
||||
if (dataset.xmlCache) {
|
||||
xmlModel.xmlCache = dataset.xmlCache;
|
||||
}
|
||||
|
||||
// return cache.getDomDocument();
|
||||
const domDocument: XMLBuilder | null = await xmlModel.getDomDocument();
|
||||
return domDocument;
|
||||
}
|
||||
|
||||
// public async release({ params, view }) {
|
||||
public async release({ request, inertia, response }: HttpContextContract) {
|
||||
const id = request.param('id');
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue