diff --git a/cloudapp/src/app/ILL/full-view-display-member/full-view-display-member.component.html b/cloudapp/src/app/ILL/full-view-display-member/full-view-display-member.component.html new file mode 100644 index 0000000..1706015 --- /dev/null +++ b/cloudapp/src/app/ILL/full-view-display-member/full-view-display-member.component.html @@ -0,0 +1,20 @@ +
+
+
+ {{line.getHeaderLabel() | translate}} +
+
+
+
+ {{ field.getLabel() | translate}} +
+ + {{field.getContent()}} + + + {{field.getContent()}} + +
+
+
+
\ No newline at end of file diff --git a/cloudapp/src/app/ILL/full-view-display-member/full-view-display-member.component.scss b/cloudapp/src/app/ILL/full-view-display-member/full-view-display-member.component.scss new file mode 100644 index 0000000..0294850 --- /dev/null +++ b/cloudapp/src/app/ILL/full-view-display-member/full-view-display-member.component.scss @@ -0,0 +1,39 @@ +.full-view-line { + display: grid; + grid-template-columns: 300px auto; + padding-top: 0.5em; + padding-bottom: 0.5em; + &:first-child { + padding-right: 12px; + } +} + +.even { + background-color: whitesmoke; +} + +.full-view-line-header { + font-weight: bold; + padding-right: 15px; + padding-left: 5px; +} + +.full-view-line-content { + display: flex; + flex-wrap: wrap; +} + +.full-view-line-field { + display: flex; + padding-right: 10px; +} + +.full-view-line-field-label { + font-weight: bold; + padding-right: 5px; +} + +a, +a label { + cursor: pointer; +} \ No newline at end of file diff --git a/cloudapp/src/app/ILL/full-view-display-member/full-view-display-member.component.ts b/cloudapp/src/app/ILL/full-view-display-member/full-view-display-member.component.ts new file mode 100644 index 0000000..05c18bc --- /dev/null +++ b/cloudapp/src/app/ILL/full-view-display-member/full-view-display-member.component.ts @@ -0,0 +1,37 @@ +import { Component, Input, Output, EventEmitter } from '@angular/core'; +import { SearchType } from '../../user-controls/search-form/search-form-utils'; + + +@Component({ + selector: 'full-view-display-member', + templateUrl: './full-view-display-member.component.html', + styleUrls: ['./full-view-display-member.component.scss'] +}) + +export class FullviewDisplayOfMemComponent { + + @Input() resultFullDisplay; + @Output() onFullViewLinkSelected = new EventEmitter(); + + + constructor() { } + + onFullViewLink(searchType: SearchType, linkID: string) { + this.onFullViewLinkSelected.emit(new FullViewLink(searchType, linkID)); + } + + isEvenRow(i: number) { + if (i % 2 == 0) { + return "even"; + } + } + +} + + +export class FullViewLink { + constructor ( + public searchType: SearchType, + public linkID: string + ) { } +} \ No newline at end of file diff --git a/cloudapp/src/app/ILL/holdingSearch/holdingSearch-utils.ts b/cloudapp/src/app/ILL/holdingSearch/holdingSearch-utils.ts new file mode 100644 index 0000000..642a26c --- /dev/null +++ b/cloudapp/src/app/ILL/holdingSearch/holdingSearch-utils.ts @@ -0,0 +1,120 @@ +import { FormGroup, FormControl, Validators } from "@angular/forms"; + +export const holdingFormGroup = (holdingVolume): FormGroup =>{ + + var newHoldingSearch: boolean = false; + + if (holdingVolume == null) { + newHoldingSearch = true; + } + + return new FormGroup({ + FANO: new FormControl(newHoldingSearch ? '' : holdingVolume.FANO), + VOL_HLV: new FormControl(newHoldingSearch ? '' : holdingVolume.VOL_HLV), + CPYR_HLYR: new FormControl(newHoldingSearch ? '' : holdingVolume.CPYR_HLYR), + LOC: new FormControl(newHoldingSearch ? '' : holdingVolume.LOC), + KENCODE: new FormControl(newHoldingSearch ? '' : holdingVolume.KENCODE), + SETCODE: new FormControl(newHoldingSearch ? '' : holdingVolume.SETCODE), + ORGCODE: new FormControl(newHoldingSearch ? '' : holdingVolume.ORGCODE), + ILLFLG: new FormControl(newHoldingSearch ? '' : holdingVolume.ILLFLG), + STAT: new FormControl(newHoldingSearch ? '' : holdingVolume.STAT), + GRPCODE: new FormControl(newHoldingSearch ? '' : holdingVolume.GRPCODE), + COPYS: new FormControl(newHoldingSearch ? '' : holdingVolume.COPYS), + LOANS: new FormControl(newHoldingSearch ? '' : holdingVolume.LOANS), + FAXS: new FormControl(newHoldingSearch ? '' : holdingVolume.FAXS) + }); + +} + +export const initResourceInformationFormGroup = (): FormGroup =>{ + return new FormGroup ({ + ONO:new FormControl(), + PRMT:new FormControl(), + BIBID:new FormControl(), + STDNO:new FormControl(), + VOL:new FormControl(), + PAGE:new FormControl(), + YEAR:new FormControl(), + BIBNT:new FormControl('', [Validators.required]), + ARTCL:new FormControl() + }) +} + +export const initRequesterInformationFormGroup = (): FormGroup =>{ + return new FormGroup ({ + BVRFY:new FormControl(), + HVRFY:new FormControl(), + CLNT:new FormControl(), + CLNTP:new FormControl(), + ODATE:new FormControl(new Date().toISOString()), + + SENDCMNT:new FormControl(), + OSTAF:new FormControl('', [Validators.required]), + OADRS:new FormControl('', [Validators.required]), + OLDF:new FormControl(), + OLDAF:new FormControl(), + + OEDA:new FormControl() + }) +} + +export const initRotaFormGroup = (): FormGroup =>{ + return new FormGroup ({ + HMLID1:new FormControl(), + HMLID2:new FormControl(), + HMLID3:new FormControl(), + HMLID4:new FormControl(), + HMLID5:new FormControl(), + + HMLNM1:new FormControl(), + HMLNM2:new FormControl(), + HMLNM3:new FormControl(), + HMLNM4:new FormControl(), + HMLNM5:new FormControl(), + + LOC1:new FormControl(), + LOC2:new FormControl(), + LOC3:new FormControl(), + LOC4:new FormControl(), + LOC5:new FormControl(), + + + VOL1:new FormControl(), + VOL2:new FormControl(), + VOL3:new FormControl(), + VOL4:new FormControl(), + VOL5:new FormControl(), + + CLN1:new FormControl(), + CLN2:new FormControl(), + CLN3:new FormControl(), + CLN4:new FormControl(), + CLN5:new FormControl(), + + RGTN1:new FormControl(), + RGTN2:new FormControl(), + RGTN3:new FormControl(), + RGTN4:new FormControl(), + RGTN5:new FormControl() + }) +} + + + +export enum FieldName { + FANO = "FANO", + VOL = "VOL", + YEAR = "YEAR", + LOC = "LOC", + KENCODE = "_KENCODE_", + SETCODE = "_SETCODE_", + ORGCODE = "_ORGCODE_", + GRPCODE = "_GRPCODE_", + ILLFLG = "_ILLFLG_", + STAT = "_STAT_", + COPYS = "_COPYS_", + LOANS = "_LOANS_", + FAXS = "_FAXS_", + Owner = "owner", + nacsisId = "nacsisId" +} \ No newline at end of file diff --git a/cloudapp/src/app/ILL/holdingSearch/holdingSearch.component.html b/cloudapp/src/app/ILL/holdingSearch/holdingSearch.component.html new file mode 100644 index 0000000..e35d1b3 --- /dev/null +++ b/cloudapp/src/app/ILL/holdingSearch/holdingSearch.component.html @@ -0,0 +1,500 @@ +
+ + + +
+ +
+
+ +
+
+

{{'Holdings.Main.SerachHoldings' | translate}}

+
+ + +
+
+
+

{{mmsTitle}} ({{nacsisId}})

+
+
+ +
+ + +
+ + + + + {{ 'Catalog.Form.RefineSearch' | translate }} + + +
+
+ +
+
+ + ILL.HoldingSearch.ParticipatingOrgCode + + + + + ILL.HoldingSearch.Volume + + + + + ILL.HoldingSearch.Year + + + + + ILL.HoldingSearch.Location + + + + + ILL.HoldingSearch.RegionCode + + + {{regionCode}} + + + + + + ILL.HoldingSearch.EstablisherType + + + {{establisherType.viewValue | translate}} + + + + + + ILL.HoldingSearch.InstitutionType + + + {{institutionType.viewValue | translate}} + + + + + + ILL.HoldingSearch.ILLParticipationType + + + {{iLLParticipationType.viewValue | translate}} + + + + + + ILL.HoldingSearch.ServiceStatus + + + {{serviceStatus.viewValue | translate}} + + + + + + ILL.HoldingSearch.OffsetCharge + + + {{offsetCharge.viewValue | translate}} + + + + + + ILL.HoldingSearch.CopyServiceType + + + {{copyServiceType.viewValue | translate}} + + + + + + ILL.HoldingSearch.LendingServiceType + + + {{lendingServiceType.viewValue | translate}} + + + + + + ILL.HoldingSearch.FAXServiceType + + + {{fAXServiceType.viewValue | translate}} + + + +
+
+ +
+
+
+
+
+ +

+ +
+
+

{{'ILL.Results.Title' | translate}} ({{numOfResults}})

+
+ + {{'ILL.Results.SelectedLenders' | translate}} + + + {{index}} + + + +
+
+ +
+ + {{'Holdings.ViewHoldings.Owner' | translate}} + + + {{owner.name}} + + + +
+ + {{selectedIndex.length}} {{'ILL.Results.RowSelected' | translate}} + + + {{'ILL.Results.MaxRowSelected' | translate}} + + + {{'ILL.Results.ClearSelection' | translate}} +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {{element.index}} + + + + + {{'ILL.HoldingSearchResult.NAME' | translate}} + + {{element.name}} + + + {{'ILL.HoldingSearchResult.VOL' | translate}} + + + {{vol.VOL}} + + + + {{'ILL.HoldingSearchResult.HLV' | translate}} {{element.hlv}} + {{'ILL.HoldingSearchResult.HLYR' | translate}} {{element.hlyr}} + {{'ILL.HoldingSearchResult.KENCODE' | translate}} {{element.region}} + {{'ILL.HoldingSearchResult.SETCODE' | translate}} {{element.establisher}} + {{'ILL.HoldingSearchResult.ORGCODE' | translate}} {{element.institutionType}} + {{'ILL.HoldingSearchResult.LOC' | translate}} {{element.location}} + {{'ILL.HoldingSearchResult.SUM' | translate}} {{element.photoCopy_fee}} + {{'ILL.HoldingSearchResult.ILLFLG' | translate}} {{element.ill}} + {{'ILL.HoldingSearchResult.STAT' | translate}} {{element.stat}} + {{'ILL.HoldingSearchResult.COPYS' | translate}} {{element.photoCopy}} + {{'ILL.HoldingSearchResult.LOANS' | translate}} {{element.loan}} + {{'ILL.HoldingSearchResult.FAXS' | translate}} {{element.fax}} + + + +
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ {{element.id}} + + {{'ILL.HoldingSearchResult.CRTDT' | + translate}}:{{element.crtdt}} + + {{'ILL.HoldingSearchResult.RNWDT' | + translate}}:{{element.rnwdt}} +
+ {{'ILL.HoldingSearchResult.FANO' | translate}}: + + {{element.fano}} +
+ {{'ILL.HoldingSearchResult.NAME' | translate}}: + + {{element.name}} +
+ {{'ILL.HoldingSearchResult.LOC' | translate}}: + {{element.location}}
+ {{'ILL.HoldingSearchResult.Volume' | translate}}: + + {{'ILL.HoldingSearchResult.VOL' | + translate}}:{{volume.VOL}} + + {{'ILL.HoldingSearchResult.RGNT' | + translate}}:{{volume.RGNT}} + + {{'ILL.HoldingSearchResult.LDF' | + translate}}:{{volume.LDF}} +
+ {{'ILL.HoldingSearchResult.HLYR' | translate}}: + + {{element.hlyr}} +
+ {{'ILL.HoldingSearchResult.HLV' | translate}}: + + {{element.hlv}} +
+ {{'ILL.HoldingSearchResult.CLN' | translate}}: + + {{element.cln}} +
+ {{'ILL.HoldingSearchResult.LDF' | translate}}: + + {{element.ldf}} +
+
+ +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+
+


+ +
+ +

{{'Holdings.ViewHoldings.NoHoldingRecordsExist' | translate}}

+
+ +


\ No newline at end of file diff --git a/cloudapp/src/app/ILL/holdingSearch/holdingSearch.component.scss b/cloudapp/src/app/ILL/holdingSearch/holdingSearch.component.scss new file mode 100644 index 0000000..191eb06 --- /dev/null +++ b/cloudapp/src/app/ILL/holdingSearch/holdingSearch.component.scss @@ -0,0 +1,349 @@ +.align-space-between { + justify-content: space-between; + margin-bottom: 5px; + } + + .align-space-between-no-bottom { + justify-content: space-between; + } + + .align-to-left { + justify-content: flex-start; + margin-bottom: 15px; + } + + .align-to-right { + justify-content: flex-end; + margin-bottom: 15px; + } + + .align-to-right-no-bottom { + justify-content: flex-end; + } + + mat-form-field { + margin-top: 0px; + margin-bottom: 0px; + margin-right: 5px; + margin-left: 5px; + } + + mat-checkbox { + margin-left: 15px; + } + + mat-card { + margin-top: 10px; + margin-bottom: 10px; + margin-right: 10px; + margin-left: 0; + padding: 0px; + background: whitesmoke !important; + } + + + .form-wrapper { + flex-direction: column; + display: flex; + + .form-cards { + overflow: hidden; + padding-top: 0px; + padding-bottom: 10px; + padding-left: 0px; + padding-right: 0px; + margin-bottom: 40px; + .form-card-inputs { + padding-top: 10px; + ::ng-deep .mat-form-field-wrapper { + padding-bottom: 10px !important; + } + } + .form-card-input-full-width { + width: 96%; + padding-top: 10px; + min-width: 285px; + ::ng-deep .mat-form-field-wrapper { + padding-bottom: 10px !important; + } + } + .form-card-inputs-large { + padding-top: 10px; + width: 49%; + min-width: 285px; + flex-grow: 1; + ::ng-deep .mat-form-field-wrapper { + padding-bottom: 10px !important; + } + } + .form-card-inputs-medium { + padding-top: 10px; + width: 32.3%; + min-width: 285px; + flex-grow: 1; + + } + .form-card-inputs-small { + padding-top: 10px; + width: 24%; + flex-grow: 1; + min-width: 140px; + + } + } + + .form-commands { + margin-right: 15px; + } + + + + .align-to-right { + justify-content: flex-end; + margin-bottom: 20px; + } + + mat-list-item { + i.eca-button, + i.cloudapp-button { + visibility: visible !important; + } + &:hover i.eca-button, + &:hover i.cloudapp-button { + visibility: visible; + } + } + } + +.holdings-drop-down { + width: 100%; + background:rgb(238, 238, 238); + justify-content: space-between; + .holdings-mat-drop-down { + max-width: 200px; + width: 100%; + .mat-select { + min-width: 0px; + } + } + .align-to-right-no-bottom { + justify-content: flex-end; + padding: 20px; + .align-to-right-space{ + margin-right: 30px; + } + } +} + +#emptyList { + text-align: center; + height: fit-content; + //background-color: #f5f5f5; + margin-top: 40px; +} + + ::ng-deep.mat-menu-panel { + width: 150px; + position:fixed; + overflow: hidden; + } + +// ::ng-deep .mat-menu-content { +// width: 200px; +// } + +table { + width: 100%; +} + +:host ::ng-deep .mat-sort-header-container { + display: flex; + justify-content: center; +} + +:host ::ng-deep .hide-arrow .mat-sort-header-arrow { + color: #fff; + opacity: 0.54 !important; +} + +th.mat-sort-header-sorted { + color: #fff; +} + +th.mat-header-cell { + background-color: rgb(78, 78, 78); + color: white; +} + +.mat-column-select { + overflow: initial; +} + +td.mat-cell { + text-align: center; + border-left: 1px solid lightgray; + border-right: 1px solid lightgray; + border-bottom: 1px solid lightgray; +} + +td.mat-cell:first-child { + padding-left: 0px; + border-left: 1px solid lightgray; +} + +td.mat-cell:last-child { + padding-right: 0px; +} + + +th.mat-header-cell:first-child { + padding-left: 5px; + border-left: 1px solid lightgray; +} + +th.mat-header-cell:last-child { + padding-right: 0px; +} + + +.mat-column-index{ + width: 3% !important; +} +.mat-column-select{ + margin: 0,auto !important; + width: 3% !important; +} +.mat-column-ill{ + flex: 0 0 5%; +} +.mat-column-photoCopy_fee{ + flex: 0 0 5%; +} +.mat-column-stat{ + flex: 0 0 5%; +} +.mat-column-photoCopy{ + flex: 0 0 5%; +} +.mat-column-loan{ + flex: 0 0 5%; +} +.mat-column-fax{ + flex: 0 0 5%; +} + +tr.expand-detail-row { + height: 0; +} + +tr.expand-element-row:not(.expand-expanded-row):hover { + background: whitesmoke; +} + +tr.expand-element-row:not(.expand-expanded-row):active { + background: #efefef; +} +.expand-element-row td { + border-bottom-width: 0; +} + +.expand-element-detail { + overflow: hidden; + display: flex; +} + +.expand-element-diagram { + width: 100%; + border: 1px solid rgb(167, 167, 167); + padding: 8px; + font-weight: lighter; + margin: 8px 0; + text-align: left; + .noCollapse{ + border-collapse: collapse; + border-spacing: 0; + line-height: 34px; + } + .expand-tr { + background-color: whitesmoke; + } + .expand-left-column{ + width: 10%; + font-weight: bold; + text-align: left; + } + .expand-middle-column{ + width: 15%; + text-align: left; + .expand-middle-column-header{ + font-weight: bold; + } + } + .expand-right-column{ + text-align: left; + .expand-middle-column-header{ + font-weight: bold; + } + } + .expand-close-button{ + text-align: right; + margin-bottom: 5px; + } + +} + +.close-button { + background: transparent; + border: none; + position: absolute; + right: 2px; + top: 2px; + i { + font-size: 12px; + } +} + +.full-view { + display: flex; + flex-direction: row; + +} + +.full-view-line { + display: grid; + grid-template-columns: 250px auto; + padding-top: 0.5em; + padding-bottom: 0.5em; + &:first-child { + padding-right: 12px; + } +} + +.full-view-left-table { + flex: 1; + margin-right: 8px; +} + +.full-view-right-table { + position: relative; + flex: 1; +} + +a, +a label { + cursor: pointer; +} + +.top-title{ + width: 100%; + background: rgb(240, 240, 240); +} + +.selectedLenders{ + width:98%; + min-width: 250px; + margin-right: 17px; +} + + + diff --git a/cloudapp/src/app/ILL/holdingSearch/holdingSearch.component.ts b/cloudapp/src/app/ILL/holdingSearch/holdingSearch.component.ts new file mode 100644 index 0000000..7ec749b --- /dev/null +++ b/cloudapp/src/app/ILL/holdingSearch/holdingSearch.component.ts @@ -0,0 +1,822 @@ +import { Component, ViewChild, OnInit, OnChanges, ViewChildren, QueryList } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { TranslateService } from '@ngx-translate/core'; +import { HoldingsService, HoldingsSearch, NacsisHoldingRecord, DisplayHoldingResult, NacsisBookHoldingsListDetail, NacsisSerialHoldingsListDetail } from '../../service/holdings.service'; +import { MatDialog } from '@angular/material/dialog'; +import { AlertService } from '@exlibris/exl-cloudapp-angular-lib'; +import { AppRoutingState, ROUTING_STATE_KEY, RESULT_RECORD_LIST_ILL,SELECTED_RECORD_LIST_ILL} from '../../service/base.service'; +import { SelectionModel } from '@angular/cdk/collections'; +import { MatTableDataSource } from '@angular/material/table'; +import { FormGroup, FormControl } from '@angular/forms'; +import { IllService } from '../../service/ill.service'; +import { holdingFormGroup, FieldName } from './holdingSearch-utils'; +import { MatSort, Sort } from '@angular/material/sort'; +import { LiveAnnouncer } from '@angular/cdk/a11y'; +import { animate, state, style, transition, trigger } from '@angular/animations'; +import { NacsisCatalogResults, IDisplayLines } from '../../catalog/results-types/results-common' +import { CatalogService } from '../../service/catalog.service'; +import { SearchType } from '../../user-controls/search-form/search-form-utils'; +import { FullViewLink } from '../full-view-display-member/full-view-display-member.component'; + + +@Component({ + selector: 'ILL-holdingSearch', + templateUrl: './holdingSearch.component.html', + styleUrls: ['./holdingSearch.component.scss'], + animations: [ + trigger('detailExpand', [ + state('collapsed', style({ height: '0px', minHeight: '0' })), + state('expanded', style({ height: '*' })), + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')), + ]), + ], +}) + +export class HoldingSearchComponent implements OnInit, OnChanges { + //basic variable + nacsisId: string; + mmsTitle: string; + owners: any[]; + loading = false; + selected: string; + private isRightTableOpen: boolean = false; + private isColapsedMode: boolean = true; + + form: FormGroup; + holdingSearch: HoldingsSearch; + localLibraryID: string; + rawData: string; + localMemberInfo:any[]; + + // UI variables + private panelState: boolean = true; + regionCode = new FormControl(); + regionCodeList: string[] = [ + '01 北海道', '02 青森', '03 岩手', '04 宮城', '05 秋田', '06 山形', + '07 福島', '08 茨城', '09 栃木', '10 群馬', '11 埼玉', '12 千葉', + '13 東京', '14 神奈川', '15 新潟', '16 富山', '17 石川', '18 福井', + '19 山梨', '20 長野', '21 岐阜', '22 静岡', '23 愛知', '24 三重', + '25 滋賀', '26 京都', '27 大阪', '28 兵庫', '29 奈良', '30 和歌山', + '31 鳥取', '32 島根', '33 岡山', '34 広島', '35 山口', '36 徳島', + '37 香川', '38 愛媛', '39 高知', '40 福岡', '41 佐賀', '42 長崎', + '43 熊本', '44 大分', '45 宮崎', '46 鹿児島', '47 沖縄', 'なし 全国' + ]; + + establisherType = new FormControl(); + establisherTypeList: EstablisherType[] = [ + { value: '1', viewValue: 'ILL.OptionViewValue.SETCODE.National' }, + { value: '2', viewValue: 'ILL.OptionViewValue.SETCODE.Public' }, + { value: '3', viewValue: 'ILL.OptionViewValue.SETCODE.Private' }, + { value: '4', viewValue: 'ILL.OptionViewValue.SETCODE.SpecialPublicCorporation' }, + { value: '5', viewValue: 'ILL.OptionViewValue.SETCODE.Overseas' }, + { value: '8', viewValue: 'ILL.OptionViewValue.SETCODE.TrainingTesting' }, + { value: '9', viewValue: 'ILL.OptionViewValue.SETCODE.Other' } + ]; + + institutionType = new FormControl(); + institutionTypeList: InstitutionType[] = [ + { value: '1', viewValue: 'ILL.OptionViewValue.ORGCODE.University' }, + { value: '2', viewValue: 'ILL.OptionViewValue.ORGCODE.JuniorCollege' }, + { value: '3', viewValue: 'ILL.OptionViewValue.ORGCODE.CollegeOfTechnology' }, + { value: '4', viewValue: 'ILL.OptionViewValue.ORGCODE.InterResearchInstitutes' }, + { value: '5', viewValue: 'ILL.OptionViewValue.ORGCODE.FacilitiesOfOtherMinistries' }, + { value: '8', viewValue: 'ILL.OptionViewValue.ORGCODE.TrainingTesting' }, + { value: '9', viewValue: 'ILL.OptionViewValue.ORGCODE.Other' } + ]; + + iLLParticipationType = new FormControl(); + iLLParticipationTypeList: ILLParticipationType[] = [ + { value: '', viewValue: 'ILL.OptionViewValue.ILLFLG.None' }, + { value: 'A', viewValue: 'ILL.OptionViewValue.ILLFLG.Participate' }, + { value: 'N', viewValue: 'ILL.OptionViewValue.ILLFLG.DoNotParticipate' } + ]; + + serviceStatus = new FormControl(); + serviceStatusList: ServiceStatus[] = [ + { value: '', viewValue: 'ILL.OptionViewValue.STAT.None' }, + { value: 'A', viewValue: 'ILL.OptionViewValue.STAT.Available' }, + { value: 'N', viewValue: 'ILL.OptionViewValue.STAT.NotAvailable' } + ]; + + offsetCharge = new FormControl(); + offsetChargeList: OffsetCharge[] = [ + { value: '', viewValue: 'ILL.OptionViewValue.GRPCODE.None' }, + { value: 'N', viewValue: 'ILL.OptionViewValue.GRPCODE.ParticipateILLOffsetService' } + ]; + + copyServiceType = new FormControl(); + copyServiceTypeList: CopyServiceType[] = [ + { value: 'A', viewValue: 'ILL.OptionViewValue.COPYS.Accept' }, + { value: 'C', viewValue: 'ILL.OptionViewValue.COPYS.AcceptAtOtherCounters' }, + { value: 'N', viewValue: 'ILL.OptionViewValue.COPYS.NotAccepted' } + ]; + + lendingServiceType = new FormControl(); + lendingServiceTypeList: LendingServiceType[] = [ + { value: 'A', viewValue: 'ILL.OptionViewValue.LOANS.Accept' }, + { value: 'C', viewValue: 'ILL.OptionViewValue.LOANS.AcceptAtOtherCounters' }, + { value: 'N', viewValue: 'ILL.OptionViewValue.LOANS.NotAccepted' } + ]; + + fAXServiceType = new FormControl(); + fAXServiceTypeList: FAXServiceType[] = [ + { value: 'A', viewValue: 'ILL.OptionViewValue.FAXS.Available' }, + { value: 'C', viewValue: 'ILL.OptionViewValue.FAXS.ConditionallyAvailable' }, + { value: 'N', viewValue: 'ILL.OptionViewValue.FAXS.NotAvailable' } + ]; + + //result view + displayHoldingResult = new MatTableDataSource(); + @ViewChild(MatSort) sort: MatSort; + @ViewChildren('myCheckbox') private myCheckboxes: QueryList; + + nacsisHoldingsResultList: Array = new Array(); + holdings: DisplayHoldingResult[]; + noHoldingRecords: boolean = false; + isBook: boolean = false; + public ACTIONS_MENU_LIST: string[] = [ + 'ILL.Results.Actions.ViewHolding', 'ILL.Results.Actions.ViewMemInfo' + ]; + + //selection box + selectedIndex: any = []; + isMaxRowSelected: boolean = false; + numOfResults: number; + selection = new SelectionModel(true, []); + selecedData: any = []; + selectedVolMap = new Map(); + + //expand details + expandedElement: DisplayHoldingResult | null; + isViewHolding: boolean = true; + public currentSearchType: SearchType = SearchType.Members; + public routerSearchType: SearchType = SearchType.Monographs; + private catalogResultsData: NacsisCatalogResults; + private resultsSummaryDisplay: Array; + private resultFullDisplay; + private resultFullLinkDisplay; + public ALL_DATABASES_MAP_SEARCH = new Map([ + [SearchType.Monographs, ['BOOK', 'PREBOOK', 'JPMARC', 'TRCMARC', 'USMARC', 'USMARCX', 'GPOMARC', 'UKMARC', 'REMARC', 'DNMARC', 'CHMARC', 'KORMARC', 'RECON', 'HBZBKS', 'SPABKS', 'ITABKS', 'KERISB', 'KERISX', 'BNFBKS']], + [SearchType.Serials, ['SERIAL', 'JPMARCS', 'USMARCS', 'SPASER', 'ITASER', 'KERISS', 'BNFSER']], + [SearchType.Names, ['NAME', 'JPMARCA', 'USMARCA']], + [SearchType.UniformTitles, ['TITLE', 'USMARCT']] + ]); + + constructor( + private route: ActivatedRoute, + private router: Router, + private illService: IllService, + private catalogService: CatalogService, + private translate: TranslateService, + private nacsis: HoldingsService, + private alert: AlertService, + private _liveAnnouncer: LiveAnnouncer + + ) { + this.owners = [ + { id: "0", name: this.translate.instant('Holdings.ViewHoldings.All') }, + { id: "1", name: this.translate.instant('Holdings.ViewHoldings.Mine') } + ]; + } + + + ngOnInit() { + this.nacsisId = this.route.snapshot.params['nacsisId']; + this.mmsTitle = this.route.snapshot.params['mmsTitle']; + this.routerSearchType = this.route.snapshot.params['searchType']; + + + this.form = holdingFormGroup(null); + this.selection = new SelectionModel(true, []); + this.isMaxRowSelected = false; + let lastResult = sessionStorage.getItem(RESULT_RECORD_LIST_ILL); + this.selected = "0"; + if(!this.illService.isEmpty(lastResult)){ + this.holdings = JSON.parse(lastResult); + this.ngOnChanges(this.holdings); + this.panelState = false; + } + } + + ngOnChanges(holdings) { + this.displayHoldingResult = new MatTableDataSource(holdings); + this.displayHoldingResult.sort = this.sort; + this.selectedVolMap = new Map(); + this.numOfResults = holdings.length; + } + + search() { + this.loading = true; + let queryParams = this.buildQueryUrl(); + this.clearSelection(); + try { + this.nacsis.getHoldingsForILLFromNacsis(queryParams) + .subscribe({ + next: (header) => { + if (header.status === this.nacsis.OkStatus) { + this.nacsisHoldingsResultList = header.nacsisRecordList; + this.localLibraryID = header.FANO; + this.isBook = (header.type == 'BOOK') ? true : false; + if (this.nacsisHoldingsResultList != null && this.nacsisHoldingsResultList.length > 0) { + this.holdings = this.setDisplayDetails(this.nacsisHoldingsResultList); + this.ngOnChanges(this.holdings); + sessionStorage.setItem(RESULT_RECORD_LIST_ILL, JSON.stringify(this.holdings)); + this.noHoldingRecords = false; + } else { + this.holdings = new Array(); + this.noHoldingRecords = true; + this.numOfResults = 0; + } + } else { + this.holdings = new Array(); + this.noHoldingRecords = true; + this.numOfResults = 0; + } + }, + error: e => { + this.loading = false; + console.log(e.message); + this.alert.error(e.message, { keepAfterRouteChange: true }); + }, + complete: () => { + this.loading = false; + this.panelState = false; + + } + }); + } catch (e) { + this.loading = false; + this.panelState = false; + console.log(e); + this.alert.error(this.translate.instant('General.Errors.generalError'), { keepAfterRouteChange: true }); + } + } + + buildQueryUrl() { + let urlParams = ""; + urlParams = "nacsisId=" + this.nacsisId; + + urlParams = this.buildParamField_text(urlParams, FieldName.FANO, this.form.value.FANO); + urlParams = this.buildParamField_text(urlParams, FieldName.VOL, this.form.value.VOL_HLV); + urlParams = this.buildParamField_text(urlParams, FieldName.YEAR, this.form.value.CPYR_HLYR); + urlParams = this.buildParamField_text(urlParams, FieldName.LOC, this.form.value.LOC); + + urlParams = this.buildParamField_selectBox(urlParams, FieldName.KENCODE, this.regionCode.value); + urlParams = this.buildParamField_selectBox(urlParams, FieldName.SETCODE, this.establisherType.value); + urlParams = this.buildParamField_selectBox(urlParams, FieldName.ORGCODE, this.institutionType.value); + urlParams = this.buildParamField_text(urlParams, FieldName.GRPCODE, this.offsetCharge.value); + + urlParams = this.buildParamField_text(urlParams, FieldName.ILLFLG, this.iLLParticipationType.value); + urlParams = this.buildParamField_text(urlParams, FieldName.STAT, this.serviceStatus.value); + urlParams = this.buildParamField_selectBox(urlParams, FieldName.COPYS, this.copyServiceType.value); + urlParams = this.buildParamField_selectBox(urlParams, FieldName.LOANS, this.lendingServiceType.value); + + urlParams = this.buildParamField_selectBox(urlParams, FieldName.FAXS, this.fAXServiceType.value); + return urlParams; + } + + buildParamField_text(urlParams, fieldName, fieldValue) { + if (!this.illService.isEmpty(fieldValue)) { + urlParams = urlParams + "&" + fieldName; + urlParams = urlParams + "=" + fieldValue; + } + return urlParams; + } + + buildParamField_selectBox(urlParams, fieldName, fieldValue) { + if (!this.illService.isEmpty(fieldValue)) { + let valueArr = fieldValue; + urlParams = urlParams + "&" + fieldName; + let concatValue = ""; + valueArr.forEach(value => { + value = value.split(" ")[0]; + concatValue = concatValue.concat(value, ','); + }); + urlParams = urlParams + "=" + concatValue; + if (urlParams.endsWith(",")) { + urlParams = urlParams.substring(0, urlParams.length - 1); + } + } + return urlParams; + } + + clear() { + this.ngOnInit(); + this.regionCode = new FormControl(); + this.establisherType = new FormControl(); + this.institutionType = new FormControl(); + this.serviceStatus = new FormControl(); + this.offsetCharge = new FormControl(); + this.copyServiceType = new FormControl(); + this.lendingServiceType = new FormControl(); + this.fAXServiceType = new FormControl(); + this.iLLParticipationType = new FormControl(); + this.holdings = new Array(); + this.panelState = true; + this.selected = "0"; + this.selectedVolMap = new Map(); + this.holdings = new Array(); + } + + panelOpenState() { + this.panelState = true; + } + + panelCloseState() { + this.panelState = false; + } + + isHoldingRecordsExist() { + return (this.holdings && this.holdings.length > 0); + } + + getDisplayedColumns(): string[] { + if (this.isBook) { + return ['index', 'select', 'name', 'vol', 'region', + 'establisher', 'institutionType', 'location', 'photoCopy_fee', 'ill', 'stat', + 'photoCopy', 'loan', 'fax', 'actionsColumn']; + } else { + return ['index', 'select', 'name', 'hlv', 'hlyr', 'region', + 'establisher', 'institutionType', 'location', 'photoCopy_fee', 'ill', 'stat', + 'photoCopy', 'loan', 'fax', 'actionsColumn']; + } + } + + getExpandedDetailColumns(): string[] { + if (this.isViewHolding) { + return ['viewHoldingDetail']; + } else { + return ['viewMemInfoDetail']; + } + } + + announceSortChange(sortState: Sort) { + + if (sortState.direction) { + this._liveAnnouncer.announce(`Sorted ${sortState.direction}ending`); + } else { + this._liveAnnouncer.announce('Sorting cleared'); + } + } + + setDisplayDetails(nacsisHoldingsResultList: any[]) { + let index: number = 0; + this.holdings = new Array(); + nacsisHoldingsResultList.forEach(nacsisHoldingsResult => { + let holding: DisplayHoldingResult = new DisplayHoldingResult(); + let nacsisHoldingsList = new Array(); + index++; + holding.index = index; + holding.name = nacsisHoldingsResult.LIBABL; + + // VOL or HLV + nacsisHoldingsList = nacsisHoldingsResult.nacsisHoldingsList; + if (nacsisHoldingsList != null && nacsisHoldingsList.length > 0) { + if (this.isBook) { + holding.vol = this.extractVolFromHoldingList(nacsisHoldingsList, 'vol'); + } else { + holding.hlv = this.extractHlvFromHoldingList(nacsisHoldingsList, 'hlv'); + holding.hlyr = this.extractHlvFromHoldingList(nacsisHoldingsList, 'hlyr'); + holding.cln = this.extractHlvFromHoldingList(nacsisHoldingsList, 'cln'); + holding.ldf = this.extractHlvFromHoldingList(nacsisHoldingsList, 'ldf'); + } + } + + holding.region = this.convertMapping(nacsisHoldingsResult.KENCODE, 'KENCODE'); + holding.establisher = this.convertMapping(nacsisHoldingsResult.SETCODE, 'SETCODE'); + holding.institutionType = this.convertMapping(nacsisHoldingsResult.ORGCODE, 'ORGCODE'); + holding.fee = nacsisHoldingsResult.GRPCODE; + holding.location = nacsisHoldingsResult.LOC; + holding.photoCopy_fee = nacsisHoldingsResult.SUM; + holding.ill = nacsisHoldingsResult.ILLFLG; + holding.stat = nacsisHoldingsResult.STAT; + holding.photoCopy = nacsisHoldingsResult.COPYS; + holding.loan = nacsisHoldingsResult.LOANS; + holding.fax = nacsisHoldingsResult.FAXS; + //extend data + holding.id = nacsisHoldingsResult.ID; + holding.crtdt = this.formatDate(nacsisHoldingsResult.CRTDT); + holding.rnwdt = this.formatDate(nacsisHoldingsResult.RNWDT); + holding.fano = nacsisHoldingsResult.FANO; + + holding.isSelected = false; + holding.memberinfo = []; + this.holdings.push(holding); + }); + + return this.holdings; + } + + convertMapping(code: any, tag: string) { + let name = ''; + let paramsMap = new Map(); + switch (tag) { + case 'KENCODE': + paramsMap = this.fillParamMapWithTypeList(paramsMap, this.regionCodeList); + break; + case 'SETCODE': + paramsMap = this.fillParamMapWithTypeList(paramsMap, this.illService.establisherTypeResult); + break; + case 'ORGCODE': + paramsMap = this.fillParamMapWithTypeList(paramsMap, this.illService.institutionTypeResult); + break; + case 'CATFLG': + paramsMap = this.fillParamMapWithTypeList(paramsMap, this.illService.iLLParticipationTypeResult); + break; + + case 'COPYS': + paramsMap = this.fillParamMapWithTypeList(paramsMap, this.illService.copyServiceTypeResult); + break; + + case 'FAXS': + paramsMap = this.fillParamMapWithTypeList(paramsMap, this.illService.fAXServiceTypeResult); + break; + + case 'GRPCODE': + paramsMap = this.fillParamMapWithTypeList(paramsMap, this.illService.offsetCodeTypeResult); + break; + + } + name = paramsMap.get(code); + return name; + } + + fillParamMapWithTypeList(paramsMap, CodeAndNameList) { + CodeAndNameList.forEach(CodeAndName => { + paramsMap.set(CodeAndName.split(" ")[0], CodeAndName.split(" ")[1]); + }) + return paramsMap; + } + + extractVolFromHoldingList(nacsisHoldingsList: any[], tag: string) { + + let fieldArr = []; + let indexVol: number = 0; + nacsisHoldingsList.forEach(nacsisHolding => { + + let bookHolDetail: NacsisBookHoldingsListDetail = new NacsisBookHoldingsListDetail(); + switch (tag) { + case 'vol': + bookHolDetail.index = indexVol; + bookHolDetail.VOL = this.illService.isEmpty(nacsisHolding.VOL) ? '' : nacsisHolding.VOL; + bookHolDetail.RGTN = this.illService.isEmpty(nacsisHolding.RGTN) ? '' : nacsisHolding.RGTN; + bookHolDetail.LDF = this.illService.isEmpty(nacsisHolding.LDF) ? '' : nacsisHolding.LDF; + if (!this.illService.isEmpty(bookHolDetail.VOL)) { + fieldArr.push(bookHolDetail); + } + break; + } + indexVol++; + }); + return fieldArr; + } + + extractHlvFromHoldingList(nacsisHoldingsList: any[], tag: string) { + let fieldValue = ""; + nacsisHoldingsList.forEach(nacsisHolding => { + + switch (tag) { + case 'hlv': + fieldValue = this.illService.isEmpty(nacsisHolding.HLV) ? '' : nacsisHolding.HLV; + break; + case 'hlyr': + fieldValue = this.illService.isEmpty(nacsisHolding.HLYR) ? '' : nacsisHolding.HLYR; + break; + case 'cln': + fieldValue = this.illService.isEmpty(nacsisHolding.CLN) ? '' : nacsisHolding.CLN; + break; + case 'ldf': + fieldValue = this.illService.isEmpty(nacsisHolding.LDF) ? '' : nacsisHolding.LDF; + break; + } + }); + + return fieldValue; + } + + getCheckboxesData(row) { + if (row.checked === true) { + if (!this.maxReached()) { + this.isMaxRowSelected = false; + this.selecedData.push(row); + this.fillIndexIntoArray(this.selecedData); + } else { + + setTimeout(() => { + row.checked = false; + this.isMaxRowSelected = true; + }); + } + } else if (row.checked === false) { + this.isMaxRowSelected = false; + this.selecedData = this.selecedData.filter(el => { + return el.index !== row.index; + }); + this.fillIndexIntoArray(this.selecedData); + } + } + + fillIndexIntoArray(selecedData) { + this.selectedIndex = new Array(); + selecedData.forEach(element => { + this.selectedIndex.push(element.index); + }); + } + + filterSelectVol(rows) { + let newIndex: number = 1; + rows.forEach(row => { + let rowIndex = row.index; + let volIndexSelected = this.selectedVolMap.get(rowIndex); + if (!this.illService.isEmpty(volIndexSelected)) { + let vol = new Array(); + vol = row.vol; + row.vol = vol.filter(obj => { + return obj.index == volIndexSelected; + }) + } else { + row.vol = new Array(); + } + row.index = newIndex; + newIndex++; + }); + return rows; + } + + maxReached(): boolean { + return this.selecedData.length === 5; + } + + + private getActionMenu() { + return this.ACTIONS_MENU_LIST; + } + + onActionsClick(expandedElement, element, actionIndex) { + + switch (actionIndex) { + case 0: // view holding + this.isViewHolding = true; + return expandedElement === element ? null : element; + + case 1: // view member info + this.setMemberInfo(element.fano); + this.isViewHolding = false; + return expandedElement === element ? null : element; + } + } + + setMemberInfo(fano) { + + let obj = []; + this.setSearchResultsDisplay(obj); + let queryParams = ""; + queryParams = "ID=" + fano; + try { + this.loading = true; + this.nacsis.getMemberForILLFromNacsis(queryParams) + .subscribe({ + next: (header) => { + if (header.status === this.nacsis.OkStatus) { + obj = this.convertMemberInfo(header, obj); + } else { + this.loading = false; + //console.log('header' + header); + this.alert.error(header.errorMessage, { keepAfterRouteChange: true }); + } + }, + error: e => { + this.loading = false; + console.log(e.message); + this.alert.error(e.message, { keepAfterRouteChange: true }); + }, + complete: () => { + this.loading = false; + this.setSearchResultsDisplay(obj); + } + }); + } catch (e) { + this.loading = false; + this.alert.error(this.translate.instant('General.Errors.generalError'), { keepAfterRouteChange: true }); + } + } + + convertMemberInfo(header, obj) { + header.records.forEach(record => { + if(!this.illService.isEmpty(record.KENCODE)) + record.KENCODE = this.convertMapping(record.KENCODE, "KENCODE") + "(" + record.KENCODE + ")"; + if(!this.illService.isEmpty(record.SETCODE)) + record.SETCODE = this.convertMapping(record.SETCODE, "SETCODE") + "(" + record.SETCODE + ")"; + if(!this.illService.isEmpty(record.ORGCODE)) + record.ORGCODE = this.convertMapping(record.ORGCODE, "ORGCODE") + "(" + record.ORGCODE + ")"; + if(!this.illService.isEmpty(record.CATFLG)) + record.CATFLG = this.convertMapping(record.CATFLG, "CATFLG") + "(" + record.CATFLG + ")"; + if(!this.illService.isEmpty(record.ILLFLG)) + record.ILLFLG = this.convertMapping(record.ILLFLG, "CATFLG") + "(" + record.ILLFLG + ")"; + if(!this.illService.isEmpty(record.COPYS)) + record.COPYS = this.convertMapping(record.COPYS, "COPYS") + "(" + record.COPYS + ")"; + if(!this.illService.isEmpty(record.LOANS)) + record.LOANS = this.convertMapping(record.LOANS, "COPYS") + "(" + record.LOANS + ")"; + if(!this.illService.isEmpty(record.FAXS)) + record.FAXS = this.convertMapping(record.FAXS, "FAXS") + "(" + record.FAXS + ")"; + if(!this.illService.isEmpty(record.STAT)) + record.STAT = this.convertMapping(record.STAT, "FAXS") + "(" + record.STAT + ")"; + if(!this.illService.isEmpty(record.GRPCODE)) + record.GRPCODE = this.convertMapping(record.GRPCODE, "GRPCODE") + "(" + record.GRPCODE + ")"; + obj.push(record); + }); + return obj; + } + + onVolSelected(vol, element) { + let selectedVolIndex = vol.value; + let selectedEleIndex = element.index; + this.selectedVolMap.set(selectedEleIndex, selectedVolIndex); + } + + isShowVolValue(element) { + if (this.illService.isEmpty(element.vol)) { + return false; + } else { + if (element.vol.length > 0) { + return true; + } else { + return false; + } + } + } + + setVolValue(element) { + if (element != null && element != undefined && element.vol != null && element.vol != undefined) { + if (element.vol.length == 1) { + let selectedEleIndex = element.index; + this.selectedVolMap.set(selectedEleIndex, element.vol[0].index); + return element.vol[0].index; + } + } + } + + + onOwnerSelected() { + this.clearSelection(); + sessionStorage.setItem(this.nacsis.OwnerKey, this.selected); + + if (this.selected === '0') { + + this.noHoldingRecords = false; + if(!this.illService.isEmpty(sessionStorage.getItem(RESULT_RECORD_LIST_ILL))){ + this.holdings = JSON.parse(sessionStorage.getItem(RESULT_RECORD_LIST_ILL)); + }else{ + this.holdings = this.setDisplayDetails(this.nacsisHoldingsResultList); + } + + this.ngOnChanges(this.holdings); + } else if (this.selected === '1') { + + if(!this.illService.isEmpty(sessionStorage.getItem(RESULT_RECORD_LIST_ILL))){ + this.holdings = JSON.parse(sessionStorage.getItem(RESULT_RECORD_LIST_ILL)); + }else{ + this.holdings = this.setDisplayDetails(this.nacsisHoldingsResultList); + } + + let localnacsisHoldingsResultList = this.holdings.filter(e => e.fano === this.localLibraryID); + this.holdings = localnacsisHoldingsResultList; + if (localnacsisHoldingsResultList.length == 0) { + this.noHoldingRecords = true; + }else{ + this.ngOnChanges(localnacsisHoldingsResultList); + } + } + + } + + clearSelection() { + let myCheckboxes = this.myCheckboxes.toArray(); + myCheckboxes.forEach(myCheckbox => { + myCheckbox.checked = false; + }); + this.selection.clear(); + this.selecedData = new Array(); + this.fillIndexIntoArray(this.selecedData); + this.isMaxRowSelected = false; + this.selectedVolMap = new Map(); + } + + formatDate(dateTime: string) { + if (!this.illService.isEmpty(dateTime) && dateTime.length == 8) { + return dateTime.substring(0, 4) + "/" + dateTime.substring(4, 6) + "/" + dateTime.substring(6, 8); + } + return dateTime; + } + + private setSearchResultsDisplay(memberinfo) { + + this.catalogService.setSearchMemberDBResultsMap(this.currentSearchType, memberinfo); + + this.catalogResultsData = this.catalogService.getSearchResults(this.currentSearchType); + this.resultsSummaryDisplay = new Array(); + this.catalogResultsData.getResults()?.forEach(result => { + this.resultsSummaryDisplay.push(result.getSummaryDisplay()); + }); + + if (this.resultsSummaryDisplay.length > 0) { + let record = this.resultsSummaryDisplay[0]; + this.resultFullDisplay = record.getFullRecordData().getFullViewDisplay().initContentDisplay(); + } else { + this.resultFullDisplay = null; + } + } + + + isEvenRow(i: number) { + if (i % 2 != 0) { + return "expand-tr"; + } + } + + fillRowsTillFive(rows){ + if(rows.length == 5){ + return rows; + }else{ + console.log(rows); + let maxIndex = rows.length; + while(maxIndex < 5){ + let emptyRow = new DisplayHoldingResult(); + emptyRow.index = maxIndex+1; + rows.push(emptyRow); + maxIndex++; + } + console.log(rows); + return rows; + } + } + + + next() { + this.filterSelectVol(this.selecedData); + this.fillRowsTillFive(this.selecedData); + let object = JSON.stringify(this.selecedData); + sessionStorage.setItem(SELECTED_RECORD_LIST_ILL, object); + sessionStorage.setItem(ROUTING_STATE_KEY, AppRoutingState.HoldingSearchMainPage); + this.router.navigate(['requestForm', this.nacsisId, this.mmsTitle, this.routerSearchType]); + } + + backToSearchRecord() { + sessionStorage.setItem(ROUTING_STATE_KEY, AppRoutingState.ILLBorrowingMainPage); + this.router.navigate(['searchRecord', 'back']); + } + +} + + + +interface EstablisherType { + value: string; + viewValue: string; +} + +interface InstitutionType { + value: string; + viewValue: string; +} + + +interface ILLParticipationType { + value: string; + viewValue: string; +} + +interface ServiceStatus { + value: string; + viewValue: string; +} + +interface OffsetCharge { + value: string; + viewValue: string; +} + +interface CopyServiceType { + value: string; + viewValue: string; +} + +interface LendingServiceType { + value: string; + viewValue: string; +} + +interface FAXServiceType { + value: string; + viewValue: string; +} + +export enum QueryParams { + PageIndex = "pageIndex", + PageSize = "pageSize", + SearchType = "searchType", + Databases = "dataBase", + ID = "ID" +} + + diff --git a/cloudapp/src/app/ILL/main/main.component.html b/cloudapp/src/app/ILL/main/main.component.html new file mode 100644 index 0000000..b8fc01b --- /dev/null +++ b/cloudapp/src/app/ILL/main/main.component.html @@ -0,0 +1,39 @@ + + +
+ + + + +
+ +
+ +
+ + +
+

ILL.Main.Intro

+ + +
+ +
+ + +
+ + + +

ILL.Main.NoRecords

+
+ + diff --git a/cloudapp/src/app/ILL/main/main.component.scss b/cloudapp/src/app/ILL/main/main.component.scss new file mode 100644 index 0000000..2f90de1 --- /dev/null +++ b/cloudapp/src/app/ILL/main/main.component.scss @@ -0,0 +1,10 @@ +.align-space-between { + justify-content: space-between; + margin-bottom: 20px; +} + +::ng-deep .cdk-overlay-pane +{ + min-width: auto !important; + width: 12%; +} diff --git a/cloudapp/src/app/ILL/main/main.component.ts b/cloudapp/src/app/ILL/main/main.component.ts new file mode 100644 index 0000000..cfbdeb0 --- /dev/null +++ b/cloudapp/src/app/ILL/main/main.component.ts @@ -0,0 +1,183 @@ +import { Subscription, of, forkJoin} from 'rxjs'; +import { Component, OnInit, OnDestroy } from '@angular/core'; +import { CloudAppEventsService, Entity, EntityType, CloudAppRestService } from '@exlibris/exl-cloudapp-angular-lib'; +import { Router } from '@angular/router'; +import { IllService,AlmaRecordsResults, IDisplayLines,BaseRecordInfo,AlmaRecordInfo,AlmaRecord,AlmaRecordDisplay} from '../../service/ill.service'; +import { catchError, tap } from 'rxjs/operators'; +import { AlmaApiService, IntegrationProfile } from '../../service/alma.api.service'; +import { TranslateService } from '@ngx-translate/core'; +import { AppRoutingState, ROUTING_STATE_KEY,LIBRARY_ID_KEY ,LIBRARY_MEMBERINFO_KEY} from '../../service/base.service'; +import { AlertService } from '@exlibris/exl-cloudapp-angular-lib'; +import { HoldingsService} from '../../service/holdings.service'; + +@Component({ + selector: 'ILL-main', + templateUrl: './main.component.html', + styleUrls: ['./main.component.scss'] +}) + +export class ILLBorrowingMainComponent implements OnInit, OnDestroy { + + private pageLoad$: Subscription; + selected: AlmaRecordDisplay; + loading = false; + message: string; + isErrorMessageVisible: boolean = false; + processed = 0; + integrationProfile: IntegrationProfile; + recordInfoList: AlmaRecordInfo[] = new Array(); + recordsSummaryDisplay: Array; + almaResultsData: AlmaRecordsResults; + almaRecord: AlmaRecord = new AlmaRecord('',this.translate,this.illService); + baseRecordInfoList: Array = new Array(); + + singleRecordInfo: AlmaRecordInfo; + + + constructor( + private eventsService: CloudAppEventsService, + private translate: TranslateService, + private restService: CloudAppRestService, + private almaApiService: AlmaApiService, + private illService: IllService, + private alert: AlertService, + private router: Router, + private nacsis: HoldingsService, + ) { } + + ngOnInit() { + + sessionStorage.clear(); + this.pageLoad$ = this.eventsService.onPageLoad(pageInfo => { + this.loading = true; + try{ + this.almaApiService.getIntegrationProfile() + .subscribe( { + next : integrationProfile => { + this.integrationProfile = integrationProfile; + + sessionStorage.setItem(LIBRARY_ID_KEY,integrationProfile.libraryID); + let rawBibs = (pageInfo.entities || []).filter(e => e.type == EntityType.BIB_MMS || e.type == EntityType.BORROWING_REQUEST ); + let disCards: AlmaRecordInfo[] = new Array(rawBibs.length); + + forkJoin(rawBibs.map(entity => this.getRecord(entity))) + .subscribe({ + next: (records: any[]) => { + disCards = this.almaApiService.getAlmaRecodsInfo(records); + }, + error: e => { + this.loading = false; + console.log(e.message); + }, + complete: () => { + this.recordInfoList = disCards; + this.setSearchResultsDisplay(this.recordInfoList,"ill"); + this.setMemberInfo(this.integrationProfile.libraryID); + this.loading = false; + } + }); + }, + error: e => { + this.loading = false; + console.log(e.message); + this.alert.error(this.translate.instant('General.Errors.generalError'), {keepAfterRouteChange:true}); + } + }); + }catch(e) { + this.loading = false; + console.log(e); + this.alert.error(this.translate.instant('General.Errors.generalError'), {keepAfterRouteChange:true}); + } + + }); + } + + setMemberInfo(fano){ + let obj:[]; + let queryParams = ""; + queryParams = "ID=" + fano; + try { + this.loading = true; + this.nacsis.getMemberForILLFromNacsis(queryParams) + .subscribe({ + next: (header) => { + if (header.status === this.nacsis.OkStatus) { + obj = this.convertMemberInfo(header, obj); + } else { + this.loading = false; + //console.log('header' + header); + this.alert.error(header.errorMessage, { keepAfterRouteChange: true }); + } + }, + error: e => { + this.loading = false; + console.log(e.message); + this.alert.error(e.message, { keepAfterRouteChange: true }); + }, + complete: () => { + sessionStorage.setItem(LIBRARY_MEMBERINFO_KEY, JSON.stringify(obj)); + this.loading = false; + } + }); + } catch (e) { + this.loading = false; + this.alert.error(this.translate.instant('General.Errors.generalError'), { keepAfterRouteChange: true }); + } + } + + convertMemberInfo(header,obj){ + obj = new Array(); + header.records.forEach(record => { + obj.push(record); + }); + return obj; + } + + ngOnDestroy(): void { + this.pageLoad$.unsubscribe(); + } + + getRecord(entity: Entity) { + return this.restService.call(entity.link).pipe( + tap(()=>this.processed++), + catchError(e => of(e)), + ) + } + + getRecordByLink(link: string) { + return this.restService.call(link).pipe( + tap(()=>this.processed++), + catchError(e => of(e)), + ) + } + + + onCloseClick() { + this.isErrorMessageVisible = false; + } + + next(){ + sessionStorage.setItem(ROUTING_STATE_KEY, AppRoutingState.ILLBorrowingMainPage); + this.loading = true; + this.illService.setFormValue(this.selected); + this.router.navigate(['searchRecord',this.selected.record.nacsisId,this.selected.record.title, + this.selected.record.isbn,this.selected.record.issn]); + } + + newSearch(){ + sessionStorage.setItem(ROUTING_STATE_KEY, AppRoutingState.ILLBorrowingMainPage); + this.router.navigate(['searchRecord']); + } + + + + onRadioClick(item : AlmaRecordDisplay) { + this.selected = item; + } + + private setSearchResultsDisplay(recordInfoList: AlmaRecordInfo[], type: string){ + this.recordsSummaryDisplay = this.almaApiService.setRecordsSummaryDisplay(recordInfoList,type); + } + +} + diff --git a/cloudapp/src/app/ILL/requestForm/requestForm.component.html b/cloudapp/src/app/ILL/requestForm/requestForm.component.html new file mode 100644 index 0000000..18a3193 --- /dev/null +++ b/cloudapp/src/app/ILL/requestForm/requestForm.component.html @@ -0,0 +1,318 @@ +
+ + + +
+ +
+
+ +
+

{{mmsTitle}} ({{nacsisId}})

+
+ +
+ + +
+ + + + + {{ 'ILL.RequestForm.ResourceInformation' | translate }} + + + + +
+ + ILL.RequestForm.RequestType + + + {{requestType.viewValue | translate}} + + + + + + ILL.RequestForm.PayClass + + + {{payClass.viewValue | translate}} + + + + {{'ILL.Errors.warningSelectValue' | translate}} + + + + + ILL.RequestForm.CopyType + + + {{copyType.viewValue | translate}} + + + + {{'ILL.Errors.warningSelectValue' | translate}} + + + + + ILL.RequestForm.SendingMethod + + + {{sendingMethod.viewValue | translate}} + + + + + + ILL.RequestForm.ExternalRequestID + + + + + ILL.RequestForm.DefermentPermitNumber + + + + + ILL.RequestForm.NACSISBibliographicID + + + + + ILL.RequestForm.StandardNumber + + + + + + ILL.RequestForm.Volume + + + + + ILL.RequestForm.Page + + + + + ILL.RequestForm.Year + + + + + ILL.RequestForm.BibliographicMetadata + + + {{'ILL.Errors.warningInputValue' | translate}} + + + + + ILL.RequestForm.TreatiseRelatedMatters + + + +
+ +
+ + +
+
+ + + + {{ 'ILL.RequestForm.Rota' | translate }} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {{element.index}} + {{'ILL.HoldingSearchResult.Lender' | translate}}{{'ILL.HoldingSearchResult.Lender' | translate}} + #{{element.index}} + {{'ILL.RequestForm.FANO' | translate}} + + + {{'ILL.RequestForm.NAME' | translate}} + + + {{'ILL.HoldingSearchResult.LOC' | translate}} + + + {{'ILL.HoldingSearchResult.Volume' | translate}} + + + {{'ILL.HoldingSearchResult.CallNumber' | translate}} + + + {{'ILL.HoldingSearchResult.RegistrationNumber' | translate}} + + + {{'ILL.HoldingSearchResult.BID' | translate}} + +
+
+
+
+ + + + {{ 'ILL.RequestForm.RequesterInformation' | translate }} + + +
+
+ +
+ + ILL.RequestForm.BibliographicAuthority + + + + + ILL.RequestForm.CollectionAuthority + + + + + ILL.RequestForm.ApplicantName + + + + + ILL.RequestForm.ApplicantAffiliation + + + + + ILL.RequestForm.DateNeededBy + + + + + + + + + ILL.RequestForm.Comments + + + + + ILL.RequestForm.RequesterStaff + + + {{'ILL.Errors.warningInputValue' | translate}} + + + + + ILL.RequestForm.RequesterAddress + + + {{'ILL.Errors.warningInputValue' | translate}} + + + + + ILL.RequestForm.LocalData + + + + + ILL.RequestForm.LocalAccountingData + + + + + ILL.RequestForm.ElectronicShippingAddress + + + +
+
+
+
+
+ +
+ +

\ No newline at end of file diff --git a/cloudapp/src/app/ILL/requestForm/requestForm.component.scss b/cloudapp/src/app/ILL/requestForm/requestForm.component.scss new file mode 100644 index 0000000..fb5b700 --- /dev/null +++ b/cloudapp/src/app/ILL/requestForm/requestForm.component.scss @@ -0,0 +1,154 @@ +.align-space-between { + justify-content: space-between; + margin-bottom: 20px; + } + + .align-space-between-no-bottom { + justify-content: space-between; + } + + .align-to-left { + justify-content: flex-start; + margin-bottom: 15px; + } + + .align-to-right { + justify-content: flex-end; + margin-bottom: 15px; + } + + .align-to-right-no-bottom { + justify-content: flex-end; + } + + .top-title{ + width: 100%; + background: rgb(240, 240, 240); + } + + mat-form-field { + margin-top: 0px; + margin-bottom: 0px; + margin-right: 5px; + margin-left: 5px; + } + + mat-card { + margin-top: 10px; + margin-bottom: 10px; + margin-right: 5px; + margin-left: 0; + padding: 0px; + background: whitesmoke !important; + } + + + + .form-card-parent { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + column-gap: 2%; + background-color: whitesmoke !important; + ::ng-deep .mat-form-field-wrapper { + padding-bottom: 5px !important; + } + // ::ng-deep .mat-form-field-flex { + // height: 45px; + // } + } + .form-card-input-full-width { + padding-top: 10px; + width: 98.4%; + min-width: 285px; + } + .form-card-inputs-large { + padding-top: 10px; + width: 48.8%; + min-width: 285px; + flex-grow: 1; + } + .form-card-inputs-medium { + padding-top: 10px; + width: 32.3%; + min-width: 285px; + flex-grow: 1; + } + + + + .align-to-right { + justify-content: flex-end; + margin-bottom: 20px; + } + + + div.form { + column-gap: 2%; + } + + mat-list-item { + i.eca-button, + i.cloudapp-button { + visibility: visible !important; + } + &:hover i.eca-button, + &:hover i.cloudapp-button { + visibility: visible; + } + } + + + table { + width: 100%; + } + + :host ::ng-deep .mat-sort-header-container { + display: flex; + justify-content: center; + } + + th.mat-header-cell { + background-color: rgb(78, 78, 78); + color: white; + text-align: center; + } + + .mat-column-select { + overflow: initial; + } + + td.mat-cell { + text-align: center; + border-left: 1px solid lightgray; + border-right: 1px solid lightgray; + border-bottom: 1px solid lightgray; + } + + td.mat-cell:first-child { + width: 3%; + padding-left: 0px; + border-left: 1px solid lightgray; + } + + td.mat-cell:last-child { + padding-right: 0px; + } + + + th.mat-header-cell:first-child { + padding-left: 5px; + border-left: 1px solid lightgray; + } + + th.mat-header-cell:last-child { + padding-right: 0px; + } + + .mat-column-id{ + background-color: rgb(236, 236, 236); + } + .mat-column-index{ + width: 7%; + background-color: rgb(236, 236, 236); + } \ No newline at end of file diff --git a/cloudapp/src/app/ILL/requestForm/requestForm.component.ts b/cloudapp/src/app/ILL/requestForm/requestForm.component.ts new file mode 100644 index 0000000..3a392c0 --- /dev/null +++ b/cloudapp/src/app/ILL/requestForm/requestForm.component.ts @@ -0,0 +1,509 @@ +import { Component, OnInit, OnChanges} from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { TranslateService } from '@ngx-translate/core'; +import { HoldingsService, DisplayHoldingResult} from '../../service/holdings.service'; +import { MatDialog } from '@angular/material/dialog'; +import { AlertService } from '@exlibris/exl-cloudapp-angular-lib'; +import { AppRoutingState, ROUTING_STATE_KEY,LIBRARY_MEMBERINFO_KEY,SELECTED_RECORD_LIST_ILL,SELECTED_RECORD_ILL } from '../../service/base.service'; +import { MatTableDataSource } from '@angular/material/table'; +import { FormGroup, FormControl, Validators, FormGroupDirective, NgForm } from '@angular/forms'; +import { IllService, RequestFields, Bibg, HMLG } from '../../service/ill.service'; +import { LiveAnnouncer } from '@angular/cdk/a11y'; +import { CatalogService } from '../../service/catalog.service'; +import { SearchType } from '../../user-controls/search-form/search-form-utils'; +import { initResourceInformationFormGroup, initRequesterInformationFormGroup, initRotaFormGroup, FieldName } from '../holdingSearch/holdingSearch-utils'; +import { ErrorStateMatcher } from '@angular/material/core'; +import { DatePipe } from '@angular/common'; + +@Component({ + selector: 'ILL-requestForm', + templateUrl: './requestForm.component.html', + styleUrls: ['./requestForm.component.scss'], + +}) + +export class RequestFormComponent implements OnInit, OnChanges { + //basic variable + nacsisId: string; + mmsTitle: string; + owners: any[]; + loading = false; + selected: string; + backSession; + currentSearchType: SearchType = SearchType.Monographs; + panelStateResourceInformation: boolean = true; + panelStateRota: boolean = true; + panelStateRequestInformation: boolean = true; + formResourceInformation: FormGroup; + formRequesterInformation: FormGroup; + formRotamation: FormGroup; + selecedData: any = []; + fullRecordData: any = []; + localMemberInfo: any = []; + + //autofill fields + titleAuto: string; + publicationAuto: string; + pub_yearAuto: string; + quantityAuto: string; + sizeAuto: string; + volFirstAuto: string; + volLastAuto: string; + vlyrAuto:string; + lccnAuto: string; + dataPubArrayAuto: any[]; + dataVolArrayAuto: any[]; + bibIDAuto: string; + + illStaffAuto:string; + illTelAuto:string; + illFaxAuto:string; + illZipAuto:string; + illNameAuto:string; + illDeptAuto:string; + illAddrAuto:string; + + requestType = new FormControl(); + requestTypeList: RequestType[] = [ + { value: 'COPYO', viewValue: 'ILL.OptionViewValue.requestTypeList.Copy' }, + { value: 'LOANO', viewValue: 'ILL.OptionViewValue.requestTypeList.Loan' } + ]; + + commentsType = new FormControl(); + commentsTypeList: CommentsType[] = [ + { value: 'Comment1', viewValue: 'Comment1' }, + { value: 'Comment2', viewValue: 'Comment2' } + ]; + + payClass = new FormControl('', Validators.required); + payClassList: PayClass[] = [ + { value: 'co', viewValue: 'ILL.OptionViewValue.payClassList.ResearchExpenses' }, + { value: 'ho', viewValue: 'ILL.OptionViewValue.payClassList.UniversityHospital' }, + { value: 'pb', viewValue: 'ILL.OptionViewValue.payClassList.NationalSchool' }, + { value: 'pr', viewValue: 'ILL.OptionViewValue.payClassList.PrivateExpense' }, + { value: 're', viewValue: 'ILL.OptionViewValue.payClassList.Laboratory' } + ]; + + copyType = new FormControl(); + copyTypeList: CopyType[] = [ + { value: 'Electronic copy', viewValue: 'ILL.OptionViewValue.copyTypeList.ElectronicCopy' }, + { value: 'FAX', viewValue: 'ILL.OptionViewValue.copyTypeList.FAX' }, + { value: 'eDDS', viewValue: 'ILL.OptionViewValue.copyTypeList.eDDS' }, + { value: 'Stretch', viewValue: 'ILL.OptionViewValue.copyTypeList.Stretch' }, + { value: 'Microfitsyu', viewValue: 'ILL.OptionViewValue.copyTypeList.Microfitsyu' }, + { value: 'Microfilm', viewValue: 'ILL.OptionViewValue.copyTypeList.Microfilm' }, + { value: 'Reader printer ', viewValue: 'ILL.OptionViewValue.copyTypeList.ReaderPrinter' }, + { value: 'Slide', viewValue: 'ILL.OptionViewValue.copyTypeList.Slide' }, + { value: 'Copy order', viewValue: 'ILL.OptionViewValue.copyTypeList.CopyOrder' } + ]; + + sendingMethod = new FormControl(); + sendingMethodList: SendingMethod[] = [ + { value: 'Regular', viewValue: 'ILL.OptionViewValue.sendingMethodList.Regular' }, + { value: 'Express', viewValue: 'ILL.OptionViewValue.sendingMethodList.Express' }, + { value: 'DDS', viewValue: 'ILL.OptionViewValue.sendingMethodList.DDS' }, + { value: 'FAX', viewValue: 'ILL.OptionViewValue.sendingMethodList.FAX' }, + { value: 'Registered_mail', viewValue: 'ILL.OptionViewValue.sendingMethodList.RegisteredMail' }, + { value: 'Regular_mail', viewValue: 'ILL.OptionViewValue.sendingMethodList.RegularMail' }, + { value: 'Mail ', viewValue: 'ILL.OptionViewValue.sendingMethodList.Mail' }, + { value: 'eDDS', viewValue: 'ILL.OptionViewValue.sendingMethodList.eDDS' } + ]; + + dataSourceRota = new MatTableDataSource(); + matcher = new MyErrorStateMatcher(); + OADRS = new FormControl('', [Validators.required]); + OSTAF = new FormControl('', [Validators.required]); + BIBNT = new FormControl('', [Validators.required]); + ODATE = new FormControl(new Date().toISOString()); + + requestBody = new Array(); + rotaFormControlName = ['HMLID', 'HMLNM', 'LOC', 'VOL', 'CLN', 'RGTN']; + isAllFieldsFilled: boolean = true; + + constructor( + private route: ActivatedRoute, + private router: Router, + private illService: IllService, + private catalogService: CatalogService, + //private http: HttpClient, + private translate: TranslateService, + private nacsis: HoldingsService, + private dialog: MatDialog, + private alert: AlertService, + private _liveAnnouncer: LiveAnnouncer, + private routeInfo: ActivatedRoute + ) { + this.owners = [ + { id: "0", name: this.translate.instant('Holdings.ViewHoldings.All') }, + { id: "1", name: this.translate.instant('Holdings.ViewHoldings.Mine') } + ]; + } + + ngOnInit() { + + this.nacsisId = this.route.snapshot.params['nacsisId']; + this.mmsTitle = this.route.snapshot.params['mmsTitle']; + this.currentSearchType = this.route.snapshot.params['searchType']; + this.fullRecordData = JSON.parse(sessionStorage.getItem(SELECTED_RECORD_ILL)); + this.selecedData = JSON.parse(sessionStorage.getItem(SELECTED_RECORD_LIST_ILL)); + this.localMemberInfo = JSON.parse(sessionStorage.getItem(LIBRARY_MEMBERINFO_KEY)); + this.ngOnChanges(this.selecedData); + this.formResourceInformation = initResourceInformationFormGroup(); + this.formRequesterInformation = initRequesterInformationFormGroup(); + this.formRotamation = initRotaFormGroup(); + this.panelStateResourceInformation = false; + this.panelStateRota = true; + this.panelStateRequestInformation = false; + this.extractFullData(this.fullRecordData); + this.extractSelectedData(); + this.extractLocalMemberInfo(this.localMemberInfo); + + } + + extractFullData(fullRecordData) { + + this.titleAuto = fullRecordData.TRD; + this.dataPubArrayAuto = fullRecordData.PUB; + if (this.dataPubArrayAuto.length > 0) { + this.publicationAuto = this.dataPubArrayAuto[0].PUBL; + } + this.pub_yearAuto = fullRecordData.PUBDT; + this.quantityAuto = fullRecordData.PHYSP; + this.sizeAuto = fullRecordData.PHYSS; + this.lccnAuto = fullRecordData.LCCN; + this.dataVolArrayAuto = fullRecordData.VOLG; + if (this.dataVolArrayAuto != null && this.dataVolArrayAuto.length > 0) { + this.volFirstAuto = this.dataVolArrayAuto[0].VOL; + if (this.dataVolArrayAuto.length > 1) { + this.volLastAuto = this.dataVolArrayAuto[this.dataVolArrayAuto.length - 1].VOL; + } + } + this.vlyrAuto = fullRecordData.VLYR; + this.bibIDAuto = this.nacsisId; + + this.formResourceInformation.controls.BIBID.setValue(this.bibIDAuto); + this.formResourceInformation.controls.BIBNT.setValue(this.buildBibMetadata()); + if(!this.illService.isEmpty(this.lccnAuto)) + this.formResourceInformation.controls.STDNO.setValue('LCCN=' + this.lccnAuto); + } + + extractSelectedData() { + this.rotaFormControlName.forEach(conrtolName => { + for (let i = 1; i <= this.selecedData.length; i++) { + let tag = conrtolName + i; + this.setValueForFormRota(tag); + } + }) + } + + extractLocalMemberInfo(localMemberInfo){ + if(localMemberInfo.length > 0 ){ + this.illStaffAuto = localMemberInfo[0].ILLSTAFF; + this.illDeptAuto = localMemberInfo[0].ILLDEPT; + this.illFaxAuto = localMemberInfo[0].FAX; + this.illZipAuto = localMemberInfo[0].ZIP; + this.illAddrAuto = localMemberInfo[0].ADDRESS; + this.illNameAuto = localMemberInfo[0].NAME; + this.illTelAuto = localMemberInfo[0].TEL; + + this.formRequesterInformation.controls.OSTAF.setValue(this.buildRequesterStaff()); + this.formRequesterInformation.controls.OADRS.setValue(this.buildRequesterAddress()); + } + } + + + setValueForFormRota(tag) { + let tagName = tag.substr(0, tag.length - 1); + let tagSequence = tag.substr(tag.length - 1, tag.length); + + switch (tagName) { + case 'HMLID': + this.formRotamation.get(tag).setValue(this.selecedData[tagSequence - 1].fano); + break; + case 'HMLNM': + this.formRotamation.get(tag).setValue(this.selecedData[tagSequence - 1].name); + break; + case 'LOC': + this.formRotamation.get(tag).setValue(this.selecedData[tagSequence - 1].location); + break; + case 'VOL': + if (!this.illService.isEmpty(this.selecedData[tagSequence - 1].vol)) + this.formRotamation.get(tag).setValue(this.selecedData[tagSequence - 1].vol[0].VOL); + break; + case 'CLN': + if (!this.illService.isEmpty(this.selecedData[tagSequence - 1].vol)) + this.formRotamation.get(tag).setValue(this.selecedData[tagSequence - 1].vol[0].CLN); + break; + case 'RGTN': + if (!this.illService.isEmpty(this.selecedData[tagSequence - 1].vol)) + this.formRotamation.get(tag).setValue(this.selecedData[tagSequence - 1].vol[0].RGTN); + break; + } + } + + + buildBibMetadata() { + let bibMetadata = ""; + bibMetadata = bibMetadata + (this.illService.isEmpty(this.titleAuto) ? "" : this.titleAuto + ";"); + bibMetadata = bibMetadata + (this.illService.isEmpty(this.volFirstAuto) ? "" : this.volFirstAuto); + bibMetadata = bibMetadata + (this.illService.isEmpty(this.volLastAuto) ? "" : " - " + this.volLastAuto + "."); + bibMetadata = bibMetadata + ((this.illService.isEmpty(this.volFirstAuto) && this.illService.isEmpty(this.volLastAuto)) ? "" : " -- "); + + bibMetadata = bibMetadata + (this.illService.isEmpty(this.vlyrAuto) ? "" : this.vlyrAuto + " .-- "); + bibMetadata = bibMetadata + (this.illService.isEmpty(this.publicationAuto) ? "" : this.publicationAuto + ", "); + bibMetadata = bibMetadata + (this.illService.isEmpty(this.pub_yearAuto) ? "" : this.pub_yearAuto + ". "); + bibMetadata = bibMetadata + ((this.illService.isEmpty(this.quantityAuto) && this.illService.isEmpty(this.sizeAuto)) ? "" : " -- "); + bibMetadata = bibMetadata + (this.illService.isEmpty(this.quantityAuto) ? "" : this.quantityAuto + "; "); + bibMetadata = bibMetadata + (this.illService.isEmpty(this.sizeAuto) ? "" : this.sizeAuto + ". "); + return bibMetadata; + } + + buildRequesterStaff(){ + let requesterStaff = ""; + requesterStaff = requesterStaff + (this.illService.isEmpty(this.illStaffAuto) ? "" : this.illStaffAuto + " "); + requesterStaff = requesterStaff + (this.illService.isEmpty(this.illDeptAuto) ? "" : this.illDeptAuto + " "); + requesterStaff = requesterStaff + (this.illService.isEmpty(this.illTelAuto) ? "" : "TEL=" + this.illTelAuto + " "); + requesterStaff = requesterStaff + (this.illService.isEmpty(this.illFaxAuto) ? "" : "FAX=" + this.illFaxAuto); + return requesterStaff; + } + + buildRequesterAddress(){ + let requesterAddress = ""; + requesterAddress = requesterAddress + (this.illService.isEmpty(this.illZipAuto) ? "" : "〒" + this.illZipAuto + " "); + requesterAddress = requesterAddress + (this.illService.isEmpty(this.illAddrAuto) ? "" : this.illAddrAuto + " "); + requesterAddress = requesterAddress + (this.illService.isEmpty(this.illNameAuto) ? "" : this.illNameAuto + " "); + requesterAddress = requesterAddress + (this.illService.isEmpty(this.illDeptAuto) ? "" : this.illDeptAuto); + return requesterAddress; + } + + + ngOnChanges(holdings) { + this.dataSourceRota = new MatTableDataSource(holdings); + } + + backToHoldingSearch() { + sessionStorage.setItem(ROUTING_STATE_KEY, AppRoutingState.SearchRecordMainPage); + this.router.navigate(['holdingSearch', this.nacsisId, this.mmsTitle, this.currentSearchType]); + } + + + getDisplayedColumns(): string[] { + return ['id', 'index', 'fano', 'name', 'location', 'vol', 'callNumber', + 'registrationNumber', 'bid']; + } + + + panelOpenStateResourceInformation() { + this.panelStateResourceInformation = true; + } + + panelCloseStateResourceInformation() { + this.panelStateResourceInformation = false; + } + + + panelOpenStateRota() { + this.panelStateRota = true; + } + + panelCloseStateRota() { + this.panelStateRota = false; + } + + panelOpenStateRequestInformation() { + this.panelStateRequestInformation = true; + } + + panelCloseStateRequestInformation() { + this.panelStateRequestInformation = false; + } + + + showVolDetal(element, tag) { + let str = ""; + let volumeArr = element.vol; + if (!this.illService.isEmpty(volumeArr)) { + switch (tag) { + case 'VOL': + str = volumeArr[0].VOL; + break; + case 'CLN': + str = volumeArr[0].CLN; + break; + case 'RGTN': + str = volumeArr[0].RGTN; + break; + } + } + return str; + } + + order() { + //check required fields + this.setFormGroupTouched(this.formResourceInformation); + this.setFormGroupTouched(this.formRequesterInformation); + this.requestType.markAsTouched({ onlySelf: true }); + this.payClass.markAsTouched({ onlySelf: true }); + this.copyType.markAsTouched({ onlySelf: true }); + this.checkFieldRequired(); + + if (this.isAllFieldsFilled) { + this.buildRequestBody(); + this.sendToIllCreateRequest(this.requestBody); + } else { + this.panelStateRequestInformation = true; + this.panelStateResourceInformation = true; + } + } + + + setFormGroupTouched(formGroup: FormGroup) { + Object.keys(formGroup.controls).forEach(field => { + const control = formGroup.get(field); + control.markAsTouched({ onlySelf: true }); + }); + } + + buildRequestBody() { + + this.requestBody = new Array(); + let item = new RequestFields; + // formResourceInformation + item.database = this.requestType.value; + item.ACCT = this.payClass.value; + item.TYPE = this.copyType.value; + item.SPVIA = this.illService.isEmpty(this.sendingMethod.value) ? "" : this.sendingMethod.value; + item.ONO = this.illService.isEmpty(this.formResourceInformation.value.ONO) ? "" : this.formResourceInformation.value.ONO; + item.PRMT = this.illService.isEmpty(this.formResourceInformation.value.PRMT) ? "" : this.formResourceInformation.value.PRMT; + + let bibg = new Bibg(); + + bibg.BIBID = this.illService.isEmpty(this.formResourceInformation.value.BIBID)? this.nacsisId: this.formResourceInformation.value.BIBID; + bibg.BIBNT = this.formResourceInformation.value.BIBNT; + bibg.STDNO = this.formResourceInformation.value.STDNO; + item.BIBG = bibg; + + item.VOL = this.illService.isEmpty(this.formResourceInformation.value.VOL) ? "" : this.formResourceInformation.value.VOL; + item.PAGE = this.illService.isEmpty(this.formResourceInformation.value.PAGE) ? "" : this.formResourceInformation.value.PAGE; + item.YEAR = this.illService.isEmpty(this.formResourceInformation.value.YEAR) ? "" : this.formResourceInformation.value.YEAR; + item.ARTCL = this.illService.isEmpty(this.formResourceInformation.value.ARTCL) ? "" : this.formResourceInformation.value.ARTCL; + + //formRotamation + item.HMLG = new Array(); + + for (let i = 1; i <= this.selecedData.length; i++) { + let hmlgs = new HMLG(); + this.rotaFormControlName.forEach(controlName => { + hmlgs[controlName] = this.illService.isEmpty(this.formRotamation.get(controlName + i).value) ? "" : this.formRotamation.get(controlName + i).value; + }) + item.HMLG.push(hmlgs); + } + + item.HMLG = item.HMLG.filter(hmlg=>{ + return !this.illService.isEmpty(hmlg.HMLID + hmlg.HMLNM + hmlg.LOC + hmlg.VOL + hmlg.CLN + hmlg.RGTN); + }) + + //formRequesterInformation + item.BVRFY = this.illService.isEmpty(this.formRequesterInformation.value.BVRFY) ? "" : this.formRequesterInformation.value.BVRFY; + item.HVRFY = this.illService.isEmpty(this.formRequesterInformation.value.HVRFY) ? "" : this.formRequesterInformation.value.HVRFY; + item.CLNT = this.illService.isEmpty(this.formRequesterInformation.value.CLNT) ? "" : this.formRequesterInformation.value.CLNT; + item.CLNTP = this.illService.isEmpty(this.formRequesterInformation.value.CLNTP) ? "" : this.formRequesterInformation.value.CLNTP; + item.ODATE = new DatePipe('en').transform(this.ODATE.value, 'yyyyMMdd'); + item.SENDCMNT = this.illService.isEmpty(this.formRequesterInformation.value.SENDCMNT) ? "" : this.formRequesterInformation.value.SENDCMNT; + item.OSTAF = this.formRequesterInformation.value.OSTAF; + item.OADRS = this.formRequesterInformation.value.OADRS; + item.OLDF = this.illService.isEmpty(this.formRequesterInformation.value.OLDF) ? "" : this.formRequesterInformation.value.OLDF; + item.OLDAF = this.illService.isEmpty(this.formRequesterInformation.value.OLDAF) ? "" : this.formRequesterInformation.value.OLDAF; + item.OEDA = this.illService.isEmpty(this.formRequesterInformation.value.OEDA) ? "" : this.formRequesterInformation.value.OEDA; + + this.requestBody.push(item); + } + + checkFieldRequired() { + let needToCheckFields = [this.requestType.value, this.payClass.value, + this.formResourceInformation.value.BIBNT, this.formRequesterInformation.value.OSTAF, + this.formRequesterInformation.value.OADRS]; + this.isAllFieldsFilled = true; + needToCheckFields.forEach(fieldValue => { + if (this.isAllFieldsFilled) { + if (this.illService.isEmpty(fieldValue)) { + this.isAllFieldsFilled = false; + } + } + }) + return this.isAllFieldsFilled; + } + + sendToIllCreateRequest(requestBody) { + this.loading = true; + + try { + + this.illService.createILLrequest(requestBody) + .subscribe({ + next: (header) => { + console.log(header); + if (header.status === this.nacsis.OkStatus) { + let requestID = header.requestId; + console.log(requestID); + this.alert.success(this.translate.instant('ILL.Main.CreateILLSuccess') + requestID, {autoClose:false,keepAfterRouteChange:true,delay:10000}); + this.router.navigate(['/ILL']); + } else { + this.alert.error(header.errorMessage, {keepAfterRouteChange:true}); + } + }, + error: e => { + this.loading = false; + console.log(e.message); + this.alert.error(e.message, {keepAfterRouteChange:true}); + }, + complete: () => this.loading = false + }); + + } catch (e) { + this.loading = false; + console.log(e); + this.alert.error(this.translate.instant('General.Errors.generalError'), { keepAfterRouteChange: true }); + } + } + + onRequestTypeSelected(){ + if(this.requestType.value === 'COPYO'){ + this.copyType.setValue('Electronic copy'); + } + } + +} + + +interface RequestType { + value: string; + viewValue: string; +} + +interface PayClass { + value: string; + viewValue: string; +} + +interface CopyType { + value: string; + viewValue: string; +} + +interface SendingMethod { + value: string; + viewValue: string; +} + +interface CommentsType { + value: string; + viewValue: string; +} + +export class MyErrorStateMatcher implements ErrorStateMatcher { + isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean { + const isSubmitted = form && form.submitted; + return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted)); + } +} diff --git a/cloudapp/src/app/ILL/searchRecord/searchRecord.component.html b/cloudapp/src/app/ILL/searchRecord/searchRecord.component.html new file mode 100644 index 0000000..7c3a358 --- /dev/null +++ b/cloudapp/src/app/ILL/searchRecord/searchRecord.component.html @@ -0,0 +1,94 @@ +
+ + + + +
+ + + +
+
+
+ +

{{'Catalog.Form.MainTitle' | translate}}

+ + + + + + {{ 'Catalog.Form.RefineSearch' | translate }} + + + +
+
+
+
+
+

+ + + +
+ + +
+ +


+ + + + + + + + +
+ +

{{'Catalog.Results.NoRecordsExist' | translate}}

+
+


+
+ + + +
+
+ + + +


+
+
+ + +
+
+ +
+ + +
+
+
+ +
\ No newline at end of file diff --git a/cloudapp/src/app/ILL/searchRecord/searchRecord.component.scss b/cloudapp/src/app/ILL/searchRecord/searchRecord.component.scss new file mode 100644 index 0000000..f1ca4a7 --- /dev/null +++ b/cloudapp/src/app/ILL/searchRecord/searchRecord.component.scss @@ -0,0 +1,55 @@ +p { + margin-bottom: 15px; + } + +.align-to-left { + justify-content: flex-start; + margin-bottom: 15px; +} + +.align-to-right { + justify-content: flex-end; +} + +.align-space-between { + justify-content: space-between; + margin-bottom: 20px; +} + +.noResults{ + text-align: center; + height: fit-content; + margin-top: 40px; +} + +.full-view { + display: flex; + flex-direction: row; + +} + +.full-view-left-table { + flex: 1; + margin-right: 8px; +} + +.full-view-right-table { + position: relative; + flex: 1; +} + +a, +a label { + cursor: pointer; +} + +.close-button { + background: transparent; + border: none; + position: absolute; + right: 2px; + top: 2px; + i { + font-size: 12px; + } +} \ No newline at end of file diff --git a/cloudapp/src/app/ILL/searchRecord/searchRecord.component.ts b/cloudapp/src/app/ILL/searchRecord/searchRecord.component.ts new file mode 100644 index 0000000..000906b --- /dev/null +++ b/cloudapp/src/app/ILL/searchRecord/searchRecord.component.ts @@ -0,0 +1,458 @@ +import { AppRoutingState, ROUTING_STATE_KEY, RESULT_RECORD_LIST_ILL, SELECTED_RECORD_ILL } from '../../service/base.service'; +import { Component, OnInit, AfterViewInit, ViewChild, TemplateRef } from '@angular/core'; +import { SearchType, SearchField, FieldSize, FieldName } from '../../user-controls/search-form/search-form-utils'; +import { MatTabChangeEvent } from '@angular/material/tabs'; +import { CatalogService } from '../../service/catalog.service'; +import { AlertService, Entity, CloudAppRestService } from '@exlibris/exl-cloudapp-angular-lib'; +import { TranslateService } from '@ngx-translate/core'; +import { Router, ActivatedRoute } from '@angular/router'; +import { PageEvent } from '@angular/material/paginator'; +import { NacsisCatalogResults, IDisplayLines } from '../../catalog/results-types/results-common'; +import { IllService, AlmaRecord, AlmaRecordDisplay } from '../../service/ill.service'; +import { FullViewLink } from '../../catalog/full-view-display/full-view-display.component'; +import { RecordSelection } from '../../user-controls/selectable-result-card/selectable-result-card.component'; +import { HoldingsService } from '../../service/holdings.service'; + + +@Component({ + selector: 'ILL-searchRecord', + templateUrl: './searchRecord.component.html', + styleUrls: ['./searchRecord.component.scss'] +}) + +export class searchRecordComponent implements AfterViewInit { + + public SEARCH_TYPE_ARRAY = new Array(SearchType.Monographs, SearchType.Serials); + public ALL_SEARCH_FIELDS_MAP = new Map([ + [SearchType.Monographs, this.initMonographsSearchFields()], + [SearchType.Serials, this.initSerialsSearchFields()] + ]); + + public ALL_DATABASES_MAP = new Map([ + [SearchType.Monographs, ['BOOK', 'PREBOOK', 'JPMARC', 'TRCMARC', 'USMARC', 'USMARCX', 'GPOMARC', 'UKMARC', 'REMARC', 'DNMARC', 'CHMARC', 'KORMARC', 'RECON', 'HBZBKS', 'SPABKS', 'ITABKS', 'KERISB', 'KERISX', 'BNFBKS']], + [SearchType.Serials, ['SERIAL', 'JPMARCS', 'USMARCS', 'SPASER', 'ITASER', 'KERISS', 'BNFSER']], + ]); + + public ALL_DATABASES_MAP_SEARCH = new Map([ + [SearchType.Monographs, ['BOOK', 'PREBOOK', 'JPMARC', 'TRCMARC', 'USMARC', 'USMARCX', 'GPOMARC', 'UKMARC', 'REMARC', 'DNMARC', 'CHMARC', 'KORMARC', 'RECON', 'HBZBKS', 'SPABKS', 'ITABKS', 'KERISB', 'KERISX', 'BNFBKS']], + [SearchType.Serials, ['SERIAL', 'JPMARCS', 'USMARCS', 'SPASER', 'ITASER', 'KERISS', 'BNFSER']], + [SearchType.Names, ['NAME', 'JPMARCA', 'USMARCA']], + [SearchType.UniformTitles, ['TITLE', 'USMARCT']] + ]); + + public ACTIONS_MENU_LIST = new Map([ + [SearchType.Monographs, ['Catalog.Results.Actions.View']], + [SearchType.Serials, ['Catalog.Results.Actions.View']], + ]); + + backSession;//: AppRoutingState; + + // Selection variables + public currentSearchType: SearchType = SearchType.Monographs; + private currentDatabase: string;// = ''; // first default selection (since opened with Monographs) + selected: IDisplayLines; + + // UI variables + private panelState: boolean = true; + private loading: boolean = false; + private isRightTableOpen: boolean = false; + private isColapsedMode: boolean = true; + private isFirstIndex: number; + + // Search variables + private catalogResultsData: NacsisCatalogResults; + private numOfResults: number; + private pageIndex: number = 0; + private pageSize: number = 20; + + // Display variables + private resultsSummaryDisplay: Array; + private resultFullDisplay; + private resultFullLinkDisplay; + public selectedIndexBinding = 0; + private recordIndexSelected: number; + + private nacsisID: string; + private title: string; + private isbn: string; + private issn: string; + private itemRecord: AlmaRecord = new AlmaRecord('', this.translate, this.illService); + private itemRecordDisplay: AlmaRecordDisplay = new AlmaRecordDisplay(this.translate, this.itemRecord, this.illService, 'holding'); + private isBackFromHoldingSearch: string; + + ArrayEntity: Array = new Array(); + processed = 0; + + // Templates + @ViewChild('notSearched') notSearchedTmpl: TemplateRef; + @ViewChild('searchResults') searchResultsTmpl: TemplateRef; + @ViewChild('noResults') noResultsTmpl: TemplateRef; + @ViewChild('fullRecord') fullRecordTmpl: TemplateRef; + private currentResulsTmpl: TemplateRef; + + constructor( + private route: ActivatedRoute, + private catalogService: CatalogService, + private holdingsService: HoldingsService, + private router: Router, + private alert: AlertService, + private translate: TranslateService, + private illService: IllService, + private restService: CloudAppRestService, + ) { } + + ngAfterViewInit() { + if (!this.illService.isEmpty(this.isBackFromHoldingSearch)) { + if (this.catalogService.getSearchResults(this.currentSearchType).getResults() != null) { + this.setSearchResultsDisplay(); + } else { + this.currentResulsTmpl = this.notSearchedTmpl; + this.panelState = true; + } + } + } + + onBackFromViewHolding() { + this.searchFormRefill(); + } + + /*** Search Form Section ***/ + + fillInItemRecord() { + this.nacsisID = this.route.snapshot.params['nacsisId']; + this.title = this.route.snapshot.params['title']; + this.isbn = this.route.snapshot.params['isbn']; + this.issn = this.route.snapshot.params['issn']; + + this.itemRecord.nacsisId = this.illService.isEmpty(this.nacsisID) ? '' : this.nacsisID; + this.itemRecord.title = this.illService.isEmpty(this.title) ? '' : this.title; + this.itemRecord.isbn = this.illService.isEmpty(this.isbn) ? '' : this.isbn; + this.itemRecord.issn = this.illService.isEmpty(this.issn) ? '' : this.issn; + + this.itemRecordDisplay.record = this.itemRecord; + } + + + searchFormRefill() { + let paramsMap = new Map(); + this.illService.setFormValue(this.itemRecordDisplay).split("&").forEach(param => { + let paramAsKeyValue = param.split("="); + paramsMap.set(paramAsKeyValue[0], paramAsKeyValue[1]); + }); + + this.pageIndex = paramsMap.get(QueryParams.PageIndex); + this.pageSize = paramsMap.get(QueryParams.PageSize); + this.currentSearchType = SearchType[paramsMap.get(QueryParams.SearchType)]; + if (this.currentSearchType == SearchType.Serials) { + this.selectedIndexBinding = 1; + } + this.currentDatabase = paramsMap.get(QueryParams.Databases); + this.ALL_SEARCH_FIELDS_MAP.get(this.currentSearchType).forEach(field => { + if (paramsMap.has(field.getKey())) { + field.setFormControl(paramsMap.get(field.getKey())); + } + }); + } + + private getActionMenu() { + return this.ACTIONS_MENU_LIST.get(this.currentSearchType); + } + + + getSearchTypesLabels(): Array { + let searchTypeMap = new Array(); + this.SEARCH_TYPE_ARRAY.forEach(type => { + searchTypeMap.push("Catalog.Form.SearchTypes." + type) + }); + return searchTypeMap; + } + + panelOpenState() { + this.panelState = true; + } + + panelCloseState() { + this.panelState = false; + } + + getSearchFields(): Array { + return this.ALL_SEARCH_FIELDS_MAP.get(this.currentSearchType); + } + + setCurrentDatabase(db: string) { + this.currentDatabase = db; + } + + onRadioClick(record: IDisplayLines) { + this.isFirstIndex = 1; + this.selected = record; + } + + + onTabChange(event: MatTabChangeEvent) { + this.currentSearchType = this.SEARCH_TYPE_ARRAY[event.index]; + this.currentDatabase = this.getCurrentDatabases()[0]; + if (this.catalogService.getSearchResults(this.currentSearchType).getResults() != null) { + this.setSearchResultsDisplay(); + } else { + this.currentResulsTmpl = this.notSearchedTmpl; + this.panelState = true; + } + this.isRightTableOpen = false; + } + + getCurrentDatabases(): Array { + return this.ALL_DATABASES_MAP.get(this.currentSearchType); + } + + /*** Summary View Section ***/ + private setSearchResultsDisplay() { + this.catalogResultsData = this.catalogService.getSearchResults(this.currentSearchType); + this.numOfResults = this.catalogResultsData.getHeader().totalRecords; + this.resultsSummaryDisplay = new Array(); + this.catalogResultsData.getResults()?.forEach(result => { + this.resultsSummaryDisplay.push(result.getSummaryDisplay()); + }); + this.panelState = false; + this.resultsTemplateFactory(); + } + + resultsTemplateFactory() { + if (this.numOfResults > 0) { + this.currentResulsTmpl = this.searchResultsTmpl; + } else if (this.numOfResults == 0 || this.numOfResults == null) { + this.currentResulsTmpl = this.noResultsTmpl; + } else { + this.currentResulsTmpl = this.notSearchedTmpl; + } + } + + + /*** button function ***/ + clear() { + this.ALL_SEARCH_FIELDS_MAP.get(this.currentSearchType).forEach(searchField => { + searchField.getFormControl().setValue(null) + }); + } + + search() { + + this.isFirstIndex = null; + // Generating the URL by the fields' Form Control + let urlParams = ""; + let valuableFields = this.ALL_SEARCH_FIELDS_MAP.get(this.currentSearchType).filter(field => (field.getFormControl().value != null) && (field.getFormControl().value != "")); + if (valuableFields.length > 0) { + urlParams = urlParams + QueryParams.PageIndex + "=0&" + QueryParams.PageSize + "=20"; + urlParams = urlParams + "&" + QueryParams.SearchType + "=" + this.currentSearchType; + urlParams = urlParams + "&" + QueryParams.Databases + "=" + this.currentDatabase; + valuableFields.forEach(field => { + urlParams = urlParams + "&" + field.getKey(); + urlParams = urlParams + "=" + field.getFormControl().value; + }); + this.getResultsFromNacsis(urlParams, false); + } else { + return; + } + } + + next() { + + sessionStorage.setItem(ROUTING_STATE_KEY, AppRoutingState.SearchRecordMainPage); + let title = this.selected.getFullRecordData().getSummaryView().TRD; + let nacsisID = this.selected.getFullRecordData().getSummaryView().ID; + let rawData = this.selected.getFullRecordData().getFullView(); + let object = JSON.stringify(rawData); + sessionStorage.setItem(SELECTED_RECORD_ILL, object); + sessionStorage.setItem(RESULT_RECORD_LIST_ILL, ''); + this.loading = true; + this.router.navigate(['holdingSearch', nacsisID, title, this.currentSearchType]); + } + + + onTitleClick(recordIndex: number) { + this.recordIndexSelected = this.pageIndex * this.pageSize + recordIndex + // Clicking on title will open the full view + let record = this.resultsSummaryDisplay[recordIndex]; + this.currentResulsTmpl = this.fullRecordTmpl; + this.resultFullDisplay = record.getFullRecordData().getFullViewDisplay().initContentDisplay(); + } + + // Calling Nacsis servlet + getResultsFromNacsis(urlParams: string, isFullViewLink: boolean) { + this.loading = true; + try { + this.catalogService.getSearchResultsFromNacsis(urlParams) + .subscribe({ + next: (catalogResults) => { + if (catalogResults.status === this.catalogService.OkStatus) { + if (!isFullViewLink) { + if (catalogResults.totalRecords >= 1) { + this.catalogService.setSearchResultsMap(this.currentSearchType, catalogResults, urlParams); + this.setPageIndexAndSize(urlParams); + this.setSearchResultsDisplay(); + } else { + this.numOfResults = 0; + this.resultsTemplateFactory(); + } + } else { + if (catalogResults.totalRecords >= 1) { + let baseResult = this.catalogService.resultsTypeFactory(this.currentSearchType, catalogResults.records[0]); + this.resultFullLinkDisplay = baseResult.getFullViewDisplay().initContentDisplay(); + this.isRightTableOpen = true; + } else { + this.resultFullLinkDisplay == null; + this.isRightTableOpen = true; + } + } + } else { + this.alert.error(catalogResults.errorMessage, { keepAfterRouteChange: true }); + } + }, + error: e => { + this.loading = false; + console.log(e.message); + this.alert.error(e.message, { keepAfterRouteChange: true }); + }, + complete: () => this.loading = false + }); + } catch (e) { + this.loading = false; + console.log(e); + this.alert.error(this.translate.instant('General.Errors.generalError'), { keepAfterRouteChange: true }); + } + } + + /*** Pagination ***/ + + setPageIndexAndSize(urlParams: string) { + let pageIndexParam = QueryParams.PageIndex + "="; + let pageSizeParam = "&" + QueryParams.PageSize + "="; + let searchTypeParam = "&" + QueryParams.SearchType; + this.pageIndex = Number(urlParams.split(pageIndexParam).pop().split(pageSizeParam)[0]); + this.pageSize = Number(urlParams.split(pageSizeParam).pop().split(searchTypeParam)[0]); + } + + onPageAction(pageEvent: PageEvent) { + let urlParams = this.catalogService.getQueryParams(this.currentSearchType); + let newIndexStr = QueryParams.PageIndex + "=" + pageEvent.pageIndex + "&" + QueryParams.PageSize; + urlParams = urlParams.replace(/pageIndex=.*pageSize/, newIndexStr); + let newSizeStr = QueryParams.PageSize + "=" + pageEvent.pageSize + "&" + QueryParams.SearchType; + urlParams = urlParams.replace(/pageSize=.*searchType/, newSizeStr); + + this.getResultsFromNacsis(urlParams, false); + } + + + ngOnInit() { + this.backSession = sessionStorage.getItem(ROUTING_STATE_KEY); + this.isBackFromHoldingSearch = this.route.snapshot.params['flagBack']; + this.fillInItemRecord(); + + if (sessionStorage.getItem(ROUTING_STATE_KEY) == "") { + this.catalogService.clearAllSearchResults(); + } else { + this.onBackFromViewHolding(); + } + } + + + + /*** initializing the search fields ***/ + + initMonographsSearchFields(): Array { + return new Array( + new SearchField(FieldName.TITLE, FieldSize.fullWidth), + new SearchField(FieldName.FTITLE, FieldSize.fullWidth), + new SearchField(FieldName.PTBL, FieldSize.fullWidth), + new SearchField(FieldName.AUTH, FieldSize.fullWidth), + new SearchField(FieldName.VOL, FieldSize.large), + new SearchField(FieldName.AKEY, FieldSize.large), + new SearchField(FieldName.PUB, FieldSize.large), + new SearchField(FieldName.YEAR, FieldSize.large), + new SearchField(FieldName.PLACE, FieldSize.medium), + new SearchField(FieldName.CNTRY, FieldSize.medium), + new SearchField(FieldName.LANG, FieldSize.medium), + new SearchField(FieldName.SH, FieldSize.medium), + new SearchField(FieldName.ID, FieldSize.medium), + new SearchField(FieldName.PID, FieldSize.medium), + new SearchField(FieldName.ISSN, FieldSize.small), + new SearchField(FieldName.ISBN, FieldSize.small), + new SearchField(FieldName.NBN, FieldSize.small), + new SearchField(FieldName.NDLCN, FieldSize.small), + new SearchField(FieldName.LCCN, FieldSize.small)); + } + + initSerialsSearchFields(): Array { + return new Array(new SearchField(FieldName.TITLE, FieldSize.fullWidth), + new SearchField(FieldName.FTITLE, FieldSize.fullWidth), + new SearchField(FieldName.AUTH, FieldSize.fullWidth), + new SearchField(FieldName.ISSN, FieldSize.small), + new SearchField(FieldName.CODEN, FieldSize.small), + new SearchField(FieldName.NDLPN, FieldSize.small), + new SearchField(FieldName.LCCN, FieldSize.small), + new SearchField(FieldName.PUB, FieldSize.large), + new SearchField(FieldName.YEAR, FieldSize.large), + new SearchField(FieldName.SH, FieldSize.small), + new SearchField(FieldName.AKEY, FieldSize.small), + new SearchField(FieldName.ID, FieldSize.small), + new SearchField(FieldName.FID, FieldSize.small), + new SearchField(FieldName.PLACE, FieldSize.medium), + new SearchField(FieldName.CNTRY, FieldSize.medium), + new SearchField(FieldName.LANG, FieldSize.medium)); + } + + /*** view full record ***/ + + onActionsClick(selection: RecordSelection) { + let record = this.resultsSummaryDisplay[selection.recordIndex]; + switch (selection.actionIndex) { + case 0: // Full view + this.currentResulsTmpl = this.fullRecordTmpl; + this.resultFullDisplay = record.getFullRecordData().getFullViewDisplay().initContentDisplay(); + break; + default: { + this.currentResulsTmpl = this.noResultsTmpl; + } + } + + } + + onBackFromFullView() { + this.currentResulsTmpl = this.searchResultsTmpl; + this.isRightTableOpen = false; + } + + onFullViewLink(fullViewLink: FullViewLink) { + let urlParams = ""; + urlParams = urlParams + QueryParams.PageIndex + "=0&" + QueryParams.PageSize + "=20"; + urlParams = urlParams + "&" + QueryParams.SearchType + "=" + fullViewLink.searchType; + urlParams = urlParams + "&" + QueryParams.Databases + "=" + this.ALL_DATABASES_MAP_SEARCH.get(fullViewLink.searchType)[0]; + urlParams = urlParams + "&" + QueryParams.ID + "=" + fullViewLink.linkID; + + this.getResultsFromNacsis(urlParams, true); + this.isColapsedMode = (window.innerWidth <= 600) ? true : false; + + } + + onFullViewLinkClose() { + this.isRightTableOpen = false; + this.resultFullLinkDisplay = null; + } + + onResize(event) { + this.isColapsedMode = (event.target.innerWidth <= 600) ? true : false; + } + + +} + + + + +export enum QueryParams { + PageIndex = "pageIndex", + PageSize = "pageSize", + SearchType = "searchType", + Databases = "dataBase", + ID = "ID" +} diff --git a/cloudapp/src/app/app-routing.module.ts b/cloudapp/src/app/app-routing.module.ts index 284a0b5..ba59719 100644 --- a/cloudapp/src/app/app-routing.module.ts +++ b/cloudapp/src/app/app-routing.module.ts @@ -7,6 +7,10 @@ import { ConfigurationComponent } from './configuration/configuration.component' import { HelpComponent } from './holdings/help/help.component'; import { MainMenuComponent } from './main-menu/main-menu.component'; import { CatalogMainComponent } from './catalog/main/main.component'; +import { ILLBorrowingMainComponent } from './ILL/main/main.component'; +import { searchRecordComponent } from './ILL/searchRecord/searchRecord.component'; +import { HoldingSearchComponent } from './ILL/holdingSearch/holdingSearch.component'; +import { RequestFormComponent } from './ILL/requestForm/requestForm.component'; const routes: Routes = [ { path: '', component: MainMenuComponent }, @@ -17,7 +21,16 @@ const routes: Routes = [ { path: 'holdings/:mmsId/new/:mmsTitle', component: FormComponent }, { path: 'holdings/:mmsId/view/:holdingId/:mmsTitle', component: FormComponent }, { path: 'help', component: HelpComponent }, - { path: 'catalog', component: CatalogMainComponent } + { path: 'catalog', component: CatalogMainComponent }, + { path: 'ILL', component: ILLBorrowingMainComponent }, + { path: 'searchRecord', component: searchRecordComponent }, + { path: 'searchRecord/:flagBack', component: searchRecordComponent }, + { path: 'searchRecord/:nacsisId/:title/:isbn/:issn', component: searchRecordComponent }, + { path: 'holdingSearch', component: HoldingSearchComponent }, + { path: 'holdingSearch/:nacsisId/:mmsTitle', component: HoldingSearchComponent }, + { path: 'holdingSearch/:nacsisId/:mmsTitle/:searchType', component: HoldingSearchComponent }, + { path: 'requestForm', component: RequestFormComponent }, + { path: 'requestForm/:nacsisId/:mmsTitle/:searchType', component: RequestFormComponent }, ]; @NgModule({ diff --git a/cloudapp/src/app/app.module.ts b/cloudapp/src/app/app.module.ts index 30a818c..3aa8b22 100644 --- a/cloudapp/src/app/app.module.ts +++ b/cloudapp/src/app/app.module.ts @@ -29,9 +29,22 @@ import { FullviewDisplayComponent } from './catalog/full-view-display/full-view- import { SearchFormComponent } from './user-controls/search-form/search-form.component'; import { ResultsListComponent } from './user-controls/results-list/results-list.component'; import { ResultCardComponent } from './user-controls/result-card/result-card.component'; +import { RecordsListComponent } from './user-controls/records-list/records-list.component'; +import { RecordCardComponent } from './user-controls/record-card/record-card.component'; +import { SelectableResultsListComponent } from './user-controls/selectable-results-list/selectable-results-list.component'; +import { SelectableResultCardComponent } from './user-controls/selectable-result-card/selectable-result-card.component'; +// ILL +import { ILLBorrowingMainComponent } from './ILL/main/main.component'; +import { searchRecordComponent } from './ILL/searchRecord/searchRecord.component'; +import { HoldingSearchComponent } from './ILL/holdingSearch/holdingSearch.component'; +import { RequestFormComponent } from './ILL/requestForm/requestForm.component'; +import { FullviewDisplayOfMemComponent } from './ILL/full-view-display-member/full-view-display-member.component'; - +//Paginator +import {MatPaginatorModule, MatPaginatorIntl } from '@angular/material/paginator'; +import { TranslateService } from '@ngx-translate/core'; +import { PaginatorIntlService } from './service/paginator.translate'; export function getToastrModule() { return ToastrModule.forRoot({ @@ -56,6 +69,15 @@ export function getToastrModule() { ResultsListComponent, ResultCardComponent, FullviewDisplayComponent, + ILLBorrowingMainComponent, + RecordsListComponent, + RecordCardComponent, + searchRecordComponent, + SelectableResultsListComponent, + SelectableResultCardComponent, + HoldingSearchComponent, + RequestFormComponent, + FullviewDisplayOfMemComponent ], entryComponents: [ConfirmationDialog], imports: [ @@ -73,7 +95,12 @@ export function getToastrModule() { AlertModule, MenuModule, ], - providers: [], + providers: [ + { + provide: MatPaginatorIntl, + useClass: PaginatorIntlService, + }, + ], bootstrap: [ AppComponent ] diff --git a/cloudapp/src/app/catalog/results-types/member.ts b/cloudapp/src/app/catalog/results-types/member.ts new file mode 100644 index 0000000..0507c57 --- /dev/null +++ b/cloudapp/src/app/catalog/results-types/member.ts @@ -0,0 +1,260 @@ +import { TranslateService } from '@ngx-translate/core'; +import { IDisplayLines, BaseResult, ViewField, ViewLine, ViewFieldBuilder, BLANK_SPACE } from './results-common'; +import { SearchType } from '../../user-controls/search-form/search-form-utils'; + +export class Member extends BaseResult { + summaryView: MemberSummary; + fullView: MemberFull; + + constructor(record: any, translate: TranslateService) { + super(record, translate); + } + + getSummaryDisplay() { + return new MemberSummaryDisplay(this.translate, this); + } + + getFullViewDisplay() { + return new MemberFullDisplay(this); + } + +} + + +export class MemberSummaryDisplay extends IDisplayLines { + + private record: MemberSummary; + + constructor( + private translate: TranslateService, + fullRecordData: Member + ) { + super(fullRecordData); + this.record = fullRecordData.getSummaryView(); + } + + initTitleDisplay(): ViewLine { + let fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.CRTDT).build()); + this.titleLine = new ViewLine(new ViewFieldBuilder().build(), fieldsArray); + return this.titleLine; + } + + initContentDisplay(): Array { + + return this.viewLines; + } +} + +export class MemberFullDisplay extends IDisplayLines { + private record: MemberFull; + constructor(fullViewRecord: Member) { + super(fullViewRecord); + this.record = fullViewRecord.getFullView(); + } + initContentDisplay() { + this.viewLines = new Array(); + let fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().label("ILL.MemberInfo.MemberID").content(this.record.ID).build()); + fieldsArray.push(new ViewFieldBuilder().label("Create date:").content(this.dateFormatDisplay(this.record.CRTDT)).build()); + fieldsArray.push(new ViewFieldBuilder().label("Update date:").content(this.dateFormatDisplay(this.record.RNWDT)).build()); + this.addLine(new ViewFieldBuilder().build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.NAME).build()); + fieldsArray.push(new ViewFieldBuilder().label("|| ").content(this.record.NAMER).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.ParticipatingOrganizationName").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.RYAKU).build()); + fieldsArray.push(new ViewFieldBuilder().label("|| ").content(this.record.RYAKUR).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.ParticipatingOrganizationAbbreviation").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().label("ILL.MemberInfo.PostalCode").content(this.record.ZIP).build()); + fieldsArray.push(new ViewFieldBuilder().label("ILL.MemberInfo.StreetAddress").content(this.record.ADDRESS).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.Address").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.ILLDEPT).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.ILLDepartment").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.ILLSTAFF).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.ILLPersonInCharge").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.TEL).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.PhoneNumber").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.FAX).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.Fax").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.SETCODE).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.EstablisherType").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.ORGCODE).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.InstitutionType").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.CATFLG).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.CATParticipationType").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.ILLFLG).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.ILLParticipationType").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.COPYS).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.CopyServiceType").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.LOANS).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.LendingServiceType").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.FAXS).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.FAXServiceType").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.STAT).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.ServiceStatus").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.COPYAL).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.CopyReceptionHallCode").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.LOANAL).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.RentalAndBorrowingCenterCode").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.LOANP).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.LendingPeriod").build(), fieldsArray); + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.KENCODE).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.RegionPrefectureCode").build(), fieldsArray); + + if (!this.isEmpty(this.record.CATDEPT)) { + for (let i = 0; i < this.record.CATDEPT.length; i++) { + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.CATDEPT[i]).build()); + if (!this.isEmpty(this.record.CATTEL) && this.record.CATTEL.length >= i) { + if(i==1){ + fieldsArray.push(new ViewFieldBuilder().label("ILL.MemberInfo.CatPhoneNumFirst").content(this.record.CATTEL[i]).build()); + }else{ + fieldsArray.push(new ViewFieldBuilder().label("ILL.MemberInfo.CatPhoneNum").content(this.record.CATTEL[i]).build()); + } + } + if (!this.isEmpty(this.record.CATFAX) && this.record.CATFAX.length >= i) { + fieldsArray.push(new ViewFieldBuilder().label("ILL.MemberInfo.CatFax").content(this.record.CATFAX[i]).build()); + } + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.CatalogingDepartment").build(), fieldsArray); + } + } + + if (!this.isEmpty(this.record.SYSDEPT)) { + for (let i = 0; i < this.record.SYSDEPT.length; i++) { + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.SYSDEPT[i]).build()); + if (!this.isEmpty(this.record.SYSTEL) && this.record.SYSTEL.length >= i) { + fieldsArray.push(new ViewFieldBuilder().label("ILL.MemberInfo.SystemPhoneNum").content(this.record.SYSTEL[i]).build()); + } + if (!this.isEmpty(this.record.SYSFAX) && this.record.SYSFAX.length >= i) { + fieldsArray.push(new ViewFieldBuilder().label("ILL.MemberInfo.SystemFax").content(this.record.SYSFAX[i]).build()); + } + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.SystemDepartment").build(), fieldsArray); + } + } + + if (!this.isEmpty(this.record.EMAIL)) { + for (let i = 0; i < this.record.EMAIL.length; i++) { + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.EMAIL[i]).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.Email").build(), fieldsArray); + } + } + + if (!this.isEmpty(this.record.POLICY)) { + for (let i = 0; i < this.record.POLICY.length; i++) { + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.POLICY[i]).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.ILLPolicy").build(), fieldsArray); + } + } + + if (!this.isEmpty(this.record.LOC)) { + for (let i = 0; i < this.record.LOC.length; i++) { + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.LOC[i]).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.LocationCode").build(), fieldsArray); + } + } + + fieldsArray = new Array(); + fieldsArray.push(new ViewFieldBuilder().content(this.record.GRPCODE).build()); + this.addLine(new ViewFieldBuilder().label("ILL.MemberInfo.OffsetCode").build(), fieldsArray); + + return this.viewLines; + } +} + + + +export class MemberSummary { + ID: string; + CRTDT: string; +} + + +export class MemberFull { + SYSTEL: any[]; + POLICY: any[]; + CATDEPT: any[]; + CATTEL: any[]; + + ID: string; + NAME: string; + CRTDT: string; + NAMER: string; + RYAKU: string; + + RNWDT: string; + RYAKUR: string; + ILLDEPT: string; + ADDRESS: string; + COPYS: string; + + ILLSTAFF: string; + ZIP: string; + SETCODE: string; + ORGCODE: string; + TEL: string; + + FAX: string; + CATFLG: string; + ILLFLG: string; + + CATFAX: any[]; + EMAIL: any[]; + LOANP: string; + LOANS: string; + COPYAL: string; + + SYSFAX: any[]; + STAT: string; + LOC: any[]; + GRPCODE: string; + KENCODE: string; + + FAXS: string; + LOANAL: string; + SYSDEPT: any[]; + +} + + diff --git a/cloudapp/src/app/catalog/results-types/monographs.ts b/cloudapp/src/app/catalog/results-types/monographs.ts index 901620a..73e953d 100644 --- a/cloudapp/src/app/catalog/results-types/monographs.ts +++ b/cloudapp/src/app/catalog/results-types/monographs.ts @@ -195,7 +195,7 @@ export class MonographSummaryDisplay extends IDisplayLines{ this.addLine(new ViewFieldBuilder().build(), fieldsArray); fieldsArray = new Array(); fieldsArray.push(new ViewFieldBuilder().label('Catalog.Results.ISBN').content(this.record.ISBN).build()); - if(this.record.hasMoreThen1ISBN){ + if(this.record.hasMoreThen1ISBN && !this.isEmpty(this.record.ISBN)){ fieldsArray.push(new ViewFieldBuilder().content(('Catalog.Results.AndOthers')).build()); } this.addLine(new ViewFieldBuilder().build(), fieldsArray); diff --git a/cloudapp/src/app/catalog/results-types/serials.ts b/cloudapp/src/app/catalog/results-types/serials.ts index 830a49d..4f9d530 100644 --- a/cloudapp/src/app/catalog/results-types/serials.ts +++ b/cloudapp/src/app/catalog/results-types/serials.ts @@ -185,7 +185,7 @@ export class SerialSummaryDisplay extends IDisplayLines{ this.addLine(new ViewFieldBuilder().build(), fieldsArray); fieldsArray = new Array(); fieldsArray.push(new ViewFieldBuilder().label('Catalog.Results.ISSN').content(this.record.ISSN).build()); - if(this.record.hasMoreThen1ISBN){ + if(this.record.hasMoreThen1ISBN && !this.isEmpty(this.record.ISSN)){ fieldsArray.push(new ViewFieldBuilder().content(('Catalog.Results.AndOthers')).build()); } this.addLine(new ViewFieldBuilder().build(), fieldsArray); diff --git a/cloudapp/src/app/holdings/main/main.component.html b/cloudapp/src/app/holdings/main/main.component.html index 7a568fa..2a7eab5 100644 --- a/cloudapp/src/app/holdings/main/main.component.html +++ b/cloudapp/src/app/holdings/main/main.component.html @@ -1,4 +1,4 @@ -
+

Holdings.Main.Intro

- - Holdings.Main.SelectBib - - - {{bib.id}}: {{bib.description}} - - - + + + + +
diff --git a/cloudapp/src/app/holdings/main/main.component.ts b/cloudapp/src/app/holdings/main/main.component.ts index 3a5a839..b454eed 100644 --- a/cloudapp/src/app/holdings/main/main.component.ts +++ b/cloudapp/src/app/holdings/main/main.component.ts @@ -10,6 +10,7 @@ import { map, catchError, switchMap, tap } from 'rxjs/operators'; import { AlmaApiService, IntegrationProfile } from '../../service/alma.api.service'; import { AppRoutingState, ROUTING_STATE_KEY } from '../../service/base.service'; +import { IllService,AlmaRecordsResults, IDisplayLines,BaseRecordInfo,AlmaRecordInfo,AlmaRecord,AlmaRecordDisplay} from '../../service/ill.service'; @Component({ @@ -23,13 +24,16 @@ export class MainComponent implements OnInit, OnDestroy { bibs: Entity[] = []; selected: string; loading = false; - title: string; message: string; isErrorMessageVisible: boolean = false; - processed = 0; integrationProfile: IntegrationProfile; + private recordsSummaryDisplay: Array; + private almaResultsData: AlmaRecordsResults; + baseRecordInfoList: Array = new Array(); + recordInfoList: AlmaRecordInfo[] = new Array(); + almaRecord: AlmaRecord = new AlmaRecord('',this.translate,this.illService); constructor( private eventsService: CloudAppEventsService, @@ -40,54 +44,52 @@ export class MainComponent implements OnInit, OnDestroy { private restService: CloudAppRestService, private almaApiService: AlmaApiService, - + private illService: IllService, ) { } ngOnInit() { sessionStorage.clear(); - this.pageLoad$ = this.eventsService.onPageLoad(pageInfo => { this.loading = true; - + try{ this.almaApiService.getIntegrationProfile() - .subscribe(integrationProfile => { - - this.integrationProfile = integrationProfile; - - let rawBibs = (pageInfo.entities || []).filter(e => e.type == EntityType.BIB_MMS); - let nacsisBibs: Entity[] = []; - - forkJoin(rawBibs.map(entity => this.getRecord(entity))) - .subscribe({ - next: (records: any[]) => { - - let index: number = 0; - - records.forEach(record => { - // console.log(record); - let nacsisId = this.almaApiService.extractNacsisId(record.anies, this.integrationProfile.libraryCode); - if (nacsisId != null) { - // tweak: override mmsId by nacsisId - let nacsisBib = rawBibs[index]; - nacsisBib.id = nacsisId; - nacsisBibs.push(nacsisBib); - } - index++; - }) - }, - error: e => { + .subscribe( { + next : integrationProfile => { + this.integrationProfile = integrationProfile; + + let rawBibs = (pageInfo.entities || []).filter(e => e.type == EntityType.BIB_MMS); + let disCards: AlmaRecordInfo[] = new Array(rawBibs.length); + + forkJoin(rawBibs.map(entity => this.getRecord(entity))) + .subscribe({ + next: (records: any[]) => { + disCards = this.almaApiService.getAlmaRecodsInfo(records); + }, + error: e => { + this.loading = false; + console.log(e.message); + }, + complete: () => { + this.loading = false; + this.recordInfoList = disCards; + this.setSearchResultsDisplay(this.recordInfoList,"holding"); + } + }); + }, + error: e => { this.loading = false; console.log(e.message); - //this.alert.error(e.message, {keepAfterRouteChange:true}); - }, - complete: () => { - this.loading = false; - this.bibs = nacsisBibs; - } - }); + this.alert.error(this.translate.instant('General.Errors.generalError'), {keepAfterRouteChange:true}); + } }); + }catch(e) { + this.loading = false; + console.log(e); + this.alert.error(this.translate.instant('General.Errors.generalError'), {keepAfterRouteChange:true}); + } + }); } @@ -107,13 +109,13 @@ export class MainComponent implements OnInit, OnDestroy { this.loading = true; try { - let bib = this.bibs.filter(bib => bib.id == this.selected); + let bib = this.recordInfoList.filter(almaRecord => almaRecord.nacsisId ==this.selected ); this.nacsis.getHoldingsFromNacsis(this.selected, "Mine") .subscribe({ next: (header) => { if (header.status === this.nacsis.OkStatus) { sessionStorage.setItem(ROUTING_STATE_KEY, AppRoutingState.HoldingsMainPage); - this.router.navigate(['/holdings', this.selected, bib[0].description]); + this.router.navigate(['/holdings', this.selected, bib[0].title]); } else { this.alert.error(header.errorMessage, { keepAfterRouteChange: true }); } @@ -136,5 +138,14 @@ export class MainComponent implements OnInit, OnDestroy { onCloseClick() { this.isErrorMessageVisible = false; } + + private setSearchResultsDisplay(recordInfoList: AlmaRecordInfo[], type: string){ + this.recordsSummaryDisplay = this.almaApiService.setRecordsSummaryDisplay(recordInfoList,type); + } + + onRadioClick(item : AlmaRecordDisplay) { + this.selected = item.getNacsisID(); + } + } diff --git a/cloudapp/src/app/service/alma.api.service.ts b/cloudapp/src/app/service/alma.api.service.ts index 2345126..21fd17c 100644 --- a/cloudapp/src/app/service/alma.api.service.ts +++ b/cloudapp/src/app/service/alma.api.service.ts @@ -2,7 +2,8 @@ import { Injectable } from '@angular/core'; import { CloudAppRestService } from '@exlibris/exl-cloudapp-angular-lib'; import { mergeMap } from 'rxjs/operators'; import { of } from 'rxjs'; - +import { IllService,AlmaRecordsResults, IDisplayLines,BaseRecordInfo,AlmaRecordInfo,AlmaRecord,AlmaRecordDisplay } from '../service/ill.service'; +import { TranslateService } from '@ngx-translate/core'; @Injectable({ providedIn: 'root' @@ -10,10 +11,16 @@ import { of } from 'rxjs'; export class AlmaApiService { integrationProfile :IntegrationProfile; + recordInfoList: AlmaRecordInfo[] = new Array(); + recordsSummaryDisplay: Array; + almaResultsData: AlmaRecordsResults; + almaRecord: AlmaRecord = new AlmaRecord('',this.translate,this.illService); + baseRecordInfoList: Array = new Array(); constructor( private restService: CloudAppRestService, - + private translate: TranslateService, + private illService: IllService, ) { } /* @@ -32,12 +39,12 @@ export class AlmaApiService { extractNacsisId(stringXml, systemNumberPrefix) : string{ const doc = new DOMParser().parseFromString(stringXml, "application/xml"); let datafields = doc.getElementsByTagName("datafield"); - let subfield_016_a, subfield_016_2; + let subfield_016_a, subfield_016_2, subfield_035_a; for (let index = 0; index < datafields.length; index++) { const field = datafields[index]; let tag = field.getAttribute("tag").valueOf(); - // console.log(tag); + if(tag === "016") { let subfields = field.getElementsByTagName("subfield"); for (let index = 0; index < subfields.length; index++) { @@ -53,14 +60,197 @@ export class AlmaApiService { if(subfield_016_2 == systemNumberPrefix) { return subfield_016_a; } - return null; + } + + if(tag === "035"){ + let subfields = field.getElementsByTagName("subfield"); + for (let index = 0; index < subfields.length; index++) { + const subfield = subfields[index]; + let tag = subfield.getAttribute("code").valueOf(); + if(tag === "a") { + subfield_035_a = subfield.innerHTML; + if(subfield_035_a.indexOf(systemNumberPrefix) != -1){ + //(NII)BA000111 + return subfield_035_a.replace(systemNumberPrefix,"").replace("()",""); + } + } + } } } - return null; + + return ""; } - getIntegrationProfile() { + extractDisplayCardInfoFromRequest(record): AlmaRecordInfo{ + let recordInfo: AlmaRecordInfo = new AlmaRecordInfo(); + recordInfo.title = this.isEmpty(record.title)?'':record.title; + recordInfo.author = this.isEmpty(record.author)?'':record.author; + recordInfo.place_of_pub = this.isEmpty(record.place_of_publication)?'':record.place_of_publication; + recordInfo.name_of_pub = this.isEmpty(record.publisher)?'':record.publisher; + recordInfo.date_of_pub = this.isEmpty(record.year)?'':record.year; + recordInfo.isbn = this.isEmpty(record.isbn)?'':record.isbn; + recordInfo.issn = this.isEmpty(record.issn)?'':record.issn; + if(!this.isEmpty(record.requested_language)){ + recordInfo.language = this.isEmpty(record.requested_language.value)?'':record.requested_language.value; + }else{ + recordInfo.language = ''; + } + recordInfo.nacsisId = this.isEmpty(record.other_standard_id)?'':record.other_standard_id; + + return recordInfo; + } + + + extractDisplayCardInfo(stringXml, systemNumberPrefix): AlmaRecordInfo { + + const doc = new DOMParser().parseFromString(stringXml, "application/xml"); + + let datafields = doc.getElementsByTagName("datafield"); + let controlfield = doc.getElementsByTagName("controlfield"); + + let recordInfo: AlmaRecordInfo = new AlmaRecordInfo(); + //Title + let subfield_245_a, subfield_245_b, subfield_245_c; + // Author + let subfield_100_a, subfield_110_a, subfield_111_a, + subfield_700_a, subfield_720_a, subfield_711_a ; + let authorArray = new Array(); + // Publisher + let subfield_260_a, subfield_260_b, subfield_260_c; + // Language + let subfield_008_35_37; + // ISBN/ISSN + let subfield_020_a, subfield_022_a; + // NACSIS + let nacsisID; + + //490 all subfield + let seriesSummary; + + try { + + subfield_008_35_37 = this.getValueFromControlFields(controlfield, "008").substring(35, 37); + recordInfo.language = subfield_008_35_37; + //NACSIS ID + nacsisID = this.extractNacsisId(stringXml, systemNumberPrefix); + recordInfo.nacsisId = nacsisID; + + //Title + subfield_245_a = this.getValueFromDataFields(datafields, "245", "a"); + subfield_245_b = this.getValueFromDataFields(datafields, "245", "b"); + subfield_245_c = this.getValueFromDataFields(datafields, "245", "c"); + recordInfo.title = subfield_245_a + " " + subfield_245_b + " " + subfield_245_c; + + + //Author + subfield_100_a = this.getValueFromDataFields(datafields, "100", "a"); + subfield_110_a = this.getValueFromDataFields(datafields, "110", "a"); + subfield_111_a = this.getValueFromDataFields(datafields, "111", "a"); + + subfield_700_a = this.getValueFromDataFields(datafields, "100", "a"); + subfield_720_a = this.getValueFromDataFields(datafields, "720", "a"); + subfield_711_a = this.getValueFromDataFields(datafields, "711", "a"); + + authorArray.push(subfield_100_a); + authorArray.push(subfield_110_a); + authorArray.push(subfield_111_a); + authorArray.push(subfield_700_a); + authorArray.push(subfield_720_a); + authorArray.push(subfield_711_a); + + let str = authorArray.find((e) => !this.isEmpty(e)); + if(this.isEmpty(str))str = ""; + recordInfo.author = str; + + + //Publisher + subfield_260_a = this.getValueFromDataFields(datafields, "260", "a"); + subfield_260_b = this.getValueFromDataFields(datafields, "260", "b"); + subfield_260_c = this.getValueFromDataFields(datafields, "260", "c"); + + recordInfo.place_of_pub = subfield_260_a; + recordInfo.name_of_pub = subfield_260_b; + recordInfo.date_of_pub = subfield_260_c; + + + //ISBN/ISSN + subfield_020_a = this.getValueFromDataFields(datafields, "020", "a"); + subfield_022_a = this.getValueFromDataFields(datafields, "022", "a"); + + recordInfo.isbn = subfield_020_a; + recordInfo.issn = subfield_022_a; + + + //seriesSummary + seriesSummary = this.getAllSubfieldValueFromDataFields(datafields, "490"); + recordInfo.seriesSummaryAll = seriesSummary; + + } catch (error) { + return new AlmaRecordInfo(); + } + + return recordInfo; + } + + + getValueFromDataFields(datafields, tag_send, subfield_send): string { + + let str = ""; + for (let index = 0; index < datafields.length; index++) { + const field = datafields[index]; + let tag = field.getAttribute("tag").valueOf(); + if (tag === tag_send) { + let subfields = field.getElementsByTagName("subfield"); + for (let index = 0; index < subfields.length; index++) { + const subfield = subfields[index]; + let tag = subfield.getAttribute("code").valueOf(); + if (tag === subfield_send) { + str = subfield.innerHTML; + } + } + } + } + return str; + } + + + getAllSubfieldValueFromDataFields(datafields, tag_send): string { + let str = ""; + for (let index = 0; index < datafields.length; index++) { + const field = datafields[index]; + let tag = field.getAttribute("tag").valueOf(); + if (tag === tag_send) { + let subfields = field.getElementsByTagName("subfield"); + for (let index = 0; index < subfields.length; index++) { + const subfield = subfields[index]; + str = str.concat(subfield.innerHTML); + } + } + } + return str; + } + + getValueFromControlFields(controlfield, tag_send): string { + + let str = ""; + for (let index = 0; index < controlfield.length; index++) { + const field = controlfield[index]; + let tag = field.getAttribute("tag").valueOf(); + if (tag === tag_send) { + str = field.innerHTML; + } + } + return str; + } + + isEmpty(val) { + return (val === undefined || val == null || val.length <= 0) ? true : false; + } + + + getIntegrationProfile() { + let url = "/conf/integration-profiles?type=CENTRAL_CATALOG_INTEGRATION"; if(this.integrationProfile != null && this.integrationProfile != undefined) { @@ -102,9 +292,62 @@ export class AlmaApiService { }) ); } + + + getAlmaRecodsInfo(records: any[]) { + let index: number = 0; + let disCards: AlmaRecordInfo[] = new Array(); + let singleRecordInfo: AlmaRecordInfo; + + records.forEach(record => { + if(!this.isEmpty(record.bib)){ + singleRecordInfo = this.extractDisplayCardInfo(record.bib.anies, this.integrationProfile.libraryCode); + }else{ + if(this.isEmpty(record.anies)){ + singleRecordInfo = this.extractDisplayCardInfoFromRequest(record); + + }else{ + singleRecordInfo = this.extractDisplayCardInfo(record.anies, this.integrationProfile.libraryCode); + } + } + + if (singleRecordInfo != null) { + disCards[index]= singleRecordInfo; + } + index++; + }) + + return disCards; + + } + + setRecordsSummaryDisplay(recordInfoList: AlmaRecordInfo[],type: string){ + this.almaResultsData = new AlmaRecordsResults(); + this.baseRecordInfoList = new Array(); + recordInfoList.forEach(record=>{ + this.almaRecord = new AlmaRecord('',this.translate,this.illService); + this.almaRecord.moduleType = type; + this.illService.recordFillIn(this.almaRecord,record); + this.baseRecordInfoList.push(this.almaRecord); + }); + this.almaResultsData.setResults(this.baseRecordInfoList); + + this.recordsSummaryDisplay = new Array(); + this.almaResultsData.getResults()?.forEach(result=>{ + this.recordsSummaryDisplay.push(result.getSummaryDisplay()); + }); + + return this.recordsSummaryDisplay; + } + + } + + + + export class IntegrationProfile { libraryCode: string; libraryID: string; diff --git a/cloudapp/src/app/service/base.service.ts b/cloudapp/src/app/service/base.service.ts index 694c69e..2c525eb 100644 --- a/cloudapp/src/app/service/base.service.ts +++ b/cloudapp/src/app/service/base.service.ts @@ -82,9 +82,17 @@ export class Header { } export const ROUTING_STATE_KEY = "routingState"; +export const LIBRARY_ID_KEY = "libraryIDKey"; +export const LIBRARY_MEMBERINFO_KEY = "libraryMemberInfoKey"; +export const SELECTED_RECORD_ILL = "selectedDataInILL"; +export const SELECTED_RECORD_LIST_ILL = "selectedDataListInILL"; +export const RESULT_RECORD_LIST_ILL = "resultDataInILL"; export enum AppRoutingState { MainMenuPage = "", HoldingsMainPage = "/holdings", - CatalogSearchPage = "/catalog" + CatalogSearchPage = "/catalog", + ILLBorrowingMainPage = "/ILL", + SearchRecordMainPage = "/searchRecord", + HoldingSearchMainPage = "/holdingSearch" } \ No newline at end of file diff --git a/cloudapp/src/app/service/catalog.service.ts b/cloudapp/src/app/service/catalog.service.ts index 74fa930..73b32fa 100644 --- a/cloudapp/src/app/service/catalog.service.ts +++ b/cloudapp/src/app/service/catalog.service.ts @@ -14,12 +14,13 @@ import { Serial } from '../catalog/results-types/serials'; import { Name } from '../catalog/results-types/name'; import { UniformTitle } from '../catalog/results-types/uniformTitle'; import { AlmaApiService, IntegrationProfile } from './alma.api.service'; +import { Member } from '../catalog/results-types/member'; @Injectable({ providedIn: 'root' }) -export class CatalogService extends BaseService { +export class CatalogService extends BaseService { private searchResultsMap: Map; public currentSearchType: SearchType; @@ -29,17 +30,18 @@ export class CatalogService extends BaseService { protected http: HttpClient, protected almaApi: AlmaApiService, protected translate: TranslateService - ) { + ) { super(eventsService, http); this.initResultsMap(); } - private initResultsMap(){ + private initResultsMap() { this.searchResultsMap = new Map([ [SearchType.Monographs, new NacsisCatalogResults()], [SearchType.Serials, new NacsisCatalogResults()], [SearchType.Names, new NacsisCatalogResults()], - [SearchType.UniformTitles, new NacsisCatalogResults()] + [SearchType.UniformTitles, new NacsisCatalogResults()], + [SearchType.Members, new NacsisCatalogResults()] ]); } @@ -53,41 +55,51 @@ export class CatalogService extends BaseService { this.searchResultsMap.get(searchType).setResults(new Array()); response.records.forEach(record => { this.searchResultsMap.get(searchType).getResults().push(this.resultsTypeFactory(searchType, record)); - }); - } + }); + } + + setSearchMemberDBResultsMap(searchType: SearchType, memberinfo: any) { + this.searchResultsMap.get(searchType).setResults(new Array()); + memberinfo.forEach(record => { + let newRecord = new Member(record, null); + newRecord.fullView = record; + newRecord.summaryView = record; + this.searchResultsMap.get(searchType).getResults().push(this.resultsTypeFactory(searchType, newRecord)); + }); + } - clearAllSearchResults(){ + clearAllSearchResults() { this.initResultsMap(); } setCurrentSearchType(searchType: SearchType) { this.currentSearchType = searchType; } - + getQueryParams(searchType?: SearchType) { - if(searchType !== undefined) { + if (searchType !== undefined) { return this.searchResultsMap.get(searchType).getQueryParams(); } else { return this.searchResultsMap.get(this.currentSearchType).getQueryParams(); } } - setBaseUrl(initData: InitData) : string { + setBaseUrl(initData: InitData): string { let baseUrl = super.setBaseUrl(initData); baseUrl = baseUrl + "copyCatalog?"; return baseUrl; } - getSearchResultsFromNacsis(queryParams: string){ + getSearchResultsFromNacsis(queryParams: string) { let fullUrl: string; - + return this.getInitData().pipe( mergeMap(initData => { fullUrl = this.setBaseUrl(initData) + queryParams; return this.getAuthToken() - }), - mergeMap(authToken => { + }), + mergeMap(authToken => { let headers = this.setAuthHeader(authToken); return this.http.get(fullUrl, { headers }) }), @@ -97,17 +109,18 @@ export class CatalogService extends BaseService { ); } - - resultsTypeFactory(type: SearchType, record: any){ - switch (type){ + resultsTypeFactory(type: SearchType, record: any) { + switch (type) { case SearchType.Monographs: return new Monograph(record, this.translate); case SearchType.Serials: return new Serial(record, this.translate); case SearchType.Names: - return new Name(record, this.translate); + return new Name(record, this.translate); case SearchType.UniformTitles: return new UniformTitle(record, this.translate); + case SearchType.Members: + return new Member(record, this.translate); default: return null; @@ -115,7 +128,7 @@ export class CatalogService extends BaseService { } importRecordToAlma(searchType: SearchType, rawData: string) { - return this.almaApi.getIntegrationProfile().pipe( + return this.almaApi.getIntegrationProfile().pipe( mergeMap(integrationProfile => { let factoryValues = this.integrationProfileFactory(searchType, integrationProfile); let body = "<" + factoryValues.typeTag + ">catp"; @@ -125,11 +138,11 @@ export class CatalogService extends BaseService { return of(response); // return of(response.warnings, response.mms_id); }) - ); + ); } integrationProfileFactory(searchType: SearchType, integrationProfile: IntegrationProfile) { - switch(searchType) { + switch (searchType) { case (SearchType.Monographs): return { typeTag: "bib", urlType: "", ID: integrationProfile.repositoryImportProfile }; case (SearchType.Serials): @@ -137,14 +150,14 @@ export class CatalogService extends BaseService { case (SearchType.Names): return { typeTag: "authority", urlType: "/authorities", ID: integrationProfile.authorityImportProfileNames }; case (SearchType.UniformTitles): - return { typeTag: "authority", urlType: "/authorities", ID: integrationProfile.authorityImportProfileUniformTitles}; + return { typeTag: "authority", urlType: "/authorities", ID: integrationProfile.authorityImportProfileUniformTitles }; } } } -/* +/* *** BIB *** url - /almaws/v1/bibs? tags - diff --git a/cloudapp/src/app/service/holdings.service.ts b/cloudapp/src/app/service/holdings.service.ts index 591cbe0..169fd9c 100644 --- a/cloudapp/src/app/service/holdings.service.ts +++ b/cloudapp/src/app/service/holdings.service.ts @@ -28,6 +28,12 @@ export class HoldingsService extends BaseService { return baseUrl; } + setMemberBaseUrl(initData: InitData) : string { + let baseUrl = super.setBaseUrl(initData); + baseUrl = baseUrl + "member?"; + return baseUrl; + } + getHeader(): Header { return this._header; } @@ -39,6 +45,30 @@ export class HoldingsService extends BaseService { return this.getInitData().pipe( mergeMap(initData => { fullUrl = this.setBaseUrl(initData) + "nacsisId=" + nacsisId + "&owner=" + owner; + console.log(fullUrl); + return this.getAuthToken()}), + mergeMap(authToken => { + let headers = this.setAuthHeader(authToken); + return this.http.get(fullUrl, { headers })}), + mergeMap(response => { + console.log(response); + this._header = response; + this._holdings = response.nacsisRecordList; + if (this._header.status === this.OkStatus && !this.isEmpty(this._holdings)) { + this.updateHoldingPreview(); + } + return of(this._header); + }) + ); + } + + getHoldingsForILLFromNacsis(queryParams: String){ + + let fullUrl: string; + return this.getInitData().pipe( + mergeMap(initData => { + fullUrl = this.setBaseUrl(initData) + queryParams; + console.log(fullUrl); return this.getAuthToken()}), mergeMap(authToken => { let headers = this.setAuthHeader(authToken); @@ -55,6 +85,24 @@ export class HoldingsService extends BaseService { ); } + + getMemberForILLFromNacsis(queryParams: String){ + + let fullUrl: string; + return this.getInitData().pipe( + mergeMap(initData => { + fullUrl = this.setMemberBaseUrl(initData) + queryParams; + return this.getAuthToken()}), + mergeMap(authToken => { + let headers = this.setAuthHeader(authToken); + return this.http.get(fullUrl, { headers })}), + mergeMap(response => { + this._header = response; + return of(this._header); + }) + ); + } + getHolding(id: string): Holding { return this._holdings.find(holding => holding.ID === id); } @@ -165,6 +213,7 @@ export class Header { FANO: string = "" // library id LIBABL: string = "" // library name type: string = "" // BOOK/SERIAL + nacsisRecordList: any[]; } export class Holding { @@ -200,6 +249,101 @@ export class HoldingsSerial { CPYNT: string = ""; } +export class HoldingsSearch { + nacsisId:string = "";//Nacsis id + FANO: string = ""; //Participating organization code + VOL: string = ""; //Volume + YEAR:string = ""; //Year + LOC: string = "";//Location + _KENCODE_: string = ""; //Region (prefecture) code + _SETCODE_: string = ""; //Establisher type + _ORGCODE_: string = ""; //Institution type + _GRPCODE_: string = ""; //Offset charge + _ILLFLG_: string = ""; //ILL participation type + _STAT_: string = ""; //Service status + _COPYS_: string = ""; //Copy service type + _LOANS_: string = ""; //Lending service type + _FAXS_: string = ""; //FAX service type + owner: string = ""; //Owner +} + +export class NacsisHoldingRecord{ + BID: string = ""; + COPYS: string = ""; + CRTDT: string = ""; + FANO: string = ""; + FAXS: string = ""; + GRPCODE: string = ""; + ID: string = ""; + ILLFLG: string = ""; + KENCODE: string = ""; + LIBABL: string = ""; + LOANS:string = ""; + LOC: string = ""; + SUM:string=""; + ORGCODE: string = ""; + RNWDT: string = ""; + SETCODE: string = ""; + STAT:string = ""; + editable: boolean = false; + info: string = ""; + libraryFullName: string = ""; + nacsisHoldingsList: any[]; + type: string = ""; +} + +export class volDetails { + +} + +export class NacsisBookHoldingsListDetail { + index:number; + VOL: string = ""; + CLN: string = ""; + RGTN: string = ""; + CPYR: string = ""; + LDF: string = ""; + CPYNT: string = ""; +} + +export class NacsisSerialHoldingsListDetail { + index:number; + HLYR: string = ""; + HLV: string = ""; + CONT: string = ""; + CLN: string = ""; + LDF: string = ""; + CPYNT: string = ""; +} + +export class DisplayHoldingResult{ + index: number; + name: string = ""; + vol: any[];//book only + hlv: string = "";//serial only + hlyr: string = "";//serial only + cln: string = "";//serial only + ldf: string = "";//serial only + region: string = ""; + establisher: string = ""; + institutionType: string = ""; + fee: string = ""; + location : string = ""; + photoCopy_fee : string = ""; + ill : string = ""; + stat : string = ""; + photoCopy : string = ""; + loan : string = ""; + fax : string = ""; + isSelected:boolean = false; + id: string = ""; + crtdt: string = ""; + rnwdt : string = ""; + fano : string = ""; + memberinfo:any[]; +} + + const HOLDINGS = [ { "ID": "holding1", @@ -223,4 +367,4 @@ const HOLDINGS = [ "libraryFullName": "RR (fano2)", "info": "info2" } -]; \ No newline at end of file +]; diff --git a/cloudapp/src/app/service/ill.service.ts b/cloudapp/src/app/service/ill.service.ts new file mode 100644 index 0000000..91d873c --- /dev/null +++ b/cloudapp/src/app/service/ill.service.ts @@ -0,0 +1,401 @@ +import { Injectable } from '@angular/core'; +import { TranslateService } from '@ngx-translate/core'; +import { SearchType, SearchField, FieldSize, FieldName } from '../user-controls/search-form/search-form-utils'; +import { HttpClient } from "@angular/common/http"; +import { mergeMap } from 'rxjs/operators'; +import { of } from 'rxjs'; +import { CloudAppEventsService, InitData } from '@exlibris/exl-cloudapp-angular-lib'; +import { HoldingsService } from '../service/holdings.service'; +import { BaseService } from "./base.service"; + +@Injectable({ + providedIn: 'root' +}) +export class IllService extends BaseService { + + recordInfoList: AlmaRecordInfo[] = new Array(); + recordsSummaryDisplay: Array; + almaResultsData: AlmaRecordsResults; + almaRecord: AlmaRecord = new AlmaRecord('', this.translate, this.illService); + baseRecordInfoList: Array = new Array(); + localMemberInfo: any[]; + + public currentSearchType: SearchType = SearchType.Monographs; + + establisherTypeResult: string[] = [ + '1 国立', '2 公立', '3 私立', '4 特殊法人', '5 海外', '8 研修・テスト用', '9 その他' + ]; + institutionTypeResult: string[] = [ + '1 大学', '2 短期大学', '3 高等専門学校', '4 大学共同利用機関等', '5 他省庁の施設機関等', '8 研修・テスト用', '9 その他' + ]; + iLLParticipationTypeResult: string[] = [ + 'A 参加', 'N 未参加' + ]; + + copyServiceTypeResult: string[] = [ + 'A 受け付ける', 'N 受け付けない', 'C 他の窓口で受け付ける' + ]; + + fAXServiceTypeResult: string[] = [ + 'A サービス可', 'N サービス不可', 'C 条件付でサービス可' + ]; + + offsetCodeTypeResult: string[] = [ + 'N ILL文献複写等料金相殺サービス参加' + ]; + + + constructor( + private translate: TranslateService, + private illService: IllService, + protected eventsService: CloudAppEventsService, + protected http: HttpClient, + private nacsis: HoldingsService, + ) { + super(eventsService, http); + } + + isEmpty(val) { + return (val === undefined || val == null || val.length <= 0) ? true : false; + } + + recordFillIn(illBorrowing: AlmaRecord, record: AlmaRecordInfo) { + illBorrowing.title = this.isEmpty(record.title) ? "" : record.title; + illBorrowing.author = this.isEmpty(record.author) ? "" : record.author; + illBorrowing.place_of_pub = this.isEmpty(record.place_of_pub) ? "" : record.place_of_pub; + illBorrowing.name_of_pub = this.isEmpty(record.name_of_pub) ? "" : record.name_of_pub; + illBorrowing.date_of_pub = this.isEmpty(record.date_of_pub) ? "" : record.date_of_pub; + + illBorrowing.language = this.isEmpty(record.language) ? "" : record.language; + illBorrowing.nacsisId = this.isEmpty(record.nacsisId) ? "" : record.nacsisId; + illBorrowing.isbn = this.isEmpty(record.isbn) ? "" : record.isbn; + illBorrowing.issn = this.isEmpty(record.issn) ? "" : record.issn; + + illBorrowing.seriesSummaryAll = this.isEmpty(record.seriesSummaryAll) ? "" : record.seriesSummaryAll; + } + + setFormValue(item: AlmaRecordDisplay) { + let urlParams = ""; + urlParams = urlParams + QueryParams.PageIndex + "=0&" + QueryParams.PageSize + "=20"; + + if (this.isSerial(item.record.nacsisId)) { + this.currentSearchType = SearchType.Serials; + } + + urlParams = urlParams + "&" + QueryParams.SearchType + "=" + this.currentSearchType; + + urlParams = urlParams + "&" + FieldName.TITLE; + urlParams = urlParams + "=" + item.record.title; + + urlParams = urlParams + "&" + FieldName.ID; + urlParams = urlParams + "=" + item.record.nacsisId; + + urlParams = urlParams + "&" + FieldName.ISBN; + urlParams = urlParams + "=" + item.record.isbn; + + urlParams = urlParams + "&" + FieldName.ISSN; + urlParams = urlParams + "=" + item.record.issn; + + + + return urlParams; + } + + isSerial(nacsisID: string): boolean { + //true is default:Monographs, false is Serials + if (this.isEmpty(nacsisID)) { + return false; + } else { + if (nacsisID.substring(0, 2) === "AA" || nacsisID.substring(0, 2) === "AN") { + return true; + } else if (nacsisID.substring(0, 2) === "BA" || nacsisID.substring(0, 2) === "BB" || nacsisID.substring(0, 2) === "BN") { + return false; + } + } + return false; + } + + setBaseUrl(initData: InitData): string { + let baseUrl = super.setBaseUrl(initData); + baseUrl = baseUrl + "createIllRequest?"; + return baseUrl; + } + + createILLrequest(requestBody) { + let fullUrl: string; + let body = JSON.stringify(requestBody); + //body = body.substring(1); + //body = body.substring(0,body.length-1); + + let database = requestBody[0].database; + console.log(body); + return this.getInitData().pipe( + mergeMap(initData => { + fullUrl = this.setBaseUrl(initData) + "dataBase=" + database; + return this.getAuthToken() + }), + mergeMap(authToken => { + let headers = this.setAuthHeader(authToken); + return this.http.post(fullUrl, body, { headers }); + }) + ); + } + +} + + + +export class AlmaRecordInfo { + title: string = ""; + author: string = ""; + place_of_pub: string = ""; + name_of_pub: string = ""; + date_of_pub: string = ""; + language: string = ""; + nacsisId: string = ""; + isbn: string = ""; + issn: string = ""; + seriesSummaryAll: string = ""; +} + +export abstract class IDisplayLines { + + protected baseRecord: BaseRecordInfo; + + constructor(viewRecord: BaseRecordInfo) { + this.baseRecord = viewRecord; + } + + getDisplayTitle(): any { }; + initContentDisplay(): any { }; +} + +export abstract class BaseRecordInfo { + title: string = ""; + author: string = ""; + place_of_pub: string = ""; + name_of_pub: string = ""; + date_of_pub: string = ""; + language: string = ""; + nacsisId: string = ""; + isbn: string = ""; + issn: string = ""; + + seriesSummaryAll: string = ""; + summaryDisplay: IDisplayLines; + + constructor( + record: any, + protected translate: TranslateService + ) { + this.title = record.title; + this.author = record.author; + this.place_of_pub = record.place_of_pub; + this.name_of_pub = record.name_of_pub; + + this.date_of_pub = record.date_of_pub; + this.language = record.language; + this.nacsisId = record.nacsisId; + this.isbn = record.isbn; + this.issn = record.issn; + this.seriesSummaryAll = record.seriesSummaryAll; + } + + getTitle() { + return this.title; + } + + getAuthor() { + return this.author; + } + + getPlace_of_pub() { + return this.place_of_pub; + } + + getName_of_pub() { + return this.name_of_pub; + } + + + getDate_of_pub() { + return this.date_of_pub; + } + + getLanguage() { + return this.language; + } + + getNacsisId() { + return this.nacsisId; + } + + getIsbn() { + return this.isbn; + } + + getIssn() { + return this.issn; + } + + + getSeriesSummaryAll() { + return this.seriesSummaryAll; + } + + abstract getSummaryDisplay(): IDisplayLines; + +} + +export class AlmaRecordsResults { + + results: Array; + + constructor() { } + + getResults() { + return this.results; + } + + setResults(arr: Array) { + this.results = arr; + } +} + +export class AlmaRecord extends BaseRecordInfo { + + + summaryView: AlmaRecordInfo; + moduleType: string + + constructor( + record: any, + translate: TranslateService, + private illService: IllService, + ) { + super(record, translate); + } + getSummaryDisplay() { + return new AlmaRecordDisplay(this.translate, this, this.illService, this.moduleType); + } + +} + +export class AlmaRecordDisplay extends IDisplayLines { + record: AlmaRecordInfo; + type: string; + + constructor( + private translate: TranslateService, + fullRecordData: BaseRecordInfo, + private illService: IllService, + moduleType: string + ) { + super(fullRecordData); + this.record = fullRecordData; + this.type = moduleType; + } + + displayRadioButton() { + let str = 'block'; + if (this.type === 'holding' && this.illService.isEmpty(this.record.nacsisId)) + str = 'none'; + return { 'display': str }; + } + + getNacsisID(): string { + return this.record.nacsisId; + } + + getDisplayTitle(): string { + return this.record.title; + } + + initContentDisplay(): Array { + let summaryLines = new Array(); + let authorDisPlay = "", publicInfo = ""; + if (!this.illService.isEmpty(this.record.author)) { + authorDisPlay = this.translate.instant('ILL.DisplayCard.By') + " " + this.record.author; + } + + if (!this.illService.isEmpty(this.record.place_of_pub) || + !this.illService.isEmpty(this.record.place_of_pub) || !this.illService.isEmpty(this.record.date_of_pub)) { + publicInfo = " (" + this.record.place_of_pub + ": " + this.record.name_of_pub + ", " + this.record.date_of_pub + ")"; + } + + if (!this.illService.isEmpty(authorDisPlay) || !this.illService.isEmpty(publicInfo)) { + summaryLines.push(authorDisPlay + publicInfo); + } + + if (!this.illService.isEmpty(this.record.language)) + summaryLines.push(this.translate.instant("ILL.DisplayCard.Language") + ": " + this.record.language); + + if (!this.illService.isEmpty(this.record.isbn)) + summaryLines.push(this.translate.instant("ILL.DisplayCard.ISBN") + ": " + this.record.isbn ); + + if (!this.illService.isEmpty(this.record.issn)) + summaryLines.push(this.translate.instant("ILL.DisplayCard.ISSN") + ": " + this.record.issn); + + if (!this.illService.isEmpty(this.record.nacsisId)) + summaryLines.push(this.translate.instant("ILL.DisplayCard.NACSIS_ID") + ": " + this.record.nacsisId); + + if (!this.illService.isEmpty(this.record.seriesSummaryAll)) + summaryLines.push(this.record.seriesSummaryAll); + + + return summaryLines; + } + + +} + +export enum QueryParams { + PageIndex = "pageIndex", + PageSize = "pageSize", + SearchType = "searchType", + Databases = "dataBase", + ID = "ID" +} + +export class RequestFields { + database: string = ""; + ACCT: string = ""; + TYPE: string = ""; + SPVIA: string = ""; + ONO: string = ""; + PRMT: string = ""; + BIBG: Bibg; + VOL: string = ""; + PAGE: string = ""; + YEAR: string = ""; + ARTCL: string = ""; + HMLG: HMLG[]; + BVRFY: string = ""; + HVRFY: string = ""; + CLNT: string = ""; + CLNTP: string = ""; + ODATE: string = ""; + SENDCMNT: string = ""; + OSTAF: string = ""; + OADRS: string = ""; + OLDF: string = ""; + OLDAF: string = ""; + OEDA: string = ""; +} + +export class Bibg { + BIBID: string = ""; + BIBNT: string = ""; + STDNO: string = ""; +} + +export class HMLG { + HMLID: string = ""; + HMLNM: string = ""; + LOC: string = ""; + VOL: string = ""; + CLN: string = ""; + RGTN: string = ""; +} + + diff --git a/cloudapp/src/app/service/paginator.translate.ts b/cloudapp/src/app/service/paginator.translate.ts new file mode 100644 index 0000000..873c865 --- /dev/null +++ b/cloudapp/src/app/service/paginator.translate.ts @@ -0,0 +1,58 @@ +import { Injectable } from '@angular/core'; +import { MatPaginatorIntl } from '@angular/material/paginator'; +import { TranslateService } from "@ngx-translate/core"; + +const ITEMS_PER_PAGE = 'PagePaginator.itemsPerPageLabel'; +const NEXT_PAGE = 'PagePaginator.nextPageLabel'; +const PREV_PAGE = 'PagePaginator.previousPageLabel'; +const FIRST_PAGE = 'PagePaginator.firstPageLabel'; +const LAST_PAGE = 'PagePaginator.lastPageLabel'; + +@Injectable() +export class PaginatorIntlService extends MatPaginatorIntl{ + public constructor(private translate: TranslateService) { + super(); + + this.translate.onLangChange.subscribe((e: Event) => { + this.getAndInitTranslations(); + }); + + this.getAndInitTranslations(); + } + + public getRangeLabel = (page: number, pageSize: number, length: number): string => { + if (length === 0 || pageSize === 0) { + return `0 / ${length}`; + } + + length = Math.max(length, 0); + + const startIndex: number = page * pageSize; + const endIndex: number = startIndex < length + ? Math.min(startIndex + pageSize, length) + : startIndex + pageSize; + + return `${startIndex + 1} - ${endIndex} / ${length}`; + }; + + public getAndInitTranslations(): void { + this.translate.get([ + ITEMS_PER_PAGE, + NEXT_PAGE, + PREV_PAGE, + FIRST_PAGE, + LAST_PAGE, + ]) + .subscribe((translation: any) => { + this.itemsPerPageLabel = translation[ITEMS_PER_PAGE]; + this.nextPageLabel = translation[NEXT_PAGE]; + this.previousPageLabel = translation[PREV_PAGE]; + this.firstPageLabel = translation[FIRST_PAGE]; + this.lastPageLabel = translation[LAST_PAGE]; + + this.changes.next(); + }); + } +} + + diff --git a/cloudapp/src/app/user-controls/record-card/record-card.component.html b/cloudapp/src/app/user-controls/record-card/record-card.component.html new file mode 100644 index 0000000..a8dee66 --- /dev/null +++ b/cloudapp/src/app/user-controls/record-card/record-card.component.html @@ -0,0 +1,20 @@ + +
+ + +
+
+ +
+ {{recordIndex + 1}} +
+ {{record.getDisplayTitle()}} +
+ + + {{line}} + +
+
+ diff --git a/cloudapp/src/app/user-controls/record-card/record-card.component.scss b/cloudapp/src/app/user-controls/record-card/record-card.component.scss new file mode 100644 index 0000000..559ca99 --- /dev/null +++ b/cloudapp/src/app/user-controls/record-card/record-card.component.scss @@ -0,0 +1,23 @@ +.record-card{ + //display: flex; + //justify-content: space-between; + width: 100%; + background-color: whitesmoke !important; +} + +.record-card-index { + margin-right: 20px; +} + + .record-card-content { + margin: 0px; +} + +a, +a label { + cursor: pointer; +} + +.record-card-radio { + margin:auto 0 ; +} \ No newline at end of file diff --git a/cloudapp/src/app/user-controls/record-card/record-card.component.ts b/cloudapp/src/app/user-controls/record-card/record-card.component.ts new file mode 100644 index 0000000..42de44b --- /dev/null +++ b/cloudapp/src/app/user-controls/record-card/record-card.component.ts @@ -0,0 +1,38 @@ +import { Component, Input, Output, EventEmitter } from '@angular/core'; +import { IDisplayLines} from '../../service/ill.service'; + + +@Component({ + selector: 'record-card', + templateUrl: './record-card.component.html', + styleUrls: ['./record-card.component.scss'] + }) + +export class RecordCardComponent { + + @Input() recordIndex: number; + @Input() record: IDisplayLines; + @Output() onTitleSelected = new EventEmitter(); + @Output() onRadioSelected = new EventEmitter(); + + constructor() { } + + ngOnInit() {} + + + onRadioClick(item : IDisplayLines) { + this.onRadioSelected.emit(item); + } + +} + + +export class RecordSelection { + constructor ( + public recordIndex: number, + public actionIndex: number + ) { } +} + + + diff --git a/cloudapp/src/app/user-controls/records-list/records-list.component.html b/cloudapp/src/app/user-controls/records-list/records-list.component.html new file mode 100644 index 0000000..bf7892c --- /dev/null +++ b/cloudapp/src/app/user-controls/records-list/records-list.component.html @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/cloudapp/src/app/user-controls/records-list/records-list.component.scss b/cloudapp/src/app/user-controls/records-list/records-list.component.scss new file mode 100644 index 0000000..91b2b0d --- /dev/null +++ b/cloudapp/src/app/user-controls/records-list/records-list.component.scss @@ -0,0 +1,8 @@ +.record-list-item{ + padding-bottom: 15px !important; +} + +record-card{ + display: flex; + width: 100%; +} diff --git a/cloudapp/src/app/user-controls/records-list/records-list.component.ts b/cloudapp/src/app/user-controls/records-list/records-list.component.ts new file mode 100644 index 0000000..c1e0efa --- /dev/null +++ b/cloudapp/src/app/user-controls/records-list/records-list.component.ts @@ -0,0 +1,54 @@ +import { Component, Input, Output, EventEmitter ,ViewChild,OnChanges,AfterViewInit} from '@angular/core'; +import { PageEvent ,MatPaginator} from '@angular/material/paginator'; +import { IDisplayLines } from '../../service/ill.service'; +import { RecordSelection } from '../record-card/record-card.component'; + +@Component({ + selector: 'records-list', + templateUrl: './records-list.component.html', + styleUrls: ['./records-list.component.scss'] + }) + +export class RecordsListComponent implements OnChanges, AfterViewInit{ + + + @Input() pageIndex: number; + @Input() pageSize: number; + @Input() recordsSummaryDisplay: Array = new Array(); + @Output() onActionSelected = new EventEmitter(); + @Output() onTitleSelected = new EventEmitter(); + @Output() onRadioSelected = new EventEmitter(); + @Output() onPageSelected = new EventEmitter(); + + @ViewChild(MatPaginator) paginator: MatPaginator; + private recordIndex: number ; + + constructor() { } + + ngAfterViewInit() { + this.setPageVariables(); + } + + ngOnChanges() { + this.recordIndex = 0; + } + + onActionsClick(selection: RecordSelection) { + selection.recordIndex = selection.recordIndex - this.recordIndex; // Geting omly the for loop's index (i) + this.onActionSelected.emit(selection); + } + + setPageVariables() {} + + + onPageAction(pageEvent: PageEvent) { + this.onPageSelected.emit(pageEvent); + } + + onRadioClick(item : IDisplayLines) { + this.onRadioSelected.emit(item); + } + +} + + diff --git a/cloudapp/src/app/user-controls/result-card/result-card.component.html b/cloudapp/src/app/user-controls/result-card/result-card.component.html index 4a2696e..c48e544 100644 --- a/cloudapp/src/app/user-controls/result-card/result-card.component.html +++ b/cloudapp/src/app/user-controls/result-card/result-card.component.html @@ -32,7 +32,7 @@ - +
+ +
+ +
+
+
+ + \ No newline at end of file diff --git a/cloudapp/src/app/user-controls/selectable-result-card/selectable-result-card.component.scss b/cloudapp/src/app/user-controls/selectable-result-card/selectable-result-card.component.scss new file mode 100644 index 0000000..b656b83 --- /dev/null +++ b/cloudapp/src/app/user-controls/selectable-result-card/selectable-result-card.component.scss @@ -0,0 +1,73 @@ +@mixin flexText { + display: flex; +} + +@mixin filedPadding { + padding-right: 3px; +} + + +.result-card{ + @include flexText; + justify-content: space-between; + width: 100%; + background-color: whitesmoke !important; +} + +.card-title { + @include flexText; + font-weight: bold; + margin-left: 20px; +} + +.card-title-field { + @include flexText; +} + +.card-content-line { + @include flexText; + flex-wrap: wrap; +} + +.card-content-field { + @include flexText; +} + +.card-content-field-label { + font-weight: bold; + @include filedPadding; +} + +.card-content-field-content { + @include flexText; + @include filedPadding; +} + + +/* +.result-card-index { + margin-right: 20px; +} + +.result-card-text-content { + margin-bottom: 5px; +} + +.result-line-field { + padding-right: 8px; +} + +.label { + font-weight: bold; +} + +*/ + +.record-card-radio { + margin:auto 0 ; +} + +a, +a label { + cursor: pointer; +} diff --git a/cloudapp/src/app/user-controls/selectable-result-card/selectable-result-card.component.ts b/cloudapp/src/app/user-controls/selectable-result-card/selectable-result-card.component.ts new file mode 100644 index 0000000..2ddb76e --- /dev/null +++ b/cloudapp/src/app/user-controls/selectable-result-card/selectable-result-card.component.ts @@ -0,0 +1,54 @@ +import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; +import { PageEvent } from '@angular/material/paginator'; +import { IDisplayLines, ViewLine, ViewField } from '../../catalog/results-types/results-common'; +import { AlmaRecordDisplay} from '../../service/ill.service'; + +@Component({ + selector: 'selectable-result-card', + templateUrl: './selectable-result-card.component.html', + styleUrls: ['./selectable-result-card.component.scss'] + }) + +export class SelectableResultCardComponent implements OnInit { + + @Input() recordIndex: number; + @Input() record: IDisplayLines; + @Input() resultActionList: Array = new Array(); + @Output() onActionSelected = new EventEmitter(); + @Output() onTitleSelected = new EventEmitter(); + @Output() onRadioSelected = new EventEmitter(); + private titleDisplay: Array; + private contentDisplay: Array; + + + constructor() { } + + ngOnInit() { + this.titleDisplay = this.record.initTitleDisplay().getContent(); + this.contentDisplay = this.record.initContentDisplay(); + } + + onActionsClick(recordIndex: number, actionIndex: number) { + this.onActionSelected.emit(new RecordSelection(recordIndex, actionIndex)); + } + + onTitleClick(recordIndex: number) { + this.onTitleSelected.emit(recordIndex); + } + + onRadioClick(record: IDisplayLines) { + this.onRadioSelected.emit(record); + } + +} + + +export class RecordSelection { + constructor ( + public recordIndex: number, + public actionIndex: number + ) { } +} + + + diff --git a/cloudapp/src/app/user-controls/selectable-results-list/selectable-results-list.component.html b/cloudapp/src/app/user-controls/selectable-results-list/selectable-results-list.component.html new file mode 100644 index 0000000..edb0ea3 --- /dev/null +++ b/cloudapp/src/app/user-controls/selectable-results-list/selectable-results-list.component.html @@ -0,0 +1,16 @@ +

{{'Catalog.Results.Title' | translate}} ({{numOfResults}})

+ + + + + + + + \ No newline at end of file diff --git a/cloudapp/src/app/user-controls/selectable-results-list/selectable-results-list.component.scss b/cloudapp/src/app/user-controls/selectable-results-list/selectable-results-list.component.scss new file mode 100644 index 0000000..f86b59d --- /dev/null +++ b/cloudapp/src/app/user-controls/selectable-results-list/selectable-results-list.component.scss @@ -0,0 +1,8 @@ +.result-list-item{ + padding-bottom: 15px !important; +} + +selectable-result-card{ + display: flex; + width: 100%; +} diff --git a/cloudapp/src/app/user-controls/selectable-results-list/selectable-results-list.component.ts b/cloudapp/src/app/user-controls/selectable-results-list/selectable-results-list.component.ts new file mode 100644 index 0000000..5301319 --- /dev/null +++ b/cloudapp/src/app/user-controls/selectable-results-list/selectable-results-list.component.ts @@ -0,0 +1,70 @@ +import { Component, Input, Output, EventEmitter, ViewChild, AfterViewInit, OnChanges } from '@angular/core'; +import { PageEvent, MatPaginator } from '@angular/material/paginator'; +import { IDisplayLines, ViewLine, ViewField } from '../../catalog/results-types/results-common'; +import { RecordSelection } from '../selectable-result-card/selectable-result-card.component'; +import { AlmaRecordDisplay} from '../../service/ill.service'; + +@Component({ + selector: 'selectable-results-list', + templateUrl: './selectable-results-list.component.html', + styleUrls: ['./selectable-results-list.component.scss'] + }) + +export class SelectableResultsListComponent implements OnChanges, AfterViewInit { + + @Input() numOfResults: number; + @Input() pageIndex: number; + @Input() pageSize: number; + @Input() resultsSummaryDisplay: Array = new Array(); + @Input() resultActionList: Array = new Array(); + @Output() onActionSelected = new EventEmitter(); + @Output() onTitleSelected = new EventEmitter(); + @Output() onPageSelected = new EventEmitter(); + @Output() onRadioSelected = new EventEmitter(); + + @ViewChild(MatPaginator) paginator: MatPaginator; + private recordIndex: number; + + + constructor() { } + + ngAfterViewInit() { + this.setPageVariables(); + } + + ngOnChanges() { + if(this.paginator == undefined) { // For case that ngOnChanges() is called at initialization + this.recordIndex = 0; + } else{ + this.setPageVariables(); + } + } + + setPageVariables() { + this.paginator.pageIndex = this.pageIndex; + this.paginator.pageSize = this.pageSize; + this.recordIndex = this.pageIndex * this.pageSize; + } + + onActionsClick(selection: RecordSelection) { + selection.recordIndex = selection.recordIndex - this.recordIndex; // Geting omly the for loop's index (i) + this.onActionSelected.emit(selection); + } + + onTitleClick(recordIndex: number) { + recordIndex = recordIndex - this.recordIndex; // Geting omly the for loop's index (i) + this.onTitleSelected.emit(recordIndex); + } + + onPageAction(pageEvent: PageEvent) { + this.onPageSelected.emit(pageEvent); + } + + onRadioClick(item : IDisplayLines) { + this.onRadioSelected.emit(item); + } + + +} + + diff --git a/cloudapp/src/i18n/en.json b/cloudapp/src/i18n/en.json index 494c609..c6db3da 100644 --- a/cloudapp/src/i18n/en.json +++ b/cloudapp/src/i18n/en.json @@ -7,6 +7,8 @@ "OK": "OK", "Clear": "Clear", "Search": "Search", + "Next": "Next", + "Order": "Order", "Errors": { "generalError": "App general error" } @@ -71,7 +73,8 @@ "Intro": "Select a record to retrieve NACSIS holdings:", "NoRecords": "To view NACSIS holdings, navigate to a bibliographic record.", "SelectBib": "Select a title", - "RetrieveHoldings": "Retrieve NACSIS Holdings" + "RetrieveHoldings": "Retrieve NACSIS Holdings", + "SerachHoldings":"Search for NACSIS Holdings" }, "ViewHoldings": { "Owner": "Owner", @@ -88,6 +91,7 @@ "NoHoldingRecordsExist": "No holding records exist.", "DeleteYesButton": "Yes, delete it", "DeleteNoButton": "No, keep it", + "NacsisID":"NACSIS ID", "Errors": { "NoNoldings": "No holdings record were found", "GetFailed": "Get holdings failed", @@ -127,7 +131,244 @@ } } }, - + "ILL": { + "Main": { + "Intro": "Select a record to create ILL borrowing request:", + "NoRecords": "To create ILL borrowing request, navigate to a borrowing request list, bibliographic record or start a new search.", + "SelectBib": "Select a title", + "NewSearchInNACSIS": "New search", + "CreateILLSuccess":"Create ILL request successfully.Request ID is:" + }, + "DisplayCard": { + "By":"By", + "Title":"Title", + "Language":"Language", + "ISBN":"ISBN", + "ISSN":"ISSN", + "Others":"and others", + "NACSIS_ID":"NACSIS ID" + }, + "Results": { + "Title": "Records", + "NoRecordsExist": "No records exist.", + "By": "By", + "Book": "Book", + "NACSISID": "NACSIS ID", + "ISBN": "ISBN", + "ISSN": "ISSN", + "Subjects": "Subjects", + "Actions" : { + "ViewHolding" : "View holding", + "ViewMemInfo" : "View member info" + }, + "SelectedLenders":"Selected Lenders", + "RowSelected":"row(s) selected", + "ClearSelection":"Clear Selection", + "MaxRowSelected":"Max row selected" + }, + "HoldingSearch":{ + "ParticipatingOrgCode":"Participating organization code", + "Volume":"Volume", + "Year":"Year", + "Location":"Location", + "RegionCode":"Region(prefeture) code", + "EstablisherType":"Establisher type", + "InstitutionType":"Institution type", + "ILLParticipationType":"ILL participation type", + "ServiceStatus":"Service status", + "OffsetCharge":"Offset charge", + "CopyServiceType":"Copy service type", + "LendingServiceType":"Lending service type", + "FAXServiceType":"FAX service type" + }, + "HoldingSearchResult":{ + "INDEX":"ID", + "CHECKBOX":"check", + "NAME":"Name", + "VOL":"VOL", + "HLV":"HLV", + "HLYR":"HLYR", + "BID":"Bibliographic ID", + "COPYS":"Photocopy", + "CRTDT":"Create date", + "FANO":"Member ID", + "FAXS":"FAXS", + "GRPCODE":"Offset charge", + "ILLFLG":"ILL", + "KENCODE":"Region", + "LIBABL":"Name", + "LOC":"Location", + "LOANS":"LOANS", + "ORGCODE":"Institution type", + "RNWDT":"Update date", + "SETCODE":"Establisher", + "STAT":"STAT", + "type":"Type", + "SUM":"Photocopy fee", + "Volume":"Volume", + "RGNT":"RGNT", + "LDF":"LDF", + "CLN":"CLN", + "CallNumber":"Call Number", + "RegistrationNumber":"Registration Number", + "Lender":"Lender" + }, + "RequestForm":{ + "ResourceInformation":"Resource Information", + "Rota":"Rota", + "RequesterInformation":"Requester Information", + "RequestType":"Request Type", + "PayClass":"Payment classification", + "CopyType":"Copy type", + "SendingMethod":"Sending Method", + "ExternalRequestID":"External request ID", + "DefermentPermitNumber":"Deferment permit number", + "NACSISBibliographicID":"NACSIS Bibliographic ID", + "StandardNumber":"Standard number", + "Volume":"Volume", + "Page":"Page", + "Year":"Year", + "BibliographicMetadata":"Bibliographic metadata", + "TreatiseRelatedMatters":"Treatise-related matters", + "FANO":"Member ID", + "NAME":"Name", + "BibliographicAuthority":"Bibliographic authority", + "CollectionAuthority":"Collection authority", + "ApplicantName":"Applicant name", + "ApplicantAffiliation":"Applicant affiliation", + "DateNeededBy":"Date Needed By", + "Comments":"Comments", + "RequesterStaff":"Requester staff", + "RequesterAddress":"Requester address", + "LocalData":"Local data", + "LocalAccountingData":"Local accounting data", + "ElectronicShippingAddress":"Electronic shipping address" + }, + "MemberInfo":{ + "MemberID":"Member ID:", + "CreateDate":"Create date:", + "UpdateDate":"Update date:", + "ParticipatingOrganizationName":"Participating organization name", + "ParticipatingOrganizationAbbreviation":"Participating organization abbreviation", + "Address":"Address", + "PostalCode":"Postal Code:", + "StreetAddress":"Street Address:", + "ILLDepartment":"ILL department", + "ILLPersonInCharge":"ILL person in charge", + "PhoneNumber":"Phone number", + "Ext":"Ext.", + "Fax":"Fax", + "EstablisherType":"Establisher Type", + "InstitutionType":"Institution type", + "CATParticipationType":"CAT participation type", + "ILLParticipationType":"ILL participation type", + "CopyServiceType":"Copy service type", + "LendingServiceType":"Lending service type", + "FAXServiceType":"FAX service type", + "ServiceStatus":"Service status", + "CopyReceptionHallCode":"Copy reception hall code", + "RentalAndBorrowingCenterCode":"Rental and borrowing center code", + "LendingPeriod":"Lending period", + "RegionPrefectureCode":"Region (prefecture) code", + "CatalogingDepartment":"Cataloging department", + "CatPhoneNumFirst":"Phone num. (Ext.)", + "CatPhoneNum":"Phone num.:", + "CatFax":"Fax", + "SystemDepartment":"System department", + "SystemPhoneNum":"Phone num.", + "SystemFax":"Fax", + "Email":"Email", + "ILLPolicy":"ILL policy", + "LocationCode":"Location code", + "OffsetCode":"Offset code" + }, + "OptionViewValue": { + "SETCODE" : { + "National" : "National", + "Public" : "Public", + "Private" : "Private", + "SpecialPublicCorporation" : "Special public corporation", + "Overseas" : "Overseas", + "TrainingTesting" : "Training/testing", + "Other":"Other" + }, + "ORGCODE" : { + "University" : "University", + "JuniorCollege" : "Junior college", + "CollegeOfTechnology" : "College of technology", + "InterResearchInstitutes" : "Inter-university research institutes", + "FacilitiesOfOtherMinistries" : "Facilities of other ministries", + "TrainingTesting" : "Training/testing", + "Other":"Other" + }, + "GRPCODE" : { + "None":"", + "ParticipateILLOffsetService" : "Participate in ILL offset service" + }, + "ILLFLG" : { + "None":"", + "Participate" : "Participate", + "DoNotParticipate" : "Do not participate" + }, + "STAT" : { + "None":"", + "Available" : "Available", + "NotAvailable" : "Not available" + }, + "COPYS" : { + "Accept" : "Accept", + "AcceptAtOtherCounters" : "Accept at other counters", + "NotAccepted":"Not accepted" + }, + "LOANS" : { + "Accept" : "Accept", + "AcceptAtOtherCounters" : "Accept at other counters", + "NotAccepted":"Not accepted" + }, + "FAXS" : { + "Available" : "Available", + "ConditionallyAvailable" : "Conditionally available", + "NotAvailable":"Not available" + }, + "requestTypeList" : { + "Copy" : "Copy", + "Loan" : "Loan" + }, + "payClassList" : { + "ResearchExpenses" : "Research expenses", + "UniversityHospital" : "University hospital", + "NationalSchool" : "National school", + "PrivateExpense" : "Private expense", + "Laboratory" : "Laboratory" + }, + "copyTypeList" : { + "ElectronicCopy" : "Electronic copy", + "FAX" : "FAX", + "eDDS" : "eDDS", + "Stretch" : "Stretch", + "Microfitsyu" : "Microfitsyu", + "Microfilm" : "Microfilm", + "ReaderPrinter" : "Reader printer", + "Slide" : "Slide", + "CopyOrder" : "Copy order" + }, + "sendingMethodList" : { + "Regular" : "Regular", + "Express" : "Express", + "DDS" : "DDS", + "FAX" : "FAX", + "RegisteredMail" : "Registered mail", + "RegularMail" : "Regular mail", + "Mail" : "Mail", + "eDDS" : "eDDS" + } + }, + "Errors": { + "warningSelectValue":"Please choose an option", + "warningInputValue":"Please input a value" + } + }, + "Config": { "Title": "Configuration", "Success": "Configuration successfully saved.", @@ -136,6 +377,14 @@ } }, + "PagePaginator": { + "itemsPerPageLabel": "Items per page:", + "firstPageLabel": "first page", + "nextPageLabel": "next page", + "previousPageLabel": "previous page", + "lastPageLabel": "last page" + }, + "Help": { "Text": "This app is supported by Ex Libris. To view the documentation, click the link below. For additional help or to report a problem, please open a SalesForce case.", "OLH": "To the online help" @@ -169,5 +418,4 @@ "SAID": "SAID" } } - } \ No newline at end of file diff --git a/cloudapp/src/i18n/jp.json b/cloudapp/src/i18n/jp.json index 629c385..96a010d 100644 --- a/cloudapp/src/i18n/jp.json +++ b/cloudapp/src/i18n/jp.json @@ -1,77 +1,80 @@ { "General": { "Back": "戻る", - "BackToMenu": "???Back to menu", + "BackToMenu": "メニューに戻る", "Cancel": "キャンセル", "Save": "保存", "OK": "OK", - "Clear": "???Clear", - "Search": "???Search", + "Clear": "クリア", + "Search": "検索", + "Next": "Next", + "Order": "Order", "Errors": { "generalError": "アプリケーションエラー" } }, "MainMenu": { - "Intro": "???This app includes all functionalities within NACSIS-CAT/ILL", + "Intro": "このアップはNACSIS-CAT/ILLの対象機能をすべて提供します", "Holdings": { - "Title": "タイトル", - "Text": "??? NACSIS holding ???" + "Title": "所蔵", + "Text": "NACSIS所蔵レコードを管理する" }, "Catalog": { - "Title": "Copy Catalog12 345 ???", - "Text": "??? Search and Copy cataloging ???" + "Title": "目録", + "Text": "NACSISの書誌・典拠レコードを検索・ダウウンロードする" }, "ILL": { - "Title": "ILL Borrowing ??? Requests", - "Text": "NACSIS borrowing request creation???" + "Title": "ILL依頼", + "Text": "新規ILL依頼を作成する" }, "Members": { - "Title": "Members??", - "Text": "NACSIS members information management???" + "Title": "参加組織", + "Text": "NACSISの参加組織情報を管理する" } }, "Catalog": { "Form": { - "MainTitle": "Search records ???", - "RefineSearch": "Refine Search???", - "SelectSearchType": "Select search ???", - "SelectDatabase": "Select a ???", - "EmptyForm": "The search form is empty. ???", + "MainTitle": "NACSIS総合目録データベースでレコード検索する", + "RefineSearch": "検索条件を絞り込む", + "SelectSearchType": "レコード種別を選択する", + "SelectDatabase": "ファイルを選択する", + "EmptyForm": "検索フォームが空です。条件を入力してください", "SearchTypes": { - "Monographs": "Monographs???", - "Serials": "Serials???", - "Names": "Names???", - "UniformTitles": "Uniform Titles???" + "Monographs": "図書書誌", + "Serials": "雑誌書誌", + "Names": "著者名典拠", + "UniformTitles": "統一書名典拠" } }, "Results": { - "Title": "???Records", - "NoRecordsExist": "???No records exist.", - "By": "???By", - "Book": "???(Book", - "Journal": "???(Journal", - "NACSISID": "???NACSIS ID:", - "ISBN": "???ISBN:", - "ISSN": "???ISSN:", - "Subjects": "???Subjects:", - "AndOthers": "???and others", + "Title": "レコード件数", + "NoRecordsExist": "レコードがありません", + "By": "", + "Book": "(図書", + "Journal": "(雑誌", + "NACSISID": "NACSIS ID:", + "ISBN": "ISBN:", + "ISSN": "ISSN:", + "Subjects": "件名:", + "AndOthers": "その他", "Actions" : { - "View" : "???View", - "Import" : "???Import", - "ViewHoldings" : "???View Holdings" + "View" : "プレビュー", + "Import" : "ダウウンロード", + "ViewHoldings" : "所蔵を確認する" }, - "ImportSucceeded": "The record was successfully imported ???" + "ImportSucceeded": "レコードがダウウンロードされました" } }, "Holdings": { "Main": { - "Intro": "NACSISから所蔵を取得するための書誌レコードを選択してください:", + "Intro": "NACSISから所蔵を取得するための書誌レコードを選択してください:", "NoRecords": "NACSISの所蔵を閲覧表示するため、該当の書誌レコードに移動します。", "SelectBib": "書誌レコードの選択", - "RetrieveHoldings": "所蔵の検索" + "RetrieveHoldings": "所蔵の検索", + "SerachHoldings":"Search for NACSIS Holdings" }, "ViewHoldings": { "Owner": "所蔵館", @@ -81,17 +84,19 @@ "Title": "タイトル", "Library": "図書館", "Location": "配置場所", - "ConfirmDelete": "このレコードを本当に削除しますか?", - "DeleteTitle": "???Delete Holding record", + "ConfirmDelete": "このレコードを本当に削除しますか", + "DeleteTitle": "所蔵レコードを削除する", "Deleted": "レコードが削除されました.", "Add": "所蔵レコードの追加", "NoHoldingRecordsExist": "所蔵レコードがありません。", - "DeleteYesButton": "???Yes, delete it", - "DeleteNoButton": "???No, keep it", + "DeleteYesButton": "削除する", + "DeleteNoButton": "削除しない", + "NacsisID":"NACSIS ID", "Errors": { "NoNoldings": "所蔵レコードが見つかりません。", "GetFailed": "所蔵レコードの取得ができませんでした。", - "DeleteFailed": "所蔵レコードの削除ができませんでした。" + "DeleteFailed": "所蔵レコードの削除ができませんでした。", + "Uneditable": "This holding is not a member of +++ therefore can't be edit" } }, "Form": { @@ -126,6 +131,243 @@ } } }, + "ILL": { + "Main": { + "Intro": "依頼するレコードを選択してください:", + "NoRecords": "新規ILL依頼を作成するために、依頼一覧や書誌レコードを開いて、または検索してください.", + "SelectBib": "タイトルを選択してください", + "NewSearchInNACSIS": "新しい検索", + "CreateILLSuccess":"ILL依頼が作成されました。依頼番号:" + }, + "DisplayCard": { + "By":"By", + "Title":"タイトル", + "Language":"Language", + "ISBN":"ISBN", + "ISSN":"ISSN", + "Others":"その他", + "NACSIS_ID":"NACSIS ID" + }, + "Results": { + "Title": "レコード件数", + "NoRecordsExist": "レコードがありません", + "By": "By", + "Book": "Book", + "NACSISID": "NACSIS ID", + "ISBN": "ISBN", + "ISSN": "ISSN", + "Subjects": "Subjects", + "Actions" : { + "ViewHolding" : "所蔵を見る", + "ViewMemInfo" : "参加組織の詳細を見る" + }, + "SelectedLenders":"選択された受付館", + "RowSelected":"行が選択されました", + "ClearSelection":"クリア", + "MaxRowSelected":"最大数に達しています" + }, + "HoldingSearch":{ + "ParticipatingOrgCode":"参加組織コード", + "Volume":"巻冊次等", + "Year":"Year", + "Location":"配置コード", + "RegionCode":"地域(県)コード", + "EstablisherType":"設置者種別", + "InstitutionType":"機関種別", + "ILLParticipationType":"ILL参加種別", + "ServiceStatus":"サービスステータス", + "OffsetCharge":"料金相殺グループ", + "CopyServiceType":"複写サービス種別", + "LendingServiceType":"貸借サービス種別", + "FAXServiceType":"FAXサービス種別" + }, + "HoldingSearchResult":{ + "INDEX":"ID", + "CHECKBOX":"check", + "NAME":"Name", + "VOL":"VOL", + "HLV":"HLV", + "HLYR":"HLYR", + "BID":"BID", + "COPYS":"Photocopy", + "CRTDT":"Create date", + "FANO":"Member ID", + "FAXS":"FAXS", + "GRPCODE":"Offset charge", + "ILLFLG":"ILL", + "KENCODE":"Region", + "LIBABL":"Name", + "LOC":"LOC", + "LOANS":"LOANS", + "ORGCODE":"Institution type", + "RNWDT":"Update date", + "SETCODE":"Establisher", + "STAT":"STAT", + "type":"Type", + "SUM":"Photocopy fee", + "Volume":"VOL", + "RGNT":"RGNT", + "LDF":"LDF", + "CLN":"CLN", + "CallNumber":"CLN", + "RegistrationNumber":"RGTN", + "Lender":"Lender" + }, + "RequestForm":{ + "ResourceInformation":"リソース情報", + "Rota":"ロタ", + "RequesterInformation":"リクエスター情報", + "RequestType":"依頼種別", + "PayClass":"支払区分", + "CopyType":"複写種別", + "SendingMethod":"送付方法", + "ExternalRequestID":"依頼番号", + "DefermentPermitNumber":"徴収猶予許可番号", + "NACSISBibliographicID":"NC書誌ID", + "StandardNumber":"標準番号", + "Volume":"巻冊次等", + "Page":"Page", + "Year":"Year", + "BibliographicMetadata":"書誌事項", + "TreatiseRelatedMatters":"論文関係事項", + "FANO":"所蔵館コード", + "NAME":"所蔵館略称", + "BibliographicAuthority":"書誌典拠", + "CollectionAuthority":"所蔵典拠", + "ApplicantName":"申込者氏名", + "ApplicantAffiliation":"申込者所属", + "DateNeededBy":"依頼日", + "Comments":"コメント", + "RequesterStaff":"依頼館担当者", + "RequesterAddress":"依頼館宛名", + "LocalData":"ローカルデータ", + "LocalAccountingData":"ローカル会計データ", + "ElectronicShippingAddress":"電子的配送先アドレス" + }, + "MemberInfo":{ + "MemberID":"Member ID:", + "CreateDate":"Create date:", + "UpdateDate":"Update date:", + "ParticipatingOrganizationName":"参加組織名称", + "ParticipatingOrganizationAbbreviation":"参加組織略称", + "Address":"住所", + "PostalCode":"郵便番号:", + "StreetAddress":"住所:", + "ILLDepartment":"ILL担当部局", + "ILLPersonInCharge":"ILL担当者", + "PhoneNumber":"電話番号", + "Ext":"内線.", + "Fax":"FAX番号", + "EstablisherType":"設置者種別", + "InstitutionType":"機関種別", + "CATParticipationType":"CAT参加種別", + "ILLParticipationType":"ILL参加種別", + "CopyServiceType":"複写サービス種別", + "LendingServiceType":"貸借サービス種別", + "FAXServiceType":"FAXサービス種別", + "ServiceStatus":"サービスステータス", + "CopyReceptionHallCode":"複写受理館コード", + "RentalAndBorrowingCenterCode":"貸借受理館コード", + "LendingPeriod":"貸借期間", + "RegionPrefectureCode":"地域(県)コード", + "CatalogingDepartment":"目録担当部局名", + "CatPhoneNumFirst":"目録担当電話番号(内線)", + "CatPhoneNum":"目録担当電話番号.:", + "CatFax":"目録担当FAX番号", + "SystemDepartment":"システム担当部局", + "SystemPhoneNum":"システム担当部局電話番号", + "SystemFax":"システム担当部局FAX番号", + "Email":"E-mailアドレス", + "ILLPolicy":"レンディングポリシー", + "LocationCode":"配置コード", + "OffsetCode":"料金相殺グループ" + }, + "OptionViewValue": { + "SETCODE" : { + "National" : "国立", + "Public" : "公立", + "Private" : "私立", + "SpecialPublicCorporation" : "特殊法人", + "Overseas" : "海外", + "TrainingTesting" : "研修・テスト用", + "Other":"その他" + }, + "ORGCODE" : { + "University" : "大学", + "JuniorCollege" : "短期大学", + "CollegeOfTechnology" : "高等専門学校", + "InterResearchInstitutes" : "大学共同利用機関等", + "FacilitiesOfOtherMinistries" : "他省庁の施設機関等", + "TrainingTesting" : "研修・テスト用", + "Other":"その他" + }, + "GRPCODE" : { + "None":"", + "ParticipateILLOffsetService" : "相殺" + }, + "ILLFLG" : { + "None":"", + "Participate" : "参加", + "DoNotParticipate" : "未参加" + }, + "STAT" : { + "None":"", + "Available" : "サービス可", + "NotAvailable" : "サービス不可" + }, + "COPYS" : { + "Accept" : "受け付ける", + "AcceptAtOtherCounters" : "他の窓口で受け付ける", + "NotAccepted":"受け付けない" + }, + "LOANS" : { + "Accept" : "受け付ける", + "AcceptAtOtherCounters" : "他の窓口で受け付ける", + "NotAccepted":"受け付けない" + }, + "FAXS" : { + "Available" : "サービス可", + "ConditionallyAvailable" : "条件付でサービス可", + "NotAvailable":"サービス不可" + }, + "requestTypeList" : { + "Copy" : "複写", + "Loan" : "貸出" + }, + "payClassList" : { + "ResearchExpenses" : "産学連携等研究費", + "UniversityHospital" : "大学附属病院", + "NationalSchool" : "国立学校", + "PrivateExpense" : "私費", + "Laboratory" : "研究所" + }, + "copyTypeList" : { + "ElectronicCopy" : "電子複写", + "FAX" : "FAX", + "eDDS" : "eDDS", + "Stretch" : "引き伸ばし", + "Microfitsyu" : "マイクロフイツシユ", + "Microfilm" : "マイクロフイルム", + "ReaderPrinter" : "リーダプリンタ", + "Slide" : "スライド", + "CopyOrder" : "複写取寄" + }, + "sendingMethodList" : { + "Regular" : "普通", + "Express" : "速達", + "DDS" : "DDS", + "FAX" : "FAX", + "RegisteredMail" : "書留", + "RegularMail" : "普通郵便", + "Mail" : "郵送", + "eDDS" : "eDDS" + } + }, + "Errors": { + "warningSelectValue":"値を選択してください", + "warningInputValue":"値を入力してください" + } + }, "Config": { "Title": "設定", @@ -135,6 +377,14 @@ } }, + "PagePaginator": { + "itemsPerPageLabel": "表示行数:", + "firstPageLabel": "最初のページ", + "nextPageLabel": "次のページ", + "previousPageLabel": "前のページ", + "lastPageLabel": "最終のページ" + }, + "Help": { "Text": "このアプリはEx Librisでサポートされています。 ドキュメントを表示するには、下のリンクをクリックしてください。 さらにヘルプが必要な場合や問題を報告するには、SalesForceケースを開いてください。", "OLH": "オンラインヘルプへ" @@ -142,16 +392,15 @@ "UserControls": { "Fields": { - "TITLE": "TITLE???", - "FTITLE": "FTITLE???", - "PTBL": "PTBL???", - "VOL": "VOL???", - "TiPtVo": "TITLE / PTBL / VOL???", - "AUTH": "AUTH???", + "TITLE": "TITLE", + "FTITLE": "FTITLE", + "PTBL": "PTBL", + "VOL": "VOL", + "AUTH": "AUTH", "ISSN": "ISSN", "ISBN": "ISBN", "NBN": "NBN", - "NDLCN": "NDLCN / LCCN / OTHN", + "NDLCN": "NDLCN", "PUB": "PUB", "YEAR": "YEAR", "PLACE": "PLACE", @@ -162,8 +411,11 @@ "ID": "ID", "PID": "PID", "CODEN": "CODEN", - "NDLPN": "NDLPN / LCCN", - "FID": "FID" + "NDLPN": "NDLPN", + "LCCN": "LCCN", + "FID": "FID", + "DATE": "DATE", + "SAID": "SAID" } } } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 3a848a8..f957adc 100644 --- a/manifest.json +++ b/manifest.json @@ -13,7 +13,7 @@ "subtitle": [ { "lang": "jp", - "text": "Integrate with the NACSIS central catalog and ILL system" + "text": "NACSIS総合目録データベース・相互貸借サービスとの統合" }, { "lang": "en", @@ -24,7 +24,7 @@ "description": [ { "lang": "jp", - "text": "This app is used for integrating Alma with the NACSIS central catalog. The app support the followings: Manage holding records from the NACSIS-CAT for a given Bibliographic record in Alma. Copy cataloging of NACSIS-CAT Bibliographic and Authority records to Alma. Contribution of new or edited Bibliographic and Authority records to NACSIS-CAT. This app is supported by Ex Libris. Currently available for beta testing." + "text": "このアップは、AlmaをNACSIS総合目録データベースと統合する-ために使用できます。次の機能を提供します:Almaのローカル書誌レコードに関連するNACSIS-CAT所蔵レコードを管理する、NACSIS-CATの書誌・典拠レコードをローカルにダウウンロードする、作成・更新されたローカルレコードをNACSIS-CATにアップロードする。このアップは、Ex Librisサポートに対象内になります。現在、ベータテストの目標で提供されています。" }, { "lang": "en", diff --git a/package-lock.json b/package-lock.json index ecd257c..928fe2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1598,6 +1598,32 @@ "typescript": "3.8.3", "uuid": "8.0.0", "zone.js": "0.10.3" + }, + "dependencies": { + "@angular/animations": { + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-9.1.6.tgz", + "integrity": "sha512-7Pp7aqNNcH4fu1BnOVpvqJJHjE7RZ5K1oD396OWCh35pgpLowLSpFjhbVhzGrcAuxHyKnnHSX3etLn2hDaHxmQ==" + }, + "@angular/cdk": { + "version": "9.2.3", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-9.2.3.tgz", + "integrity": "sha512-tQr/yt8GNGsZ/DTT+PMq7XdRmL56hwVCyf8F12JQAawutSLfTfMb+S1lpN7L/0Pb/L5JBuCfG2HmXK7vHo02gw==", + "requires": { + "parse5": "^5.0.0" + } + }, + "@angular/material": { + "version": "9.2.3", + "resolved": "https://registry.npmjs.org/@angular/material/-/material-9.2.3.tgz", + "integrity": "sha512-QJltLNp8a/eoozPgkFLISEWgdlX9q9+fZaLJ8c9tHEp2IT5sFYBFHf8dPl0pUyxgOXkS/0HD43I1qki71/T7Kw==" + }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "optional": true + } } }, "@istanbuljs/schema": { diff --git a/package.json b/package.json index 1999f5a..4160bb6 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,10 @@ "start": "eca start" }, "dependencies": { + "@angular/animations": "^9.1.6", + "@angular/cdk": "^9.2.3", "@angular/flex-layout": "^10.0.0-beta.32", + "@angular/material": "^9.2.3", "@exlibris/exl-cloudapp-angular-lib": "^1.0.1", "@exlibris/exl-cloudapp-base": "^1.0.1", "font-awesome": "^4.7.0",