- npm updates
- uncomment eprints description inside datasetxml2oai-pmh.xslt - test with multer for uploading files multipart/form-data - allow post and get methods dor oai.controller.ts
This commit is contained in:
parent
05e9273823
commit
6944deac83
|
@ -144,7 +144,7 @@
|
|||
</sampleIdentifier>
|
||||
</oai-identifier>
|
||||
</description>
|
||||
<description>
|
||||
<!-- <description>
|
||||
<eprints xmlns="http://www.openarchives.org/OAI/1.1/eprints" xsi:schemaLocation="http://www.openarchives.org/OAI/1.1/eprints http://www.openarchives.org/OAI/1.1/eprints.xsd">
|
||||
<content>
|
||||
<text>
|
||||
|
@ -166,7 +166,7 @@
|
|||
See https://gitea.geologie.ac.at/geolba/tethys/ for more information.
|
||||
</comment>
|
||||
</eprints>
|
||||
</description>
|
||||
</description> -->
|
||||
</Identify>
|
||||
</xsl:template>
|
||||
|
||||
|
|
|
@ -106,3 +106,10 @@ git config --global user.email
|
|||
|
||||
git remote add origin https://gitea.geologie.ac.at/geolba/tethys.api.git
|
||||
git push -o repo.private=false --set-upstream origin master
|
||||
|
||||
|
||||
|
||||
npm install --save multer
|
||||
|
||||
curl -X POST -d "verb=identify" -H "Content-Type: application/xml" http://localhost:3000/oai
|
||||
curl -X POST -H "Content-Type: application/xml" -d '{"verb": "Identify"}' http://localhost:8080/oai
|
|
@ -41,10 +41,13 @@ export class App extends Server {
|
|||
});
|
||||
|
||||
// this.app.use(bodyParser.json());
|
||||
// this.app.use(bodyParser.urlencoded({ extended: true }));
|
||||
// for parsing application/json
|
||||
this.app.use(bodyParser.json({ limit: "100mb" }));
|
||||
// for parsing application/xwww-
|
||||
this.app.use(bodyParser.urlencoded({ limit: "50mb", extended: true }));
|
||||
this.app.use(bodyParser.json({ type: "application/vnd.api+json" }));
|
||||
// this.app.use(forms.array());
|
||||
// for parsing multipart/form-data = uploads
|
||||
// this.app.use(upload.array());
|
||||
}
|
||||
|
||||
private boostrap(): void {
|
||||
|
|
|
@ -88,7 +88,16 @@ export class OaiController {
|
|||
(earliestDateFromDb = dayjs(firstPublishedDataset.server_date_published).format("YYYY-MM-DDTHH:mm:ss[Z]"));
|
||||
this.xsltParameter["earliestDatestamp"] = earliestDateFromDb;
|
||||
|
||||
const oaiRequest: OaiParameter = request.query;
|
||||
let oaiRequest: OaiParameter = {};
|
||||
if (request.method == "POST") {
|
||||
oaiRequest = request.body;
|
||||
} else if (request.method == "GET") {
|
||||
oaiRequest = request.query;
|
||||
} else {
|
||||
this.xsltParameter["oai_error_code"] = "unknown";
|
||||
this.xsltParameter["oai_error_message"] = "An internal error occured.";
|
||||
}
|
||||
// const oaiRequest: OaiParameter = request.body;
|
||||
try {
|
||||
await this.handleRequest(oaiRequest, request);
|
||||
} catch (error) {
|
||||
|
@ -506,7 +515,7 @@ export class OaiController {
|
|||
OaiErrorCodes.BADARGUMENT,
|
||||
);
|
||||
}
|
||||
fromDate = dayjs.tz(from, "Europe/Vienna")
|
||||
fromDate = dayjs.tz(from, "Europe/Vienna");
|
||||
fromDate.hour() == 0 && (fromDate = fromDate.startOf("day"));
|
||||
|
||||
const now = dayjs();
|
||||
|
|
Loading…
Reference in New Issue
Block a user