Project

General

Profile

« Previous | Next » 

Revision 54470

1. depositPublications.component: Change map url.
2. organization.service: Function 'getOrganizationNameAndUrlById()' to get name and url by id.
3. searchResult.ts: Add 'compatibilityUNKNOWN' field (boolean) used in dataprovider type.
4. fetchDataproviders.class: Add 'loadPaging' and 'oldTotalResults' fields in class and 'errorCodes.OUT_OF_BOUND' case.
5. searchDataproviders.service: Remove limits for compatibility | Initialize 'compatibilityUNKNOWN' field of searchResult class.
6. entitySearch.service: Remove limit for datasets' or publications' related organization.

View differences:

organization.service.ts
28 28

  
29 29
    }
30 30

  
31
    getOrganizationNameAndUrlById(id: string, properties: EnvProperties): any {
32
      console.info("getOrganizationNameById service");
33
      let url = properties.searchAPIURLLAst+"organizations/"+id+"?format=json";
34

  
35
      return this.http.get((properties.useCache) ? (properties.cacheUrl+encodeURIComponent(url)): url)
36
                  .map(res => <any> res.json())
37
                  .map(res => res['result']['metadata']['oaf:entity']['oaf:organization'])
38
                  .map(res => this.parseOrganizationNameAndUrl(res));
39
    }
40

  
31 41
    private handleError (error: Response) {
32 42
    // in a real world app, we may send the error to some remote logging infrastructure
33 43
    // instead of just logging it to the console
......
163 173

  
164 174
    }
165 175

  
176
    parseOrganizationNameAndUrl(organization: any): any {
177
      console.info("parseOrganizationNameAndUrl");
178
      let title: {"name": string, "url": string} = {"name": "", "url": ""};
179

  
180
      if(organization != null) {
181
        if(organization.hasOwnProperty("websiteurl")) {
182
            title = {"name": organization.legalshortname, "url": organization.websiteurl};
183
        } else {
184
            title = {"name": organization.legalshortname, "url": ''};
185
        }
186

  
187
        if(title.name == '') {
188
            title.name = organization.legalname;
189
        }
190
      }
191

  
192
      return title;
193
    }
194

  
166 195
}

Also available in: Unified diff