Project

General

Profile

« Previous | Next » 

Revision 43109

more for inline linking in publication landing page

View differences:

publication.component.ts
205 205
                            </a>
206 206
                          </dd>
207 207
                      </dl>
208
                        <a (click)="toggleClaimProject()">Add more Projects</a>
208
                        <button (click)="toggleClaimProject()"  class = "btn btn-default   btn-xs" >Add more Projects</button>
209 209
                        <inline-claim-project *ngIf="result "  inline="true" inlineType ="publication" [inlineEntity]="result"  (projectAdded)="projectAdded($event)" ></inline-claim-project>
210 210
                      </li>
211 211
                      <li class="list-group-item">
212
                        <a (click)=" claimInline=(claimInline=='context')?'none':'context'" >Add more Contexts</a>
212
                        <button (click)=" toggleClaimContext()" class = "btn btn-default   btn-xs" >Add Contexts</button>
213 213
                        <inline-claim-context *ngIf="result   "  inline="true" inlineType ="publication" [inlineEntity]="result"  ></inline-claim-context>
214 214
                      </li>
215 215

  
......
234 234
    this.params = _routeParams;
235 235
  }
236 236
  ngOnInit() {
237
    console.info('publication init');
238
    // let result_ = {id: this.params.get("articleId"), type :"publication", source : "openaire", title:"lalalla",url: null, result: null, accessRights:"OPEN", embargoEndDate: null};
239
    // this.result.push(result_);
240
    this.getPublicationInfo();
237
     this.getPublicationInfo();
241 238
}
242 239

  
243 240

  
244 241
  publicationInfo: PublicationInfo;
245 242
  params: RouteParams;
246 243

  
247
//AK - For the claims
248 244
  private result ;
249 245
  private claimInline:string = "none" ;
250 246

  
......
253 249

  
254 250

  
255 251
  getPublicationInfo() {
256
    console.info("inside getPublicationInfo of component");
257

  
258 252
    this._publicationService.getPublicationInfo(this.params.get("articleId")).subscribe(
259 253
      data => {
260 254
          this.publicationInfo = data;
261
          //AK - For the claims
262
          this.result = []
255
           this.result = []
263 256
          let result_  ={id: this.params.get("articleId"), type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''};
264 257
          this.result.push(result_);
265 258
      },
266 259
      err => console.error(err)
267 260
    );
268 261
   }
262

  
263
   /*
264
   ********* Methods for Inline Claim  of project / publication *****
265
     */
269 266
   toggleClaimProject(){
270
     console.info("TOOGLE ");
271
     this.inlineClaimProject.toggle();
267
      this.inlineClaimProject.toggle();
272 268
   }
273 269
   projectAdded($event){
274 270
     var projects =$event.value;
......
279 275
              this.publicationInfo.fundedByProjects = new Map<string, string[]>();
280 276
          }
281 277
          var project =projects[i];
282
          // this.publicationInfo.fundedByProjects.set(mydata.code, new Array<string>());
283
          // this.publicationInfo.fundedByProjects.get(mydata.code)[0] = mydata.acronym;
284
          // this.publicationInfo.fundedByProjects.get(mydata.code)[1] = mydata.title;
285
          // var project= { funderId: this.selectedFunderId,funderName: this.selectedFunderName, projectId: item.field[0]['@value'], projectName: item.field[3]['@value'] , projectAcronym: item.field[1]['@value'] };
286

  
287 278
          this.publicationInfo.fundedByProjects.set(project.projectId, new Array<string>());
288 279
          this.publicationInfo.fundedByProjects.get(project.projectId)[0] = project.projectAcronym;
289 280
          this.publicationInfo.fundedByProjects.get(project.projectId)[1] = project.projectName;
281
          this.publicationInfo.fundedByProjects.get(project.projectId)[2] =project.selectedFunderId;
282
          this.publicationInfo.fundedByProjects.get(project.projectId)[3] = project.selectedFunderName;
283
        }
284
      }
285
    }
286
    toggleClaimContext(){
287
       this.inlineClaimContext.toggle();
288
    }
289
    contextAdded($event){
290
      var contexts =$event.value;
291
      if(contexts){
292
         for(var i=0; i < contexts.length; i++){
290 293

  
291
                  // this.publicationInfo.fundedByProjects.get(mydata.code)[2] = mydata['funding']['funder'].shortname;
292
                  // this.publicationInfo.fundedByProjects.get(mydata.code)[3] = mydata['funding']['funder'].name;
293
                  this.publicationInfo.fundedByProjects.get(project.projectId)[2] =project.selectedFunderId;
294
                  this.publicationInfo.fundedByProjects.get(project.projectId)[3] = project.selectedFunderName;
295

  
294
          //  if(this.publicationInfo.fundedByProjects == undefined) {
295
          //      this.publicationInfo.fundedByProjects = new Map<string, string[]>();
296
          //  }
297
          //  var context =contexts[i];
298
          //  this.publicationInfo.fundedByProjects.set(project.projectId, new Array<string>());
299
          //  this.publicationInfo.fundedByProjects.get(project.projectId)[0] = project.projectAcronym;
300
          //  this.publicationInfo.fundedByProjects.get(project.projectId)[1] = project.projectName;
301
          //  this.publicationInfo.fundedByProjects.get(project.projectId)[2] =project.selectedFunderId;
302
          //  this.publicationInfo.fundedByProjects.get(project.projectId)[3] = project.selectedFunderName;
303
         }
304
       }
296 305
     }
297
   }
298
 }
299 306
}

Also available in: Unified diff