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 dde26d092cf43d4fcf20bd80059d026691e64466..5b6b5c47eb933e92fbc1f7d55c2e8980341455d9 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 @@ -74,10 +74,11 @@ <ng-template #rowExpand let-row="row" let-expanded="expanded" ngx-datatable-cell-template> <a href="javascript:void(0)" - [class.datatable-icon-right]="!expanded" - [class.datatable-icon-down]="expanded" + title="Expand/Collapse Row" - (click)="toggleExpandRow(row)"> + (click)="toggleExpandRow(row)"> <mat-icon class="mat-icon-rtl-mirror"> + {{expanded ? 'expand_more' : 'chevron_right'}} + </mat-icon> </a> </ng-template> 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 289743b03b120ee4697577994962425bcac1ffd5..f0a2624c77d03addd2c715a9426b40e39d3c88f9 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 @@ -37,7 +37,21 @@ </mat-form-field> <mat-form-field style="width: 100%"> <mat-label>Resource identifier</mat-label> - <input id="identifierValue_id" type="text" matInput #identifierValue + <input id="identifierValue_id" type="text" matInput + formControlName="identifierValue" + required auto-focus-directive> + </mat-form-field> + </div> + <div [formGroup]="subresourceForm" style="width: 100%; display: flex; flex-direction: row; "> + <mat-form-field style="width: 100%"> + <mat-label>Subresource scheme</mat-label> + <input id="subresourceidentifierScheme_id" type="text" matInput + formControlName="identifierScheme" + > + </mat-form-field> + <mat-form-field style="width: 100%"> + <mat-label>Subresource identifier</mat-label> + <input id="SubresourcedentifierValue_id" type="text" matInput formControlName="identifierValue" required auto-focus-directive> </mat-form-field> 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 6c9152ba7bfa1b7ed7932c1a95fd014dc866c2d9..cb211951184b638273bea2105b121561856f428d 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 @@ -18,16 +18,16 @@ <ng-template #searchPanel> - <mat-form-field> + <mat-form-field class="smp-data-panel-field"> <input matInput placeholder="Participant Identifier" name="ParticipantIdentifier" [(ngModel)]="filter.participantIdentifier" #messageId="ngModel" id="participantIdentifier"> </mat-form-field> - <mat-form-field> + <mat-form-field class="smp-data-panel-field"> <input matInput placeholder="Participant scheme" name="patricipantScheme" [(ngModel)]="filter.participantScheme" #messageId="ngModel" id="participantScheme"> </mat-form-field> - <mat-select placeholder="All Domains" [(ngModel)]="filter.domain" name="domain" + <mat-select placeholder="All Domains" [(ngModel)]="filter.domain" name="domain" *ngIf="false" id="domain_id"> <mat-option [value]="''">All Domains</mat-option> <mat-option *ngFor="let domain of lookups.cachedDomainList" [value]="domain.domainCode"> 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 3ce69a0079c277656d7bb3e16d5e26127712682f..da29b50d94e98235a9a2d9bcb6cf6224767ea026 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 @@ -106,7 +106,7 @@ public class AbstractResourceHandler { return new SpiRequestData(domain.getDomainCode(), SPIUtils.toUrlIdentifier(resource), SPIUtils.toUrlIdentifier(subresource), - new ByteArrayInputStream(content)); + new ByteArrayInputStream(content == null?new byte[]{}:content)); } public RequestData buildRequestDataForSubResource(DBDomain domain, DBResource resource, DBSubresource subresource, InputStream inputStream) { diff --git a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ui/UIServiceGroupSearchService.java b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ui/UIServiceGroupSearchService.java index 5231b6005922783ffb0efd20d693c63da283a912..4a84c124705464cdfad22859e7a0044ce380b5ab 100644 --- a/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ui/UIServiceGroupSearchService.java +++ b/smp-server-library/src/main/java/eu/europa/ec/edelivery/smp/services/ui/UIServiceGroupSearchService.java @@ -4,8 +4,11 @@ import eu.europa.ec.edelivery.smp.data.dao.BaseDao; import eu.europa.ec.edelivery.smp.data.dao.DomainDao; import eu.europa.ec.edelivery.smp.data.dao.ResourceDao; import eu.europa.ec.edelivery.smp.data.dao.UserDao; +import eu.europa.ec.edelivery.smp.data.model.DBDomain; import eu.europa.ec.edelivery.smp.data.model.doc.DBResource; +import eu.europa.ec.edelivery.smp.data.ui.DomainRO; import eu.europa.ec.edelivery.smp.data.ui.ServiceGroupSearchRO; +import eu.europa.ec.edelivery.smp.data.ui.ServiceMetadataRO; import eu.europa.ec.edelivery.smp.data.ui.ServiceResult; import eu.europa.ec.edelivery.smp.logging.SMPLogger; import eu.europa.ec.edelivery.smp.logging.SMPLoggerFactory; @@ -68,8 +71,8 @@ public class UIServiceGroupSearchService extends UIServiceBase<DBResource, Servi List<DBResource> lst = serviceGroupDao.getServiceGroupList(iStartIndex, pageSize, sortField, sortOrder, filter); List<ServiceGroupSearchRO> lstRo = new ArrayList<>(); - for (DBResource dbServiceGroup : lst) { - ServiceGroupSearchRO serviceGroupRo = convertToRo(dbServiceGroup); + for (DBResource resource : lst) { + ServiceGroupSearchRO serviceGroupRo = convertToRo(resource); serviceGroupRo.setIndex(iStartIndex++); lstRo.add(serviceGroupRo); } @@ -81,29 +84,27 @@ public class UIServiceGroupSearchService extends UIServiceBase<DBResource, Servi /** * Convert Database object to Rest object for UI * - * @param dbServiceGroup - database entity + * @param resource - database entity * @return ServiceGroupRO */ - public ServiceGroupSearchRO convertToRo(DBResource dbServiceGroup) { + public ServiceGroupSearchRO convertToRo(DBResource resource) { ServiceGroupSearchRO serviceGroupRo = new ServiceGroupSearchRO(); - serviceGroupRo.setId(dbServiceGroup.getId()); - serviceGroupRo.setParticipantIdentifier(dbServiceGroup.getIdentifierValue()); - serviceGroupRo.setParticipantScheme(dbServiceGroup.getIdentifierScheme()); - /* - dbServiceGroup.getResourceDomains().forEach(sgd -> { - DomainRO dmn = new DomainRO(); - sgd.getSubresourcesList().forEach(sgmd -> { + serviceGroupRo.setId(resource.getId()); + serviceGroupRo.setParticipantIdentifier(resource.getIdentifierValue()); + serviceGroupRo.setParticipantScheme(resource.getIdentifierScheme()); + DBDomain domain = resource.getDomainResourceDef().getDomain(); + + resource.getSubresources().forEach(subresource -> { ServiceMetadataRO smdro = new ServiceMetadataRO(); - smdro.setDocumentIdentifier(sgmd.getDocumentIdentifier()); - smdro.setDocumentIdentifierScheme(sgmd.getDocumentIdentifierScheme()); - smdro.setDomainCode(sgd.getDomain().getDomainCode()); - smdro.setSmlSubdomain(sgd.getDomain().getSmlSubdomain()); + smdro.setDocumentIdentifier(subresource.getIdentifierValue()); + smdro.setDocumentIdentifierScheme(subresource.getIdentifierScheme()); + smdro.setDomainCode(domain.getDomainCode()); + smdro.setSmlSubdomain(domain.getSmlSubdomain()); serviceGroupRo.getServiceMetadata().add(smdro); - }); + }); - */ return serviceGroupRo; } }