diff --git a/smp-angular/src/app/common/search-table/search-table.component.html b/smp-angular/src/app/common/search-table/search-table.component.html index 586c92d89be9e25bab8b97fc9fd15a7069d5dd57..0bb3c6baa10d281b49cf74050afc05b27b8c1d21 100644 --- a/smp-angular/src/app/common/search-table/search-table.component.html +++ b/smp-angular/src/app/common/search-table/search-table.component.html @@ -77,9 +77,10 @@ href="javascript:void(0)" title="Expand/Collapse Row" - (click)="toggleExpandRow(row)"> <mat-icon class="mat-icon-rtl-mirror"> - {{expanded ? 'expand_more' : 'chevron_right'}} - </mat-icon> + (click)="toggleExpandRow(row)"> + <mat-icon class="mat-icon-rtl-mirror"> + {{expanded ? 'expand_more' : 'chevron_right'}} + </mat-icon> </a> </ng-template> @@ -99,40 +100,43 @@ </div> </ng-template> - <div fxFlex="50px" *ngIf=showActionButtons> - <ng-container> - <button id="cancelButton" mat-raised-button (click)="onCancelButtonClicked()" color="primary" - [disabled]="!submitButtonsEnabled"> - <mat-icon>cancel</mat-icon> - <span>Cancel</span> - </button> - <button id="saveButton" mat-raised-button (click)="onSaveButtonClicked(false)" color="primary" - [disabled]="!submitButtonsEnabled"> - <mat-icon>save</mat-icon> - <span>Save</span> - </button> + <mat-toolbar fxFlex="50px" *ngIf=showActionButtons class="mat-elevation-z2" style="flex-grow: 0"> + <mat-toolbar-row class="smp-toolbar-row"> + <ng-container> - <tool-button-spacer *ngIf="allowNewItems || allowEditItems || allowDeleteItems"></tool-button-spacer> + <button id="cancelButton" mat-raised-button (click)="onCancelButtonClicked()" color="primary" + [disabled]="!submitButtonsEnabled"> + <mat-icon>cancel</mat-icon> + <span>Cancel</span> + </button> + <button id="saveButton" mat-raised-button (click)="onSaveButtonClicked(false)" color="primary" + [disabled]="!submitButtonsEnabled"> + <mat-icon>save</mat-icon> + <span>Save</span> + </button> - <!-- new button enabled --> - <button *ngIf="allowNewItems" id="newButton" mat-raised-button (click)="onNewButtonClicked()" - [disabled]="loading || !allowNewItems" color="primary"> - <mat-icon>add</mat-icon> - <span>New</span> - </button> - <button *ngIf="allowEditItems" id="editButton" mat-raised-button (click)="onEditButtonClicked()" - [disabled]="!editButtonEnabled || loading" color="primary"> - <mat-icon>edit</mat-icon> - <span>Edit</span> - </button> - <button *ngIf="allowDeleteItems" id="deleteButton" mat-raised-button (click)="onDeleteButtonClicked()" - [disabled]="!deleteButtonEnabled || loading || !allowDeleteItems" color="primary"> - <mat-icon>delete</mat-icon> - <span>Delete</span> - </button> - </ng-container> - <ng-container *ngTemplateOutlet="additionalToolButtons"></ng-container> - </div> + <tool-button-spacer *ngIf="allowNewItems || allowEditItems || allowDeleteItems"></tool-button-spacer> + + <!-- new button enabled --> + <button *ngIf="allowNewItems" id="newButton" mat-raised-button (click)="onNewButtonClicked()" + [disabled]="loading || !allowNewItems" color="primary"> + <mat-icon>add</mat-icon> + <span>New</span> + </button> + <button *ngIf="allowEditItems" id="editButton" mat-raised-button (click)="onEditButtonClicked()" + [disabled]="!editButtonEnabled || loading" color="primary"> + <mat-icon>edit</mat-icon> + <span>Edit</span> + </button> + <button *ngIf="allowDeleteItems" id="deleteButton" mat-raised-button (click)="onDeleteButtonClicked()" + [disabled]="!deleteButtonEnabled || loading || !allowDeleteItems" color="primary"> + <mat-icon>delete</mat-icon> + <span>Delete</span> + </button> + </ng-container> + <ng-container *ngTemplateOutlet="additionalToolButtons"></ng-container> + </mat-toolbar-row> + </mat-toolbar> </form> </div> diff --git a/smp-angular/src/app/edit/edit-domain/edit-domain.component.html b/smp-angular/src/app/edit/edit-domain/edit-domain.component.html index 243575a764f733a8356fad521a4632fd9f79cfbc..de417683bb4d257219a44140be9b34ddc07a60e6 100644 --- a/smp-angular/src/app/edit/edit-domain/edit-domain.component.html +++ b/smp-angular/src/app/edit/edit-domain/edit-domain.component.html @@ -63,7 +63,7 @@ </tr> </table> - <mat-paginator class="mat-elevation-z2" id="extension-paginator" + <mat-paginator class="mat-elevation-z2" id="domain-paginator" [hidePageSize]="true" [showFirstLastButtons]="true" [pageSize]="5" aria-label="Select page"></mat-paginator> diff --git a/smp-angular/src/app/edit/edit-resources/edit-resource.component.html b/smp-angular/src/app/edit/edit-resources/edit-resource.component.html index c7724e3ac7133a922803c72d925ecc2e46e7bca0..859b061040c643f89cbdd3dbf6519a2b766624c6 100644 --- a/smp-angular/src/app/edit/edit-resources/edit-resource.component.html +++ b/smp-angular/src/app/edit/edit-resources/edit-resource.component.html @@ -133,9 +133,9 @@ <mat-paginator class="mat-elevation-z2" [length]="resultsLength" (page)="onPageChanged($event)" - [pageSize]="5" - [pageSizeOptions]="[5, 10, 25]" - [disabled]="disabledForm" + [hidePageSize]="true" + [showFirstLastButtons]="true" + [pageSize]="10" aria-label="Select pages"></mat-paginator> </div> </div> diff --git a/smp-angular/src/app/edit/edit-resources/edit-resource.component.ts b/smp-angular/src/app/edit/edit-resources/edit-resource.component.ts index b24953714a2925c81dbf8e046af380b0b9ab9153..cf2cb3eca1d0bcb5d307209f448b6838dabd3fb8 100644 --- a/smp-angular/src/app/edit/edit-resources/edit-resource.component.ts +++ b/smp-angular/src/app/edit/edit-resources/edit-resource.component.ts @@ -1,6 +1,6 @@ import {AfterViewInit, Component, Input, ViewChild} from '@angular/core'; import {BeforeLeaveGuard} from "../../window/sidenav/navigation-on-leave-guard"; -import {MatPaginator} from "@angular/material/paginator"; +import {MatPaginator, PageEvent} from "@angular/material/paginator"; import {AlertMessageService} from "../../common/alert-message/alert-message.service"; import {EditDomainService} from "../edit-domain/edit-domain.service"; import {DomainRo} from "../../common/model/domain-ro.model"; @@ -174,4 +174,12 @@ export class EditResourceComponent implements AfterViewInit, BeforeLeaveGuard { return false; } + onPageChanged(page: PageEvent) { + this.refreshResources(); + } + + get disabledResourcePagination(): boolean { + return !this._selectedGroup; + } + } diff --git a/smp-angular/src/app/edit/edit-resources/resource-document-panel/resource-document-panel.component.html b/smp-angular/src/app/edit/edit-resources/resource-document-panel/resource-document-panel.component.html index 909c2ae65052d3c9a82c97b84647be027f238313..ad1426a8e1bf0f270bc64d7b2ae61e2a5d3c6d7f 100644 --- a/smp-angular/src/app/edit/edit-resources/resource-document-panel/resource-document-panel.component.html +++ b/smp-angular/src/app/edit/edit-resources/resource-document-panel/resource-document-panel.component.html @@ -14,6 +14,7 @@ <button id="GenerateResource_id" mat-raised-button color="primary" matTooltip="Generate resource" + (click)="onGenerateButtonClicked()" > <mat-icon>add_circle</mat-icon> @@ -22,6 +23,7 @@ <button id="documentWizard_id" mat-raised-button color="primary" matTooltip="Show document wizard dialog" + *ngIf="showWizardDialog" (click)="onShowDocumentWizardDialog()" > <mat-icon>code_block</mat-icon> @@ -90,7 +92,13 @@ ></ngx-codemirror> </div> <mat-toolbar class="mat-elevation-z2" style="flex-grow: 0"> - <mat-toolbar-row> + <mat-toolbar-row class="smp-toolbar-row"> + <button d="cancel_id" mat-raised-button color="primary" + [disabled]="saveButtonDisabled" + (click)="onDocumentResetButtonClicked()"> + <mat-icon>cancel</mat-icon> + <span>Cancel</span> + </button> <button id="saveResource_id" mat-raised-button color="primary" matTooltip="Validate resource" diff --git a/smp-angular/src/app/edit/edit-resources/resource-document-panel/resource-document-panel.component.ts b/smp-angular/src/app/edit/edit-resources/resource-document-panel/resource-document-panel.component.ts index 20c454c083dfbc8d9b743361983a3c002a0cc682..def0a9a8c0109e7bbd5bc0b84710c42c9618fe90 100644 --- a/smp-angular/src/app/edit/edit-resources/resource-document-panel/resource-document-panel.component.ts +++ b/smp-angular/src/app/edit/edit-resources/resource-document-panel/resource-document-panel.component.ts @@ -12,6 +12,7 @@ import {CodemirrorComponent} from "@ctrl/ngx-codemirror"; import {DocumentRo} from "../../../common/model/document-ro.model"; import {NavigationService} from "../../../window/sidenav/navigation-model.service"; import {DocumentWizardDialogComponent} from "../document-wizard-dialog/document-wizard-dialog.component"; +import {ConfirmationDialogComponent} from "../../../common/dialogs/confirmation-dialog/confirmation-dialog.component"; @Component({ moduleId: module.id, @@ -108,7 +109,7 @@ export class ResourceDocumentPanelComponent implements AfterViewInit, BeforeLeav this.documentForm.controls['name'].setValue(value.name); this.documentForm.controls['currentResourceVersion'].setValue(value.currentResourceVersion); this.documentForm.controls['payloadVersion'].setValue(value.payloadVersion); - this.documentForm.controls['payload'].setValue(value.payload); + this.documentForm.controls['payload'].setValue(!value.payload?"":value.payload); this.documentForm.controls['payload'].enable(); // the method documentVersionsExists already uses the current value to check if versions exists if (!this.documentVersionsExists) { @@ -132,6 +133,32 @@ export class ResourceDocumentPanelComponent implements AfterViewInit, BeforeLeav return doc; } + onDocumentResetButtonClicked(): void { + + this.dialog.open(ConfirmationDialogComponent, { + data: { + title: "Cancel changes", + description: "Do you want to cancel all changes on the document?" + } + }).afterClosed().subscribe(result => { + if (result) { + this.resetChanges() + } + }); + } + + resetChanges(){ + + let currentVersion = this._document?.payloadVersion; + if (!currentVersion) { + this.documentForm.controls['payload'].setValue(""); + this.documentForm.markAsPristine(); + } else { + this.loadDocumentForVersion(currentVersion); + } + } + + onSaveButtonClicked(): void { this.editResourceService.saveDocumentObservable(this._resource, this.document).subscribe((value: DocumentRo) => { if (value) { @@ -223,7 +250,7 @@ export class ResourceDocumentPanelComponent implements AfterViewInit, BeforeLeav } get emptyDocument(): boolean{ - return !this.documentForm.controls['payload'].value + return !this.documentForm.controls['payload']?.value } get documentVersionsExists(): boolean{ @@ -232,12 +259,17 @@ export class ResourceDocumentPanelComponent implements AfterViewInit, BeforeLeav get saveButtonDisabled(): boolean { - return !this.documentForm.dirty; + return !this.documentForm.dirty || !this.documentForm.controls['payload']?.value; } isDirty(): boolean { return this.documentForm.dirty } + + get showWizardDialog(): boolean { + // in version DomiSMP 5.0 CR show only the wizard for edelivery-oasis-smp-1.0-servicegroup + return this._resource?.resourceTypeIdentifier === 'edelivery-oasis-smp-1.0-servicegroup'; + } } diff --git a/smp-angular/src/app/edit/edit-resources/subresource-document-panel/subresource-document-panel.component.html b/smp-angular/src/app/edit/edit-resources/subresource-document-panel/subresource-document-panel.component.html index f0a2624c77d03addd2c715a9426b40e39d3c88f9..c6f412a95c4d7f49835e6381c5a4f35ed64eaf9b 100644 --- a/smp-angular/src/app/edit/edit-resources/subresource-document-panel/subresource-document-panel.component.html +++ b/smp-angular/src/app/edit/edit-resources/subresource-document-panel/subresource-document-panel.component.html @@ -4,6 +4,7 @@ <mat-toolbar-row class="smp-toolbar-row"> <button id="validateResource_id" mat-raised-button color="primary" + [disabled]="emptyDocument" matTooltip="Validate resource" (click)="onDocumentValidateButtonClicked()" > @@ -21,6 +22,7 @@ <button id="documentWizard_id" mat-raised-button color="primary" matTooltip="Show document wizard dialog" + *ngIf="showWizardDialog" (click)="onShowDocumentWizardDialog()" > <mat-icon>code_block</mat-icon> @@ -103,7 +105,13 @@ ></ngx-codemirror> </div> <mat-toolbar class="mat-elevation-z2" style="flex-grow: 0"> - <mat-toolbar-row> + <mat-toolbar-row class="smp-toolbar-row"> + <button d="cancel_id" mat-raised-button color="primary" + [disabled]="saveButtonDisabled" + (click)="onDocumentResetButtonClicked()"> + <mat-icon>cancel</mat-icon> + <span>Cancel</span> + </button> <button id="saveResource_id" mat-raised-button color="primary" matTooltip="Validate resource" diff --git a/smp-angular/src/app/edit/edit-resources/subresource-document-panel/subresource-document-panel.component.ts b/smp-angular/src/app/edit/edit-resources/subresource-document-panel/subresource-document-panel.component.ts index e5cecfda3a1939c5fc27c2ba0cd4fd5c794a1ec3..c55c7e24ca70da4fdb64b7452cdcb2fb77a408c6 100644 --- a/smp-angular/src/app/edit/edit-resources/subresource-document-panel/subresource-document-panel.component.ts +++ b/smp-angular/src/app/edit/edit-resources/subresource-document-panel/subresource-document-panel.component.ts @@ -11,7 +11,6 @@ import {FormBuilder, FormControl, FormGroup} from "@angular/forms"; import {CodemirrorComponent} from "@ctrl/ngx-codemirror"; import {DocumentRo} from "../../../common/model/document-ro.model"; import {NavigationService} from "../../../window/sidenav/navigation-model.service"; -import {DocumentWizardDialogComponent} from "../document-wizard-dialog/document-wizard-dialog.component"; import {SubresourceRo} from "../../../common/model/subresource-ro.model"; import { SubresourceDocumentWizardComponent @@ -19,6 +18,7 @@ import { import { ServiceMetadataWizardRo } from "../../../service-group-edit/service-metadata-wizard-dialog/service-metadata-wizard-edit-ro.model"; +import {ConfirmationDialogComponent} from "../../../common/dialogs/confirmation-dialog/confirmation-dialog.component"; @Component({ moduleId: module.id, @@ -145,9 +145,15 @@ export class SubresourceDocumentPanelComponent implements AfterViewInit, BeforeL this.documentForm.controls['name'].setValue(value.name); this.documentForm.controls['currentResourceVersion'].setValue(value.currentResourceVersion); this.documentForm.controls['payloadVersion'].setValue(value.payloadVersion); - this.documentForm.controls['payload'].setValue(value.payload); - this.documentForm.controls['payloadVersion'].enable(); + this.documentForm.controls['payload'].setValue(!value.payload?"":value.payload); this.documentForm.controls['payload'].enable(); + + if (!this.documentVersionsExists) { + this.documentForm.controls['payloadVersion'].disable(); + } else { + this.documentForm.controls['payloadVersion'].enable(); + } + } else { this.documentForm.controls['name'].setValue(""); this.documentForm.controls['payload'].setValue(""); @@ -268,14 +274,48 @@ export class SubresourceDocumentPanelComponent implements AfterViewInit, BeforeL return !this._document?.allVersions ? [] : this._document?.allVersions; } + get documentVersionsExists(): boolean{ + return this.getDocumentVersions.length > 0 + } + get emptyDocument(): boolean{ + return !this.documentForm.controls['payload']?.value + } get saveButtonDisabled(): boolean { - return !this.documentForm.dirty; + return !this.documentForm.dirty || !this.documentForm.controls['payload']?.value; } isDirty(): boolean { return this.documentForm.dirty } + + onDocumentResetButtonClicked(): void { + + this.dialog.open(ConfirmationDialogComponent, { + data: { + title: "Cancel changes", + description: "Do you want to cancel all changes on the document?" + } + }).afterClosed().subscribe(result => { + if (result) { + this.resetChanges() + } + }); + } + resetChanges(){ + let currentVersion = this._document?.payloadVersion; + if (!currentVersion) { + this.documentForm.controls['payload'].setValue(""); + this.documentForm.markAsPristine(); + } else { + this.loadDocumentForVersion(currentVersion); + } + } + + get showWizardDialog(): boolean { + // in version DomiSMP 5.0 CR show only the wizard for edelivery-oasis-smp-1.0-servicemetadata + return this._subresource?.subresourceTypeIdentifier === 'edelivery-oasis-smp-1.0-servicemetadata'; + } } diff --git a/smp-angular/src/app/edit/edit-resources/subresource-panel/subresource-panel.component.html b/smp-angular/src/app/edit/edit-resources/subresource-panel/subresource-panel.component.html index 12af9e27809ac5b69974da88c6e58e51fdfe35dc..1b4f59c294e79d27a6dcc3800b3b5028ab03ee73 100644 --- a/smp-angular/src/app/edit/edit-resources/subresource-panel/subresource-panel.component.html +++ b/smp-angular/src/app/edit/edit-resources/subresource-panel/subresource-panel.component.html @@ -52,12 +52,10 @@ <td mat-cell *matCellDef="let row">{{row.identifierValue}}</td> </ng-container> - - <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-row *matRowDef="let odd = odd; let row; columns: displayedColumns;" (click)="onResourceSelected(row)" - (dblclick)="showResourceEditDialog(row)" + (dblclick)="showSubresourceEditPanel(row)" [ngClass]="{'datatable-row-selected': row==selected,'datatable-row-odd': odd}" ></tr> @@ -74,9 +72,9 @@ </div> <mat-paginator class="mat-elevation-z2" - - [pageSize]="5" - [pageSizeOptions]="[5, 10, 25]" + [hidePageSize]="true" + [showFirstLastButtons]="true" + [pageSize]="3" [disabled]="disabledForm" aria-label="Select pages"></mat-paginator> </div> diff --git a/smp-angular/src/app/edit/edit-resources/subresource-panel/subresource-panel.component.ts b/smp-angular/src/app/edit/edit-resources/subresource-panel/subresource-panel.component.ts index 6a2897aed7385881303c0a2dffa9881723491a1b..f88c787b621141c6275137b53648fa12992af690 100644 --- a/smp-angular/src/app/edit/edit-resources/subresource-panel/subresource-panel.component.ts +++ b/smp-angular/src/app/edit/edit-resources/subresource-panel/subresource-panel.component.ts @@ -1,4 +1,4 @@ -import {Component, Input, OnInit, ViewChild,} from '@angular/core'; +import {AfterViewInit, Component, Input, OnInit, ViewChild,} from '@angular/core'; import {MatDialog} from "@angular/material/dialog"; import {BeforeLeaveGuard} from "../../../window/sidenav/navigation-on-leave-guard"; import {MatPaginator} from "@angular/material/paginator"; @@ -22,7 +22,7 @@ import {NavigationNode, NavigationService} from "../../../window/sidenav/navigat templateUrl: './subresource-panel.component.html', styleUrls: ['./subresource-panel.component.scss'] }) -export class SubresourcePanelComponent implements OnInit, BeforeLeaveGuard { +export class SubresourcePanelComponent implements AfterViewInit, OnInit, BeforeLeaveGuard { title: string = "Subresources"; @@ -45,15 +45,11 @@ export class SubresourcePanelComponent implements OnInit, BeforeLeaveGuard { } ngOnInit(): void { - // filter predicate for search the domain - /* - this.dataSource.filterPredicate = - (data: SubresourceRo, filter: string) => { - return !filter || -1 != data.subresourceId.toLowerCase().indexOf(filter.trim().toLowerCase()); + } - }; + ngAfterViewInit() { - */ + this.dataSource.paginator = this.paginator; } @Input() set resource(resource: ResourceRo) { @@ -147,6 +143,10 @@ export class SubresourcePanelComponent implements OnInit, BeforeLeaveGuard { } public showSubresourceEditPanel(subresource: SubresourceRo) { + if (!this.navigationService.selected) { + this.navigationService.select(null); + return; + } this.editResourceService.selectedResource = this.resource; this.editResourceService.selectedSubresource = subresource; diff --git a/smp-angular/src/app/service-group-search/service-group-search.component.html b/smp-angular/src/app/service-group-search/service-group-search.component.html index c0ac29d1b13a94fd34107f528bc9dc0ed5a13209..4f8b052a1bfa6dec0fe2967eaedcfbdbba0627e4 100644 --- a/smp-angular/src/app/service-group-search/service-group-search.component.html +++ b/smp-angular/src/app/service-group-search/service-group-search.component.html @@ -47,7 +47,7 @@ <ng-template #tableRowDetailContainer let-row="row"> <div *ngIf="row.serviceMetadata.length===0" style="padding-left:20px;"> - No service metadata + No subresources </div> <div *ngIf="row.serviceMetadata.length !== 0"> <ngx-datatable diff --git a/smp-angular/src/app/service-group-search/service-group-search.component.ts b/smp-angular/src/app/service-group-search/service-group-search.component.ts index 10379b92b075e10cce4d57e5fc9c15ec72500496..0c6cf69cc05f7c5a7050bb11a6fb78085cb6d9e9 100644 --- a/smp-angular/src/app/service-group-search/service-group-search.component.ts +++ b/smp-angular/src/app/service-group-search/service-group-search.component.ts @@ -57,7 +57,7 @@ export class ServiceGroupSearchComponent implements OnInit, AfterViewInit, After initColumns(): void { this.columnPicker.allColumns = [ { - name: 'Metadata size', + name: 'Subres. size', prop: 'serviceMetadata.length', showInitially: true, width: 120, diff --git a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/exceptions/ErrorCode.java b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/exceptions/ErrorCode.java index 3ba7fcad462bb2a801c4e6997e98c6dd4353d83a..cba897728b8bf7171d091780cf521291ad829e47 100644 --- a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/exceptions/ErrorCode.java +++ b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/exceptions/ErrorCode.java @@ -69,7 +69,7 @@ public enum ErrorCode { MAIL_SUBMISSION_ERROR (500,"SMP:550",ErrorBusinessCode.TECHNICAL, "Mail submission error: %s!"), - RESOURCE_DOCUMENT_MISSING(500,"SMP:180",ErrorBusinessCode.TECHNICAL, "Missing document for the resource: [id: '%s', sch.: '%s']!"), + RESOURCE_DOCUMENT_MISSING(500,"SMP:180",ErrorBusinessCode.TECHNICAL, "Empty document for the resource: [id: '%s', sch.: '%s']!"), RESOURCE_DOCUMENT_ERROR(500,"SMP:180",ErrorBusinessCode.TECHNICAL, "Error occurred while reading the resource document: [id: '%s', sch.: '%s']! Error [%s]"), diff --git a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/resource/AbstractResourceHandler.java b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/resource/AbstractResourceHandler.java index da29b50d94e98235a9a2d9bcb6cf6224767ea026..b91c92acb69a34630fa5c4dfb18946d406354959 100644 --- a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/resource/AbstractResourceHandler.java +++ b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/resource/AbstractResourceHandler.java @@ -88,13 +88,15 @@ public class AbstractResourceHandler { */ public RequestData buildRequestDataForResource(DBDomain domain, DBResource resource) { byte[] content = resourceStorage.getDocumentContentForResource(resource); + if (content==null || content.length == 0) { + throw new SMPRuntimeException(ErrorCode.RESOURCE_DOCUMENT_MISSING, resource.getIdentifierValue(), resource.getIdentifierScheme()); + } ByteArrayInputStream inputStream = new ByteArrayInputStream(content); return buildRequestDataForResource(domain, resource, inputStream); } - public RequestData buildRequestDataForResource(DBDomain domain, DBResource resource, InputStream inputStream) { return new SpiRequestData(domain.getDomainCode(), SPIUtils.toUrlIdentifier(resource),