Search in sources :

Example 1 with OtherNamesForm

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

the class WorkspaceController method getOtherNamesFormJson.

@RequestMapping(value = "/my-orcid/otherNamesForms.json", method = RequestMethod.GET)
@ResponseBody
public OtherNamesForm getOtherNamesFormJson(HttpServletRequest request) throws NoSuchRequestHandlingMethodException {
    long lastModifiedTime = getLastModifiedTime(getCurrentUserOrcid());
    OtherNames otherNames = otherNameManager.getOtherNames(getCurrentUserOrcid(), lastModifiedTime);
    OtherNamesForm form = OtherNamesForm.valueOf(otherNames);
    //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 : OtherNamesForm(org.orcid.pojo.ajaxForm.OtherNamesForm) OtherNames(org.orcid.jaxb.model.record_v2.OtherNames) ProfileEntity(org.orcid.persistence.jpa.entities.ProfileEntity) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

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