-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update parser az #817
Merged
felixleo22
merged 2 commits into
ezpaarse-project:master
from
OCLC-Developer-Network:az
Apr 24, 2024
Merged
update parser az #817
felixleo22
merged 2 commits into
ezpaarse-project:master
from
OCLC-Developer-Network:az
Apr 24, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
felixleo22
requested changes
Apr 22, 2024
az/parser.js
Outdated
@@ -52,6 +52,30 @@ module.exports = new Parser(function analyseEC(parsedUrl, ec) { | |||
// http://aranzadi.aranzadidigital.es/maf/app/search/run/multi | |||
result.rtype = 'SEARCH'; | |||
result.mime = 'HTML'; | |||
} else if (/^\/maf\/app\/document$/i.test(path) && (marginal = param.marginal) != undefined && (marginal.split('\\')[0] === 'RJ' || marginal.split('\\')[0] === 'RCL')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can group several parsers into a single one by using lot of if or a switch.
} else if (/^\/maf\/app\/document$/i.test(path)) {
// /maf/app/document?startChunk=1&mdfilter=mdlegisfilter&endChunk=2&stid=marginal_chunk&ds=ARZ_LEGIS_CS&infotype=arz_legis&subResult=i0ad6adc60000018ed0247a839bee5891&docguid=I6b664a40e83811db8079010000000000&marginal=RCL\1999\710&spos=1&epos=1&version=19990406&displayName=&lang=spa
// /maf/app/document?srguid=i0ad6adc50000018ed0247dc8eb6fe26f&marginal=RJ\2017\1890&docguid=I03fcd8903aa011e79de2010000000000&ds=ARZ_LEGIS_CS&infotype=arz_doc-admin;&spos=1&epos=1&td=0&predefinedRelationshipsType=documentRetrieval&global-result-list=global&fromTemplate=&suggestScreen=&&selectedNodeName=&selec_mod=false&displayName=
marginal = param.marginal
if (marginal.split('\\')[0] === 'RJ' || marginal.split('\\')[0] === 'RCL') {
// /maf/app/document?startChunk=1&mdfilter=mdlegisfilter&endChunk=2&stid=marginal_chunk&ds=ARZ_LEGIS_CS&infotype=arz_legis&subResult=i0ad6adc60000018ed0247a839bee5891&docguid=I6b664a40e83811db8079010000000000&marginal=RCL\1999\710&spos=1&epos=1&version=19990406&displayName=&lang=spa
// /maf/app/document?srguid=i0ad6adc50000018ed0247dc8eb6fe26f&marginal=RJ\2017\1890&docguid=I03fcd8903aa011e79de2010000000000&ds=ARZ_LEGIS_CS&infotype=arz_doc-admin;&spos=1&epos=1&td=0&predefinedRelationshipsType=documentRetrieval&global-result-list=global&fromTemplate=&suggestScreen=&&selectedNodeName=&selec_mod=false&displayName=
result.rtype = 'ARTICLE';
result.mime = 'HTML';
result.unitid = marginal;
}
if (marginal.split('\\')[0] === 'BIB') {
// /maf/app/document?srguid=i0ad6adc50000018ed0247a19ba6a7861&marginal=BIB\2021\1098&docguid=I2e8fecd0a23611ebaf9ae70e1612b1e3&ds=ARZ_LEGIS_CS&infotype=arz_biblos;&spos=1&epos=1&td=0&predefinedRelationshipsType=documentRetrieval&fromTemplate=&suggestScreen=&&selectedNodeName=&selec_mod=false&displayName=
// /maf/app/document?srguid=i0ad6adc50000018ed0247a19ba6a7861&marginal=BIB\2015\322&docguid=Idbdd5360a82c11e4b065010000000000&ds=ARZ_LEGIS_CS&infotype=arz_biblos;&spos=5&epos=5&td=0&predefinedRelationshipsType=documentRetrieval&fromTemplate=&suggestScreen=&&selectedNodeName=&selec_mod=false&displayName=
result.rtype = 'BOOK';
result.mime = 'HTML';
result.unitid = marginal;
}
if (marginal.split('\\')[0] === 'FOR') {
// /maf/app/document?srguid=i0ad6adc50000018ed0247c23d3a4bb99&marginal=FOR\2012\839&docguid=I0eb20050b1e111e1847d010000000000&ds=ARZ_LEGIS_CS&infotype=arz_formularios;&spos=1&epos=1&td=0&predefinedRelationshipsType=documentRetrieval&fromTemplate=&suggestScreen=&&selectedNodeName=&selec_mod=false&displayName=
// /maf/app/document?srguid=i0ad6adc50000018ed0247c23d3a4bb99&marginal=FOR\2011\924&docguid=I55351570de7f11e0a788010000000000&ds=ARZ_LEGIS_CS&infotype=arz_formularios;&spos=8&epos=8&td=0&predefinedRelationshipsType=documentRetrieval&fromTemplate=&suggestScreen=&&selectedNodeName=&selec_mod=false&displayName=
result.rtype = 'FORMULES';
result.mime = 'HTML';
result.unitid = marginal;
}
if (marginal.split('\\')[0] === 'MIX') {
// /maf/app/document?srguid=i0ad6adc50000018ed0247b3d15b13605&marginal=MIX\2023\211717&docguid=Id421ff501ef611eeba5fb46f48ac422d&ds=ARZ_LEGIS_CS&infotype=arz_cuadros;&spos=1&epos=1&td=0&predefinedRelationshipsType=documentRetrieval&fromTemplate=&suggestScreen=&&selectedNodeName=&selec_mod=false&displayName=
// /maf/app/document?srguid=i0ad6adc50000018ed0247b3d15b13605&marginal=MIX\2004\583&docguid=I4aa5994075a211dba338010000000000&ds=ARZ_LEGIS_CS&infotype=arz_cuadros;&spos=2&epos=2&td=0&predefinedRelationshipsType=documentRetrieval&fromTemplate=&suggestScreen=&&selectedNodeName=&selec_mod=false&displayName=#
result.rtype = 'IMAGE';
result.mime = 'PDF';
result.unitid = marginal;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I have modified the code. Please check.
Thanks!
felixleo22
approved these changes
Apr 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.