Search in sources :

Example 1 with WebsitesForm

use of org.orcid.pojo.ajaxForm.WebsitesForm in project ORCID-Source by ORCID.

the class WorkspaceController method getWebsitesFormJson.

/**
     * Retrieve all external identifiers as a json string
     * */
@RequestMapping(value = "/my-orcid/websitesForms.json", method = RequestMethod.GET)
@ResponseBody
public WebsitesForm getWebsitesFormJson(HttpServletRequest request) throws NoSuchRequestHandlingMethodException {
    ResearcherUrls rUrls = researcherUrlManager.getResearcherUrls(getCurrentUserOrcid(), getLastModifiedTime(getCurrentUserOrcid()));
    WebsitesForm form = WebsitesForm.valueOf(rUrls);
    //Set the default visibility
    ProfileEntity profile = profileEntityCacheManager.retrieve(getCurrentUserOrcid());
    if (profile != null && profile.getActivitiesVisibilityDefault() != null) {
        form.setVisibility(Visibility.valueOf(profile.getActivitiesVisibilityDefault()));
    }
    return form;
}
Also used : ResearcherUrls(org.orcid.jaxb.model.record_v2.ResearcherUrls) WebsitesForm(org.orcid.pojo.ajaxForm.WebsitesForm) ProfileEntity(org.orcid.persistence.jpa.entities.ProfileEntity) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

ResearcherUrls (org.orcid.jaxb.model.record_v2.ResearcherUrls)1 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)1 WebsitesForm (org.orcid.pojo.ajaxForm.WebsitesForm)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1