Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-data.component.html
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-data.component.html	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-data.component.html	(revision 50977)
@@ -38,19 +38,22 @@
             <div>
               <register-datasource-shareable *ngIf="showRepositories"
                                          #datasourcesByCountry
-                                         [mode]="'re3data'"></register-datasource-shareable>
+                                         [mode]="'re3data'"
+                                         (emitRepoId)="getRepoId($event)"></register-datasource-shareable>
 
               <datasource-info-form *ngIf="showForm"
                                     #updateDatasource
-                                    [datasourceId]="datasourceId"></datasource-info-form>
+                                    [datasourceId]="datasourceId"
+                                    (emittedInfo)="getCurrentRepo($event)"></datasource-info-form>
 
-              <div *ngIf="showInterfaces">
+              <div *ngIf="showInterfaces && repo && repoInterfaces">
                 <form [formGroup]="group">
                   <form-repeat [component]="updateDatasourceInterfaces"
                                [parentGroup]="group"
                                [description]="interfaceFormDesc"
                                [name]="'repository-interfaces'"
-                               [data]="repoInterfaces">
+                               [data]="repoInterfaces"
+                               [otherData]="repo">
                   </form-repeat>
                 </form>
               </div>
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-journal.component.html
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-journal.component.html	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-journal.component.html	(revision 50977)
@@ -31,14 +31,16 @@
           <div class="animated fadeInRight stepContent">
             <div>
               <journal-info-form *ngIf="showForm"
-                                    #registerJournal></journal-info-form>
+                                 #registerJournal
+                                 (emittedInfo)="getCurrentRepo($event)"></journal-info-form>
 
-              <div *ngIf="showInterfaces">
+              <div *ngIf="showInterfaces && repo">
                 <form [formGroup]="group">
                   <form-repeat [component]="addDatasourceInterfaces"
                                [parentGroup]="group"
                                [description]="interfaceFormDesc"
-                               [name]="'repository-interfaces'">
+                               [name]="'repository-interfaces'"
+                               [otherData]="repo">
                   </form-repeat>
                 </form>
               </div>
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-data.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-data.component.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-data.component.ts	(revision 50977)
@@ -1,7 +1,7 @@
 import { Component, OnInit, Type, ViewChild } from '@angular/core';
 import { RegisterDatasourceShareableComponent } from './register-datasource-shareable.component';
 import { DatasourceInfoFormComponent } from '../sources-forms/datasource-info-form.component';
-import { RepositoryInterface } from '../../../domain/typeScriptClasses';
+import { Repository, RepositoryInterface } from '../../../domain/typeScriptClasses';
 import { DatasourceInterfaceFormComponent } from '../sources-forms/datasource-interface-form.component';
 import { Description, interfaceFormDesc } from '../../../domain/oa-description';
 import { FormBuilder, FormGroup } from '@angular/forms';
@@ -23,6 +23,7 @@
   step4: string = '';
 
   datasourceId: string;
+  repo: Repository;
 
   @ViewChild('datasourcesByCountry')
   public datasourcesByCountry: RegisterDatasourceShareableComponent;
@@ -46,7 +47,6 @@
   moveAStep(){
     if(this.showRepositories) {
       if (this.datasourcesByCountry.goToNextStep()) {
-        this.datasourceId = this.datasourcesByCountry.repoId;
         this.showRepositories = false;
         this.showForm = true;
         this.step2 = 'active';
@@ -84,6 +84,14 @@
   }
 
 
+  getRepoId(emitedId: string) {
+    this.datasourceId = emitedId;
+  }
+
+  getCurrentRepo(repo: Repository) {
+    this.repo = repo;
+  }
+
   getRepoInterfaces() {
     this.repoService.getRepositoryInterface(this.datasourceId).subscribe(
       interfaces => { this.repoInterfaces = interfaces; console.log(this.repoInterfaces.length)},
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-journal.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-journal.component.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-journal.component.ts	(revision 50977)
@@ -4,6 +4,7 @@
 import { Description, interfaceFormDesc } from '../../../domain/oa-description';
 import { DatasourceInterfaceFormComponent } from '../sources-forms/datasource-interface-form.component';
 import { RepositoryService } from '../../../services/repository.service';
+import { Repository } from '../../../domain/typeScriptClasses';
 
 @Component ({
   selector: 'app-sr-journal',
@@ -17,8 +18,6 @@
   step2: string = '';
   step3: string = '';
 
-  datasourceId: string;
-
   @ViewChild ('registerJournal')
   registerJournal: JournalInfoFormComponent;
 
@@ -26,10 +25,10 @@
   interfaceFormDesc: Description = interfaceFormDesc;
   addDatasourceInterfaces: Type<any> = DatasourceInterfaceFormComponent;
 
+  repo: Repository;
 
   constructor(
-    private fb: FormBuilder,
-    private repoService: RepositoryService) {}
+    private fb: FormBuilder) {}
 
   ngOnInit() {
     this.showForm = true;
@@ -62,4 +61,8 @@
     }
   }
 
+  getCurrentRepo(repo: Repository) {
+    this.repo = repo;
+  }
+
 }
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.html
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.html	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.html	(revision 50977)
@@ -43,9 +43,10 @@
 
               <datasource-info-form *ngIf="showForm"
                                     #updateDatasource
-                                    [datasourceId]="datasourceId"></datasource-info-form>
+                                    [datasourceId]="datasourceId"
+                                    (emittedInfo)="getCurrentRepo($event)"></datasource-info-form>
 
-              <div *ngIf="showInterfaces">
+              <div *ngIf="showInterfaces && repoInterfaces && repo">
                 <form [formGroup]="group">
                   <form-repeat [component]="updateDatasourceInterfaces"
                                [parentGroup]="group"
@@ -52,7 +53,7 @@
                                [description]="interfaceFormDesc"
                                [name]="'repository-interfaces'"
                                [data]="repoInterfaces"
-                               [otherData]="exportedData">
+                               [otherData]="repo">
                   </form-repeat>
                 </form>
               </div>
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-aggregator.component.html
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-aggregator.component.html	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-aggregator.component.html	(revision 50977)
@@ -31,14 +31,16 @@
           <div class="animated fadeInRight stepContent">
             <div>
               <aggregator-info-form *ngIf="showForm"
-                                    #registerAggregator></aggregator-info-form>
+                                    #registerAggregator
+                                    (emittedInfo)="getCurrentRepo($event)"></aggregator-info-form>
 
-              <div *ngIf="showInterfaces">
+              <div *ngIf="showInterfaces && repo">
                 <form [formGroup]="group">
                   <form-repeat [component]="addDatasourceInterfaces"
                                [parentGroup]="group"
                                [description]="interfaceFormDesc"
-                               [name]="'repository-interfaces'">
+                               [name]="'repository-interfaces'"
+                               [otherData]="repo">
                   </form-repeat>
                 </form>
               </div>
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.ts	(revision 50977)
@@ -3,7 +3,7 @@
 */
 
 import { Component, OnInit, Type, ViewChild } from '@angular/core';
-import { RepositoryInterface } from '../../../domain/typeScriptClasses';
+import { Repository, RepositoryInterface } from '../../../domain/typeScriptClasses';
 import { DatasourceInfoFormComponent } from '../sources-forms/datasource-info-form.component';
 import { RegisterDatasourceShareableComponent } from './register-datasource-shareable.component';
 import { DatasourceInterfaceFormComponent } from '../sources-forms/datasource-interface-form.component';
@@ -26,6 +26,7 @@
   step4: string = '';
 
   datasourceId: string;
+  repo: Repository;
 
   @ViewChild('datasourcesByCountry')
   public datasourcesByCountry: RegisterDatasourceShareableComponent;
@@ -37,7 +38,6 @@
   interfaceFormDesc: Description = interfaceFormDesc;
   updateDatasourceInterfaces: Type<any> = DatasourceInterfaceFormComponent;
   repoInterfaces: RepositoryInterface[] = [];
-  exportedData: string[] = [];
 
 
   constructor(
@@ -60,8 +60,6 @@
     } else if(this.showForm) {
       if (this.updateDatasource.updateRepo()){
         setTimeout( () => {
-          this.exportedData.push(this.datasourceId);
-          this.exportedData.push('opendoar');
           this.getRepoInterfaces();
           this.group = this.fb.group({});
         }, 500 );
@@ -93,6 +91,10 @@
     this.datasourceId = emitedId;
   }
 
+  getCurrentRepo(repo: Repository) {
+    this.repo = repo;
+  }
+
   getRepoInterfaces() {
     this.repoService.getRepositoryInterface(this.datasourceId).subscribe(
       interfaces => {
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-aggregator.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-aggregator.component.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-aggregator.component.ts	(revision 50977)
@@ -3,7 +3,7 @@
 import { Description, interfaceFormDesc } from '../../../domain/oa-description';
 import { FormBuilder, FormGroup } from '@angular/forms';
 import { AggregatorInfoFormComponent } from '../sources-forms/aggregator-info-form.component';
-import { RepositoryService } from '../../../services/repository.service';
+import { Repository } from '../../../domain/typeScriptClasses';
 
 @Component ({
   selector: 'sr-aggregator',
@@ -17,7 +17,7 @@
   step2: string = '';
   step3: string = '';
 
-  datasourceId: string;
+  repo: Repository;
 
   @ViewChild ('registerAggregator')
   registerAggregator: AggregatorInfoFormComponent;
@@ -27,8 +27,7 @@
   addDatasourceInterfaces: Type<any> = DatasourceInterfaceFormComponent;
 
   constructor(
-    private fb: FormBuilder,
-    private repoService: RepositoryService) {}
+    private fb: FormBuilder) {}
 
   ngOnInit() {
     this.showForm = true;
@@ -61,4 +60,7 @@
     }
   }
 
+  getCurrentRepo(repo: Repository) {
+    this.repo = repo;
+  }
 }
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-interface-form.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-interface-form.component.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-interface-form.component.ts	(revision 50977)
@@ -2,13 +2,13 @@
 import { MyGroup } from '../../../shared/reusablecomponents/forms/my-group.interface';
 import { FormBuilder, Validators } from '@angular/forms';
 import {
-  formErrorRequiredFields, formSuccessAddedInterface,
+  formErrorRequiredFields, formErrorWasntSaved, formSubmitting, formSuccessAddedInterface, formSuccessUpdatedInterface,
   invalidCustomBaseUrl, noServiceMessage
 } from '../../../domain/shared-messages';
 import { ValidatorService } from '../../../services/validator.service';
 import { ActivatedRoute } from '@angular/router';
 import { RepositoryService } from '../../../services/repository.service';
-import { InterfaceInformation, RepositoryInterface } from '../../../domain/typeScriptClasses';
+import { InterfaceInformation, Repository, RepositoryInterface } from '../../../domain/typeScriptClasses';
 
 @Component ({
   selector: 'datasource-interface-form',
@@ -17,16 +17,17 @@
 
 export class DatasourceInterfaceFormComponent extends MyGroup implements OnDestroy {
 
+  loadingMessage: string;
   successMessage: string;
   errorMessage: string;
 
-  mode: string;
+  currentRepository: Repository;
 
   identifiedBaseUrl: boolean;
   existingValSet: boolean;
   interfaceInfo: InterfaceInformation;
   currentInterface: RepositoryInterface;
-  valset: string[] = [];
+  valsetList: string[] = [];
 
   compClasses: Map<string,string> = new Map<string,string>();
   classCodes: string[] = [];
@@ -40,12 +41,12 @@
 
   constructor(injector: Injector,
               private valService: ValidatorService,
-              private repoService: RepositoryService,
-              private route: ActivatedRoute){
+              private repoService: RepositoryService){
     super(injector);
   }
 
   ngOnInit() {
+      this.currentRepository = <Repository>this.otherData;
       this.getCompatibilityClasses();
       console.log(`other data is: ${JSON.stringify(this.otherData)}`);
       if (this.data && this.data.length) {
@@ -79,11 +80,13 @@
   }
 
   saveInterface() {
+    this.errorMessage = '';
+    this.successMessage = '';
     if (this.group.valid) {
       if (this.identifiedBaseUrl) {
         let baseUrl = this.getMyControl('baseUrl').value;
-        let valset: string;
-        if (this.getMyControl('selectValidationSet').enabled ) {
+        let valset: string = '';
+        if (this.getMyControl('selectValidationSet').enabled) {
           valset = this.getMyControl('selectValidationSet').value;
         } else {
           valset = this.getMyControl('customValidationSet').value;
@@ -91,46 +94,9 @@
         let compLvl = this.getMyControl('compatibilityLevel').value;
 
         if (this.currentInterface) {
-          this.currentInterface.baseUrl = baseUrl;
-          //this.currentInterface.accessSet = this.valset; CHECK IF THIS IS THE CORRECT FIELD
-          this.currentInterface.desiredCompatibilityLevel = compLvl;
-          /*update Interface*/
-
+          this.updateCurrent(baseUrl,valset,compLvl);
         } else {
-          let currentInterface: RepositoryInterface = {
-            desiredCompatibilityLevel: compLvl,
-            complianceName: 'UNKNOWN',
-            upgradeToV3: '',
-            deleteApi: false,
-            accessSet: valset,
-            accessFormat: '',
-            metadataIdentifierPath: '',
-            lastCollectionDate: '',
-            nextScheduledExecution: '',
-            status: '',
-            collectedFrom: '',
-            id: '',
-            typology: '',
-            compliance: '',
-            contentDescription: '',
-            accessProtocol: '',
-            baseUrl: '',
-            active: false,
-            removable: false,
-            accessParams: {},
-            extraFields: {}
-          };
-          this.repoService.addInterface(this.otherData[1], this.otherData[0], currentInterface).subscribe(
-            addedInterface => {
-              console.log(`addInterface responded ${addedInterface}`);
-              this.currentInterface = addedInterface;
-            },
-            error => console.log(error),
-            () => {
-              this.successMessage = formSuccessAddedInterface;
-              this.errorMessage = '';
-            }
-          );
+          this.addCurrent(baseUrl,valset,compLvl);
         }
       } else {
         this.errorMessage = invalidCustomBaseUrl;
@@ -153,8 +119,8 @@
             this.errorMessage = invalidCustomBaseUrl;
           }
           if (this.interfaceInfo.sets) {
-            this.valset = this.interfaceInfo.sets;
-            console.log(this.valset);
+            this.valsetList = this.interfaceInfo.sets;
+            console.log(this.valsetList);
           }
         },
         error => {
@@ -166,17 +132,8 @@
     }
   }
 
-  getMode() {
-    if (this.route.snapshot.paramMap.get('id')) {
-      this.mode = this.route.snapshot.paramMap.get('id').split("_")[0];
-    } else {
-      this.mode = this.route.snapshot.url[0].path;
-    }
-  }
-
   getCompatibilityClasses() {
-    this.getMode();
-    this.repoService.getCompatibilityClasses(this.mode).subscribe(
+    this.repoService.getCompatibilityClasses(this.currentRepository.datasourceType).subscribe(
       classes => {
         this.compClasses = classes;
         for (let key in this.compClasses){
@@ -190,12 +147,68 @@
     );
   }
 
+  updateCurrent (baseUrl: string, valset: string, compLvl: string) {
+    this.successMessage = '';
+    this.errorMessage = '';
+    this.loadingMessage = formSubmitting;
+    this.currentInterface.baseUrl = baseUrl;
+    this.currentInterface.accessSet = valset;
+    this.currentInterface.desiredCompatibilityLevel = compLvl;
+    this.currentInterface.typology = this.currentRepository.datasourceClass;
+    this.repoService.updateInterface(this.currentInterface).subscribe(
+      response => {
+        console.log(`updateRepository responded ${response}`);
+        this.loadingMessage = '';
+        if (response == '200') {
+          this.successMessage = formSuccessUpdatedInterface;
+        } else {
+          this.errorMessage = formErrorWasntSaved;
+        }
+      },
+      error => {
+        console.log(error);
+        this.loadingMessage = '';
+        this.errorMessage = formErrorWasntSaved;
+      }
+    );
+  }
+
+  addCurrent (baseUrl: string, valset: string, compLvl: string) {
+    this.errorMessage = '';
+    this.successMessage = '';
+    this.loadingMessage = formSubmitting;
+    this.currentInterface = new RepositoryInterface();
+    this.currentInterface.baseUrl = baseUrl;
+    this.currentInterface.accessSet = valset;
+    this.currentInterface.desiredCompatibilityLevel = compLvl;
+    this.currentInterface.typology = this.currentRepository.datasourceClass;
+    this.repoService.addInterface(this.currentRepository.datasourceType, this.currentRepository.id, this.currentInterface).subscribe(
+      addedInterface => {
+        console.log(`addInterface responded ${addedInterface}`);
+        this.currentInterface = addedInterface;
+      },
+      error => {
+        console.log(error);
+        this.loadingMessage = '';
+        this.errorMessage = formErrorWasntSaved;
+      },
+      () => {
+        this.loadingMessage = '';
+        if (this.currentInterface.id) {
+          this.successMessage = formSuccessAddedInterface;
+        } else {
+          this.errorMessage = formErrorWasntSaved;
+        }
+      }
+    );
+  }
+
   ngOnDestroy() {
     if (this.currentInterface) {
-/*      this.repoService.deleteInterface(this.currentInterface.id).subscribe(
+      this.repoService.deleteInterface(this.currentInterface.id).subscribe(
         response => console.log(`deleteInterface responded: ${response}`),
         error => console.log(error)
-      );*/
+      );
       console.log(`deleting ${this.currentInterface.id}`);
     } else {
       console.log(`deleting empty interface form`);
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/aggregator-info-form.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/aggregator-info-form.component.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/aggregator-info-form.component.ts	(revision 50977)
@@ -2,7 +2,7 @@
 *  created by myrto on 1/22/2018
 */
 
-import { Component, OnInit } from '@angular/core';
+import { Component, EventEmitter, OnInit, Output } from '@angular/core';
 import { formErrorRequiredFields, formSuccessRegisteredDatasource, noServiceMessage } from '../../../domain/shared-messages';
 import { RepositoryService } from "../../../services/repository.service";
 import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -26,6 +26,7 @@
   aggregatorTypeDesc,
   adminEmailDesc
 } from '../../../domain/oa-description';
+import { AuthenticationService } from '../../../services/authentication.service';
 
 @Component ({
   selector: 'aggregator-info-form',
@@ -43,12 +44,11 @@
   datasourceClasses: Map<string,string> = new Map<string,string>();
   classCodes: string[] = [];
 
-  newDatasource: Repository;
+  @Output() emittedInfo: EventEmitter<Repository> = new EventEmitter();
 
   group: FormGroup;
   readonly groupDefinition = {
     softwarePlatform : '',
-    platformName : '',
     officialName : ['', Validators.required],
     repoDescription : ['', Validators.required],
     country : ['', Validators.required],
@@ -64,7 +64,6 @@
   };
 
   softwarePlatformDesc : Description = softwarePlatformDesc;
-  platformNameDesc : Description = platformNameDesc;
   officialNameDesc : Description = officialNameDesc;
   repoDescriptionDesc : Description = repoDescriptionDesc;
   countryDesc : Description = countryDesc;
@@ -81,7 +80,8 @@
 
   constructor(
     private fb: FormBuilder,
-    private repoService: RepositoryService
+    private repoService: RepositoryService,
+    private authService: AuthenticationService
   ) {}
 
   ngOnInit() {
@@ -129,13 +129,44 @@
 
   registerDatasource(): boolean {
     if(this.group.valid){
+      let newRepo = this.createNewRepository();
+      this.repoService.addRepository('aggregator', newRepo).subscribe(
+        response => console.log(`${JSON.stringify(response)}`),
+        error => console.log(error)
+      );
       this.successMessage = formSuccessRegisteredDatasource;
       this.errorMessage = '';
       return true;
     } else {
       this.errorMessage = formErrorRequiredFields;
-      this.successMessage = '';
       return false;
     }
   }
+
+  createNewRepository(): Repository {
+    let newRepo: Repository = new Repository();
+    newRepo.dateOfCreation = new Date(Date.now());
+    newRepo.officialName = this.group.get('officialName').value;
+    newRepo.englishName = this.group.get('englishName').value;
+    newRepo.websiteUrl = this.group.get('websiteUrl').value;
+    newRepo.logoUrl = this.group.get('logoUrl').value;
+    newRepo.contactEmail = this.group.get('adminEmail').value;
+    newRepo.countryName = this.countries.filter(x => x.code == this.group.get('country').value)[0].name;
+    newRepo.countryCode = this.group.get('country').value;
+    newRepo.organization = this.group.get('institutionName').value;
+    newRepo.latitude = this.group.get('latitude').value;
+    newRepo.longitude = this.group.get('longtitude').value;
+    newRepo.timezone = this.group.get('timezone').value;
+    newRepo.datasourceClass = this.group.get('journalType').value;
+    newRepo.typology = this.group.get('softwarePlatform').value;
+    newRepo.description = this.group.get('repoDescription').value;
+    newRepo.registeredBy = this.authService.userEmail;
+    newRepo.datasourceType = 'aggregator';
+    newRepo.registered = true;
+
+    this.emittedInfo.emit(newRepo);
+
+    return newRepo;
+  }
+
 }
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-info-form.component.html
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-info-form.component.html	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-info-form.component.html	(revision 50977)
@@ -4,32 +4,30 @@
   </div>
   <div class="whiteFilm"></div>
 </div>
-<form [formGroup]="updateGroup" *ngIf="selectedRepo">
+<div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div>
+<div *ngIf="successMessage" class="uk-alert uk-alert-success">{{ successMessage }}</div>
+<form *ngIf="selectedRepo" [formGroup]="updateGroup">
   <div>
     <h4 class="uk-h4 uk-text-primary uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="">
       Basic information
     </h4>
   </div>
-  <div *ngIf="errorMessage" class="uk-alert uk-alert-danger">{{ errorMessage }}</div>
-  <div *ngIf="successMessage" class="uk-alert uk-alert-success">{{ successMessage }}</div>
-  <div class="uk-alert uk-alert-warning">
-    The following fields are completed by {{ sourceTitle }}.<br>
-    If you want to edit them, you can do it by using this
-    <a href="{{ sourceLinkToRepo }}" target="_blank">{{ sourceTitle }} link</a>
-  </div>
   <form-inline [description]="softwarePlatformDesc">
     <select formControlName="softwarePlatform" class="form-control">
-<!--      <option value="" selected>[Other] (enter name below)</option>-->
+<!--      <option value="" selected>[Other] (enter name below)</option> RESTORE AFTER getTypologies begins to work-->
       <option *ngFor="let platform of typologies" value="{{ platform.value }}">{{ platform.name }}</option>
     </select>
   </form-inline>
   <form-inline [description]="platformNameDesc">
+    <span *ngIf="group.get('platformName').touched && group.get('platformName').value"
+          class="help-block inline"
+          style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">This value will be used as the platform for your repository</span>
     <input formControlName="platformName" class="form-control" style="" type="text">
   </form-inline>
   <form-inline [description]="officialNameDesc" >
     <input formControlName="officialName" class="form-control" style="" type="text">
   </form-inline>
-  <div *ngIf="isJournal">
+  <div *ngIf="selectedRepo.datasourceType == 'journal'">
     <form-inline [description]="issnDesc" [valid]="group.get('issn').valid">
       <span *ngIf="group.get('issn').invalid && group.get('issn').touched && group.get('issn').dirty"
             class="help-block inline"
@@ -55,7 +53,7 @@
   <form-inline [description]="countryDesc">
     <select formControlName="country" class="form-control">
       <option value="">-- none selected --</option>
-      <option *ngFor="let country of countries" value="{{country.code}}">{{ country.name }}</option>
+      <option *ngFor="let country of countries" value="{{country.code}}" title="{{country.name}}">{{ country.name }}</option>
     </select>
   </form-inline>
   <form-inline [description]="longtitudeDesc" [valid]="updateGroup.get('longtitude').valid">
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/journal-info-form.component.html
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/journal-info-form.component.html	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/journal-info-form.component.html	(revision 50977)
@@ -11,9 +11,6 @@
       <option *ngFor="let platform of typologies" value="{{ platform.value }}">{{ platform.name }}</option>
     </select>
   </form-inline>
-  <form-inline [description]="platformNameDesc" [valid]="group.get('platformName').valid">
-    <input formControlName="platformName" class="form-control" type="text">
-  </form-inline>
   <form-inline [description]="officialNameDesc"  [valid]="group.get('officialName').valid">
     <input formControlName="officialName" class="form-control" type="text">
   </form-inline>
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-info-form.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-info-form.component.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-info-form.component.ts	(revision 50977)
@@ -2,12 +2,12 @@
 import {
   formErrorRequiredFields,
   formErrorWasntSaved,
-  formInfoLoading,
-  formSuccessUpdatedRepo,
+  formInfoLoading, formSubmitting,
+  formSuccessUpdatedRepo, loadingRepoError,
   noServiceMessage
 } from '../../../domain/shared-messages';
 import { RepositoryService } from "../../../services/repository.service";
-import { FormBuilder, FormGroup, Validators } from '@angular/forms';
+import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
 import { Country, Repository } from '../../../domain/typeScriptClasses';
 import { typologies } from '../../../domain/typologies';
 import { timezones } from '../../../domain/timezones';
@@ -26,7 +26,7 @@
   logoUrlDesc,
   timezoneDesc,
   datasourceTypeDesc,
-  adminEmailDesc
+  adminEmailDesc, lissnDesc, eissnDesc, issnDesc
 } from '../../../domain/oa-description';
 
 @Component ({
@@ -39,8 +39,6 @@
   errorMessage: string;
   successMessage: string;
   loadingMessage: string;
-  sourceTitle: string;
-  sourceLinkToRepo: string;
 
   typologies = typologies;
   timezones = timezones;
@@ -50,7 +48,6 @@
 
   selectedRepo: Repository;
   id: string;
-  source: string;
 
 
   @Input() datasourceId: string;
@@ -57,7 +54,7 @@
 
   @Input() showButton: boolean;
 
-  @Output() emittedInfo: EventEmitter<string[]> = new EventEmitter();
+  @Output() emittedInfo: EventEmitter<Repository> = new EventEmitter();
 
   updateGroup: FormGroup;
   readonly updateGroupDefinition = {
@@ -64,6 +61,9 @@
     softwarePlatform : '',
     platformName : '',
     officialName : ['', Validators.required],
+    issn : ['', [Validators.minLength(8), Validators.maxLength(8)]],
+    eissn : ['', [Validators.minLength(8), Validators.maxLength(8)]],
+    lissn : ['', [Validators.minLength(8), Validators.maxLength(8)]],
     repoDescription : ['', Validators.required],
     country : ['', Validators.required],
     longtitude : ['', [Validators.required, Validators.maxLength(9), Validators.min(-180), Validators.max(180)] ],
@@ -80,6 +80,9 @@
   softwarePlatformDesc : Description = softwarePlatformDesc;
   platformNameDesc : Description = platformNameDesc;
   officialNameDesc : Description = officialNameDesc;
+  issnDesc : Description = issnDesc;
+  eissnDesc : Description = eissnDesc;
+  lissnDesc : Description = lissnDesc;
   repoDescriptionDesc : Description = repoDescriptionDesc;
   countryDesc : Description = countryDesc;
   longtitudeDesc : Description = longtitudeDesc;
@@ -101,6 +104,11 @@
     this.loadForm();
   }
 
+  loadForm() {
+    this.updateGroup = this.fb.group(this.updateGroupDefinition, {validator: checkPlatform});
+    this.getRepo();
+  }
+
   getRepo() {
     this.loadingMessage = formInfoLoading;
     if (this.datasourceId) {
@@ -107,69 +115,51 @@
       this.repoService.getRepositoryById(this.datasourceId).subscribe(
         repo => {
           this.selectedRepo = repo;
-          if (this.selectedRepo) {
-            this.updateGroup.setValue({
-              softwarePlatform: this.selectedRepo.typology,
-              platformName: '',
-              officialName: this.selectedRepo.officialName,
-              repoDescription: this.selectedRepo.description,
-              country: this.selectedRepo.countryCode,
-              longtitude: this.selectedRepo.longitude,
-              latitude: this.selectedRepo.latitude,
-              websiteUrl: this.selectedRepo.websiteUrl,
-              institutionName: this.selectedRepo.organization,
-              englishName: this.selectedRepo.englishName,
-              logoUrl: this.selectedRepo.logoUrl,
-              timezone: this.selectedRepo.timezone,
-              datasourceType: this.selectedRepo.datasourceClass,
-              adminEmail: this.selectedRepo.contactEmail
-            });
-            if (this.updateGroup.get('softwarePlatform').value == '') {
-              this.updateGroup.setValue({platformName: this.selectedRepo.typology});
-            }
-          }
-
-          this.setUpSourceInfo();
-          this.getDatasourceClasses();
         },
         error => {
           console.log(error);
           this.loadingMessage = '';
+          this.errorMessage = loadingRepoError;
         },
         () => {
+          this.setupUpdateForm();
+          this.getDatasourceClasses();
           this.getCountries();
+          this.emittedInfo.emit(this.selectedRepo);
           this.loadingMessage = '';
-          this.emittedInfo.emit([this.selectedRepo.id,this.selectedRepo.datasourceType]);
         }
       );
     }
   }
 
-  setUpSourceInfo() {
-    this.source = this.selectedRepo.datasourceType;
-  }
-
-
-  loadForm() {
-    this.updateGroup = this.fb.group(this.updateGroupDefinition);
-    this.getRepo();
-  }
-
-
-  updateRepo(): boolean {
-    if(this.updateGroup.valid){
-/*
-        if (!this.updateEnglishName()) {
-          return false;
-        }
-*/
-        this.successMessage = formSuccessUpdatedRepo;
-        this.errorMessage = '';
-        return true;
-    } else {
-      this.errorMessage = formErrorRequiredFields;
-      this.successMessage = '';
-      return false;
+  setupUpdateForm(){
+    if (this.selectedRepo) {
+      this.updateGroup.setValue({
+        softwarePlatform: this.selectedRepo.typology,
+        platformName: '',
+        officialName: this.selectedRepo.officialName,
+        repoDescription: this.selectedRepo.description,
+        country: this.selectedRepo.countryCode,
+        longtitude: this.selectedRepo.longitude,
+        latitude: this.selectedRepo.latitude,
+        websiteUrl: this.selectedRepo.websiteUrl,
+        institutionName: this.selectedRepo.organization,
+        englishName: this.selectedRepo.englishName,
+        logoUrl: this.selectedRepo.logoUrl,
+        timezone: this.selectedRepo.timezone,
+        datasourceType: this.selectedRepo.datasourceClass,
+        adminEmail: this.selectedRepo.contactEmail
+      });
+      if (this.updateGroup.get('softwarePlatform').value == '') {
+        this.updateGroup.setValue({platformName: this.selectedRepo.typology});
+      }
+      if (this.selectedRepo.datasourceType == 'journal') {
+        this.updateGroup.setValue({
+          issn: this.selectedRepo.issn,
+          eissn: this.selectedRepo.eissn,
+          lissn: this.selectedRepo.lissn
+        });
+      }
     }
   }
 
@@ -192,7 +182,7 @@
   }
 
   getDatasourceClasses() {
-    this.repoService.getDatasourceClasses(this.source).subscribe(
+    this.repoService.getDatasourceClasses(this.selectedRepo.datasourceType).subscribe(
       classes => this.datasourceClasses = classes,
       error => {
         this.errorMessage = noServiceMessage;
@@ -206,7 +196,78 @@
     );
   }
 
-  updateEnglishName(){
+  updateRepo(): boolean {
+    let result: boolean;
+    this.errorMessage = '';
+    this.loadingMessage = '';
+    this.successMessage = '';
+
+    if (this.updateGroup.valid) {
+      if ( this.selectedRepo.datasourceType != 'journal' || this.updateGroup.get('issn').value ) {
+        this.refreshSelectedRepo();
+        this.loadingMessage = formSubmitting;
+        this.errorMessage = '';
+        this.repoService.updateRepository(this.selectedRepo).subscribe(
+          response => {
+            console.log(`updateRepository responded: ${response}`);
+            if (response == '200') {
+              result = true;
+            } else {
+              result = false;
+            }
+          },
+          error => {
+            console.log(error);
+            this.errorMessage = formErrorWasntSaved;
+          },
+          () => {
+            this.loadingMessage = '';
+            if (result) {
+              this.successMessage = formSuccessUpdatedRepo;
+              this.emittedInfo.emit(this.selectedRepo);
+            } else {
+              this.errorMessage = formErrorWasntSaved;
+            }
+          }
+        );
+      } else {
+        this.errorMessage = formErrorRequiredFields;
+        result = false;
+      }
+    } else {
+      this.errorMessage = formErrorRequiredFields;
+      result = false;
+    }
+    return result;
+  }
+
+  refreshSelectedRepo() {
+    if (this.updateGroup.get('platformName').value.trim() ) {
+      this.selectedRepo.typology = this.updateGroup.get('platformName').value;
+    } else if (this.updateGroup.get('softwarePlatform').value){
+      this.selectedRepo.typology = this.updateGroup.get('softwarePlatform').value;
+    }
+    this.selectedRepo.officialName = this.updateGroup.get('officialName').value;
+    this.selectedRepo.description = this.updateGroup.get('repoDescription').value;
+    this.selectedRepo.countryCode = this.updateGroup.get('country').value;
+    this.selectedRepo.countryName = this.countries.filter(x => x.code == this.updateGroup.get('country').value)[0].name;
+    this.selectedRepo.longitude = this.updateGroup.get('longtitude').value;
+    this.selectedRepo.latitude = this.updateGroup.get('latitude').value;
+    this.selectedRepo.websiteUrl = this.updateGroup.get('websiteUrl').value;
+    this.selectedRepo.organization = this.updateGroup.get('institutionName').value;
+    this.selectedRepo.englishName = this.updateGroup.get('englishName').value;
+    this.selectedRepo.logoUrl = this.updateGroup.get('logoUrl').value;
+    this.selectedRepo.timezone = this.updateGroup.get('timezone').value;
+    this.selectedRepo.datasourceClass = this.updateGroup.get('datasourceType').value;
+    this.selectedRepo.contactEmail = this.updateGroup.get('adminEmail').value;
+    if (this.selectedRepo.datasourceType == 'journal') {
+        this.selectedRepo.issn = this.updateGroup.get('issn').value;
+        this.selectedRepo.eissn = this.updateGroup.get('eissn').value;
+        this.selectedRepo.lissn = this.updateGroup.get('lissn').value;
+    }
+  }
+
+  updateEnglishName() {
     let status: boolean;
     this.repoService.updateEnglishName(this.selectedRepo.id,this.updateGroup.get('englishName').value).subscribe(
       response => {
@@ -223,3 +284,9 @@
   }
 
 }
+
+export function checkPlatform(c: AbstractControl) {
+  if ( c.get('softwarePlatform').value || c.get('platformName').value )
+    return null;
+  return 'invalid';
+}
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/journal-info-form.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/journal-info-form.component.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/journal-info-form.component.ts	(revision 50977)
@@ -2,7 +2,7 @@
 *  created by myrto on 1/22/2018
 */
 
-import { Component, OnInit } from '@angular/core';
+import { Component, EventEmitter, OnInit, Output } from '@angular/core';
 import {
   formErrorInvalidFields, formErrorRequiredFields, formErrorWasntSaved, formSuccessRegisteredDatasource,
   noServiceMessage
@@ -15,7 +15,6 @@
 import {
   Description,
   softwarePlatformDesc,
-  platformNameDesc,
   officialNameDesc,
   issnDesc,
   eissnDesc,
@@ -33,6 +32,7 @@
   adminEmailDesc
 } from '../../../domain/oa-description';
 import { ValidatorService } from '../../../services/validator.service';
+import { AuthenticationService } from '../../../services/authentication.service';
 
 @Component ({
   selector: 'journal-info-form',
@@ -50,12 +50,11 @@
   datasourceClasses: Map<string,string> = new Map<string,string>();
   classCodes: string[] = [];
 
-  newDatasource: Repository;
+  @Output() emittedInfo: EventEmitter<Repository> = new EventEmitter();
 
   group: FormGroup;
   readonly groupDefinition = {
     softwarePlatform : '',
-    platformName : '',
     officialName : ['', Validators.required],
     issn : ['', [Validators.required, Validators.minLength(8), Validators.maxLength(8)]],
     eissn : ['', [Validators.minLength(8), Validators.maxLength(8)]],
@@ -74,7 +73,6 @@
   };
 
   softwarePlatformDesc : Description = softwarePlatformDesc;
-  platformNameDesc : Description = platformNameDesc;
   officialNameDesc : Description = officialNameDesc;
   issnDesc : Description = issnDesc;
   eissnDesc : Description = eissnDesc;
@@ -93,7 +91,8 @@
 
   constructor(
     private fb: FormBuilder,
-    private repoService: RepositoryService
+    private repoService: RepositoryService,
+    private authService: AuthenticationService
   ) {}
 
   ngOnInit() {
@@ -141,85 +140,7 @@
 
   registerDatasource(): boolean {
     if(this.group.valid){
-      let newRepo: Repository = {
-        id: '',
-        officialName: this.group.get('officialName').value,
-        englishName: this.group.get('englishName').value,
-        websiteUrl: this.group.get('websiteUrl').value,
-        logoUrl: this.group.get('logoUrl').value,
-        contactEmail: this.group.get('adminEmail').value,
-        countryName: this.group.get('country').value,
-        countryCode: null, //this.group.get('officialName').value,
-        organization: null,
-        latitude: this.group.get('latitude').value,
-        longitude: this.group.get('longtitude').value,
-        timezone: this.group.get('timezone').value,
-        namespacePrefix: '',
-        odNumberOfItems: '',
-        odNumberOfItemsDate: null,
-        odPolicies: '',
-        odLanguages: '',
-        odContentTypes: '',
-        collectedFrom: '',
-        inferred: null,
-        deletedByInference: null,
-        trust: 0,
-        inferenceProvenance: '',
-        dateOfValidation: null,
-        datasourceClass: this.group.get('journalType').value,
-        provenanceActionClass: '',
-        dateOfCollection: null,
-        typology: this.group.get('softwarePlatform').value,
-        activationId: '',
-        mergehomonyms: null,
-        description: this.group.get('repoDescription').value,
-        releaseStartDate: null,
-        releaseEndDate: null,
-        missionStatementUrl: '',
-        dataProvider: null,
-        serviceProvider: null,
-        databaseAccessType: '',
-        dataUploadType: '',
-        databaseAccessRestriction: '',
-        dataUploadRestriction: '',
-        versioning: null,
-        citationGuidelineUrl: '',
-        qualityManagementKind: '',
-        pidSystems: '',
-        certificates: '',
-        aggregator: '',
-        issn: this.group.get('issn').value,
-        eissn: this.group.get('eissn').value,
-        lissn: this.group.get('lissn').value,
-        interfaces: [],
-        availableDiskSpace: '',
-        securityParameters: '',
-        protocol: 'oai',
-        registeredBy: 'ant.lebesis@gmail.com',
-        datasourceType: 'journal',
-        datasourceAggregatorId: null,
-        datasourceOriginalIdValue: null,
-        datasourceOriginalIdProvenance: '',
-        datasourceAggregated: false,
-        datasourceComplianceDegreeValue: '',
-        datasourceComplianceDegreeEncoding: '',
-        numberOfObjects: 0,
-        maxSizeOfDatastructure: 0,
-        maxNumberOfDataStructures: 0,
-        registered: true,
-        extraFields: {  },
-        piwikInfo: null,
-        environments: [],
-        registrationDate: null,
-        verified: false,
-        dataCollectionTypes: [],
-        resourceId: '',
-        resourceUri: '',
-        resourceKind: '',
-        resourceType: '',
-        dateOfCreation: null,
-
-    };
+      let newRepo = this.createNewRepository();
       this.repoService.addRepository('journal',newRepo).subscribe(
         response => console.log(`${JSON.stringify(response)}`),
         error => console.log(error)
@@ -250,5 +171,34 @@
     return status;
   }
 
+  createNewRepository(): Repository {
+    let newRepo: Repository = new Repository();
+    newRepo.dateOfCreation = new Date(Date.now());
+    newRepo.officialName = this.group.get('officialName').value;
+    newRepo.englishName = this.group.get('englishName').value;
+    newRepo.websiteUrl = this.group.get('websiteUrl').value;
+    newRepo.logoUrl = this.group.get('logoUrl').value;
+    newRepo.contactEmail = this.group.get('adminEmail').value;
+    newRepo.countryName = this.countries.filter(x => x.code == this.group.get('country').value)[0].name;
+    newRepo.countryCode = this.group.get('country').value;
+    newRepo.organization = this.group.get('institutionName').value;
+    newRepo.latitude = this.group.get('latitude').value;
+    newRepo.longitude = this.group.get('longtitude').value;
+    newRepo.timezone = this.group.get('timezone').value;
+    newRepo.datasourceClass = this.group.get('journalType').value;
+    newRepo.typology = this.group.get('softwarePlatform').value;
+    newRepo.description = this.group.get('repoDescription').value;
+    newRepo.issn = this.group.get('issn').value;
+    newRepo.eissn = this.group.get('eissn').value;
+    newRepo.lissn = this.group.get('lissn').value;
+    newRepo.registeredBy = this.authService.userEmail;
+    newRepo.datasourceType = 'journal';
+    newRepo.registered = true;
 
+    this.emittedInfo.emit(newRepo);
+
+    return newRepo;
+  }
+
+
 }
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-interface-form.component.html
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-interface-form.component.html	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-forms/datasource-interface-form.component.html	(revision 50977)
@@ -6,6 +6,12 @@
       <h5>OpenDOAR Interface (non-removable)</h5>
     </div>
   </div>
+  <div *ngIf="loadingMessage" class="loading-big">
+    <div class="loader-big" style="text-align: center; padding-top: 170px; color: rgb(47, 64, 80); font-weight: bold;">
+      {{ loadingMessage }}
+    </div>
+    <div class="whiteFilm"></div>
+  </div>
   <div *ngIf="group">
     <div [formGroup]="group">
       <div *ngIf="successMessage" class="uk-alert uk-alert-success">{{ successMessage }}</div>
@@ -27,7 +33,7 @@
         </div>
         <select id="selectValidationSet{{index}}" formControlName="selectValidationSet" class="form-control" >
           <option value="" selected>-- none selected --</option>
-          <option *ngFor="let set of valset" value="{{set}}">{{set}}</option>
+          <option *ngFor="let set of valsetList" value="{{set}}">{{set}}</option>
         </select>
         <div>
           <label class="uk-button validationSetRadio" for="customRadio{{index}}">
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-update-repo.component.html
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-update-repo.component.html	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-update-repo.component.html	(revision 50977)
@@ -20,11 +20,11 @@
             <div *ngIf="repoId">
               <datasource-info-form [datasourceId]="repoId"
                                     [showButton]=true
-                                    (emittedInfo)="getExportedData($event)"></datasource-info-form>
+                                    (emittedInfo)="getCurrentRepo($event)"></datasource-info-form>
             </div>
           </li>
           <li class="el-item">
-            <div *ngIf="loadInterfaces" class="uk-width-1-1@m uk-first-column">
+            <div *ngIf="repoInterfaces && repo" class="uk-width-1-1@m uk-first-column">
               <form [formGroup]="group">
                 <form-repeat [component]="updateDatasourceInterfaces"
                              [parentGroup]="group"
@@ -31,7 +31,7 @@
                              [description]="interfaceFormDesc"
                              [name]="'datasource-interface-form'"
                              [data]="repoInterfaces"
-                             [otherData]="exportedData">
+                             [otherData]="repo">
                 </form-repeat>
               </form>
             </div>
Index: modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-update-repo.component.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-update-repo.component.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-update-repo.component.ts	(revision 50977)
@@ -1,7 +1,7 @@
 import { Component, OnInit, Type } from '@angular/core';
 import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
 import { DatasourceInterfaceFormComponent } from './sources-forms/datasource-interface-form.component';
-import { RepositoryInterface } from '../../domain/typeScriptClasses';
+import { Repository, RepositoryInterface } from '../../domain/typeScriptClasses';
 import { RepositoryService } from '../../services/repository.service';
 import { ActivatedRoute } from '@angular/router';
 import {
@@ -8,7 +8,6 @@
   Description,
   interfaceFormDesc,
 } from '../../domain/oa-description';
-import { Subject } from 'rxjs/Subject';
 
 
 
@@ -20,6 +19,7 @@
 export class SourcesUpdateRepoComponent implements OnInit {
 
   repoId: string;
+  repo: Repository;
   repoInterfaces: RepositoryInterface[] = [];
   loadInterfaces: boolean;
 
@@ -26,7 +26,6 @@
   group: FormGroup;
   interfaceFormDesc: Description = interfaceFormDesc;
   updateDatasourceInterfaces: Type<any> = DatasourceInterfaceFormComponent;
-  exportedData: string[];
 
   constructor (
     private fb: FormBuilder,
@@ -58,24 +57,9 @@
     );
   }
 
-  getExportedData(data: string[]) {
-    this.exportedData = data;
+  getCurrentRepo(repo: Repository) {
+    this.repo = repo;
   }
 
-  loadInterfacesTab() {
-      this.getRepoInterfaces();
-/*      console.log("PATCHING");
-      let patched = [];
-      this.repoInterfaces.forEach(item => {
-        patched.push({
-          baseUrl : item.baseUrl,
-          selectValidationSet : item.accessSet,
-          compatibilityLevel : item.desiredCompatibilityLevel
-        });
-      });
-      this.group.patchValue(patched);
-      console.log(`PATCHED: ${JSON.stringify(patched)}`);*/
-  }
 
-
 }
Index: modules/uoa-repository-dashboard-gui/trunk/app/services/repository.service.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/services/repository.service.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/services/repository.service.ts	(revision 50977)
@@ -33,6 +33,25 @@
       .catch(this.handleError);
   }
 
+  updateInterface(interfaceInfo: RepositoryInterface): Observable<string> {
+    let url = `${this.apiUrl}updateInterface`;
+    console.log(`knocking on: ${url}`);
+    console.log(`sending ${JSON.stringify(interfaceInfo)}`);
+    httpOptions.withCredentials = true;
+    return this.http.post(url,interfaceInfo,httpOptions)
+      .map( res => res.status.toString())
+      .catch(this.handleError);
+  }
+
+  deleteInterface(id: string): Observable<string> {
+    let url = `${this.apiUrl}deleteInterface/${id}`;
+    console.log(`knocking on: ${url}`);
+    httpOptions.withCredentials = true;
+    return this.http.delete(url,httpOptions)
+      .map( res => res.status.toString() )
+      .catch(this.handleError);
+  }
+
   addRepository(datatype: string, newRepository: Repository): Observable<Repository> {
     let url = `${this.apiUrl}addRepository?datatype=${datatype}`;
     console.log(`knocking on: ${url}`);
@@ -43,12 +62,13 @@
       .catch(this.handleError);
   }
 
-  deleteInterface(id: string): Observable<string> {
-    let url = `${this.apiUrl}deleteInterface/${id}`;
+  updateRepository(repoInfo: Repository): Observable<string> {
+    let url = `${this.apiUrl}updateRepository`;
     console.log(`knocking on: ${url}`);
+    console.log(`sending ${JSON.stringify(repoInfo)}`);
     httpOptions.withCredentials = true;
-    return this.http.delete(url,httpOptions)
-      .map( res => res.status.toString() )
+    return this.http.post(url,repoInfo,httpOptions)
+      .map( res => res.status.toString())
       .catch(this.handleError);
   }
 
Index: modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-group.interface.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-group.interface.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-group.interface.ts	(revision 50977)
@@ -27,7 +27,7 @@
 
   @Input() public data : any = null;
 
-  @Input() public otherData: any[];
+  @Input() public otherData: any;
 
   public patchData : Subject<any> = new Subject();
 
Index: modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-array.interface.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-array.interface.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-array.interface.ts	(revision 50977)
@@ -101,7 +101,7 @@
 /*    (<FormGroup>this.parentGroup).addControl(<string>this.name, this._fb.array([]));
     !this.initEmpty && this.createView();
     this.parentGroup.get(this.name as string).patchValue = this.patchValue();*/
-    if (this.data) {
+    if (this.data && this.data.length) {
       for (let i=0; i<this.data.length; i++ ) {
         !this.initEmpty && this.createView();
         this.parentGroup.get(this.name as string).patchValue = this.patchValue();
Index: modules/uoa-repository-dashboard-gui/trunk/app/domain/shared-messages.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/domain/shared-messages.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/domain/shared-messages.ts	(revision 50977)
@@ -64,6 +64,7 @@
 
 /* Forms validation Messages */
 export const formInfoLoading = 'Loading information';
+export const formSubmitting = 'Saving changes ...';
 export const formErrorRequiredFields = 'All the fields marked with (*) are mandatory';
 export const formErrorInvalidFields = 'There are invalid fields';
 export const formErrorWasntSaved = 'There was a problem with the form submission';
Index: modules/uoa-repository-dashboard-gui/trunk/app/domain/typeScriptClasses.ts
===================================================================
--- modules/uoa-repository-dashboard-gui/trunk/app/domain/typeScriptClasses.ts	(revision 50976)
+++ modules/uoa-repository-dashboard-gui/trunk/app/domain/typeScriptClasses.ts	(revision 50977)
@@ -52,11 +52,11 @@
 }
 
 export class DriverResource implements Serializable {
-    resourceId: string;
-    resourceUri: string;
-    resourceKind: string;
-    resourceType: string;
-    dateOfCreation: Date;
+    resourceId: string = null;
+    resourceUri: string = null;
+    resourceKind: string = null;
+    resourceType: string = null;
+    dateOfCreation: Date = null;
 }
 
 export class MDFormatDataStructure extends DriverResource {
@@ -80,77 +80,77 @@
 }
 
 export class Repository extends DriverResource implements IsSerializable {
-    id: string;
-    officialName: string;
-    englishName: string;
-    websiteUrl: string;
-    logoUrl: string;
-    contactEmail: string;
-    countryName: string;
-    countryCode: string;
-    organization: string;
-    latitude: number;
-    longitude: number;
-    timezone: number;
-    namespacePrefix: string;
-    odNumberOfItems: string;
-    odNumberOfItemsDate: string;
-    odPolicies: string;
-    odLanguages: string;
-    odContentTypes: string;
-    collectedFrom: string;
-    inferred: boolean;
-    deletedByInference: boolean;
-    trust: number;
-    inferenceProvenance: string;
-    dateOfValidation: Date;
-    datasourceClass: string;
-    provenanceActionClass: string;
-    dateOfCollection: Date;
-    typology: string;
-    activationId: string;
-    mergehomonyms: boolean;
-    description: string;
-    releaseStartDate: Date;
-    releaseEndDate: Date;
-    missionStatementUrl: string;
-    dataProvider: boolean;
-    serviceProvider: boolean;
-    databaseAccessType: string;
-    dataUploadType: string;
-    databaseAccessRestriction: string;
-    dataUploadRestriction: string;
-    versioning: boolean;
-    citationGuidelineUrl: string;
-    qualityManagementKind: string;
-    pidSystems: string;
-    certificates: string;
-    aggregator: string;
-    issn: string;
-    eissn: string;
-    lissn: string;
-    interfaces: RepositoryInterface[];
-    availableDiskSpace: string;
-    securityParameters: string;
-    protocol: string;
-    registeredBy: string;
-    datasourceType: string;
-    datasourceAggregatorId: string;
-    datasourceOriginalIdValue: string;
-    datasourceOriginalIdProvenance: string;
-    datasourceAggregated: boolean;
-    datasourceComplianceDegreeValue: string;
-    datasourceComplianceDegreeEncoding: string;
-    numberOfObjects: number;
-    maxSizeOfDatastructure: number;
-    maxNumberOfDataStructures: number;
-    registered: boolean;
-    extraFields: { [index: string]: string };
-    piwikInfo: PiwikInfo;
-    environments: string[];
-    registrationDate: Date;
-    verified: boolean;
-    dataCollectionTypes: DataCollectionType[];
+    id: string = null;
+    officialName: string = null;
+    englishName: string = null;
+    websiteUrl: string = null;
+    logoUrl: string = null;
+    contactEmail: string = null;
+    countryName: string = null;
+    countryCode: string = null;
+    organization: string = null;
+    latitude: number = null;
+    longitude: number = null;
+    timezone: number = null;
+    namespacePrefix: string = null;
+    odNumberOfItems: string = null;
+    odNumberOfItemsDate: string = null;
+    odPolicies: string = null;
+    odLanguages: string = null;
+    odContentTypes: string = null;
+    collectedFrom: string = null;
+    inferred: boolean = null;
+    deletedByInference: boolean = null;
+    trust: number = 0;
+    inferenceProvenance: string = null;
+    dateOfValidation: Date = null;
+    datasourceClass: string = null;
+    provenanceActionClass: string = null;
+    dateOfCollection: Date = null;
+    typology: string = null;
+    activationId: string = null;
+    mergehomonyms: boolean = null;
+    description: string = null;
+    releaseStartDate: Date = null;
+    releaseEndDate: Date = null;
+    missionStatementUrl: string = null;
+    dataProvider: boolean = null;
+    serviceProvider: boolean = null;
+    databaseAccessType: string = null;
+    dataUploadType: string = null;
+    databaseAccessRestriction: string = null;
+    dataUploadRestriction: string = null;
+    versioning: boolean = null;
+    citationGuidelineUrl: string = null;
+    qualityManagementKind: string = null;
+    pidSystems: string = null;
+    certificates: string = null;
+    aggregator: string = null;
+    issn: string = null;
+    eissn: string = null;
+    lissn: string = null;
+    interfaces: RepositoryInterface[] = [];
+    availableDiskSpace: string = null;
+    securityParameters: string = null;
+    protocol: string = 'oai';
+    registeredBy: string = null;
+    datasourceType: string = null;
+    datasourceAggregatorId: string = null;
+    datasourceOriginalIdValue: string = null;
+    datasourceOriginalIdProvenance: string = null;
+    datasourceAggregated: boolean = false;
+    datasourceComplianceDegreeValue: string = null;
+    datasourceComplianceDegreeEncoding: string = null;
+    numberOfObjects: number = null;
+    maxSizeOfDatastructure: number = null;
+    maxNumberOfDataStructures: number = null;
+    registered: boolean = null;
+    extraFields: { [index: string]: string } = null;
+    piwikInfo: PiwikInfo = null;
+    environments: string[] = null;
+    registrationDate: Date = null;
+    verified: boolean = false;
+    dataCollectionTypes: DataCollectionType[] = [];
 }
 
 export class RepositoryAccessProtocol {
@@ -177,27 +177,27 @@
 }
 
 export class RepositoryInterface implements Serializable, IsSerializable {
-    desiredCompatibilityLevel: string;
-    complianceName: string;
-    upgradeToV3: string;
-    deleteApi: boolean;
-    accessSet: string;
-    accessFormat: string;
-    metadataIdentifierPath: string;
-    lastCollectionDate: string;
-    nextScheduledExecution: string;
-    status: string;
-    collectedFrom: string;
-    id: string;
-    typology: string;
-    compliance: string;
-    contentDescription: string;
-    accessProtocol: string;
-    baseUrl: string;
-    active: boolean;
-    removable: boolean;
-    accessParams: { [index: string]: string };
-    extraFields: { [index: string]: string };
+    desiredCompatibilityLevel: string = '';
+    complianceName: string = null;
+    upgradeToV3: string = '';
+    deleteApi: boolean = false;
+    accessSet: string = '';
+    accessFormat: string = '';
+    metadataIdentifierPath: string = '';
+    lastCollectionDate: string = '';
+    nextScheduledExecution: string = '';
+    status: string = '';
+    collectedFrom: string = '';
+    id: string = '';
+    typology: string = '';
+    compliance: string = 'UNKNOWN';
+    contentDescription: string = '';
+    accessProtocol: string = 'oai';
+    baseUrl: string = '';
+    active: boolean = false;
+    removable: boolean = false;
+    accessParams: { [index: string]: string } = {};
+    extraFields: { [index: string]: string } = {};
 }
 
 export class SearchCriteriaImpl implements SearchCriteria {
