Search in sources :

Example 1 with KeywordsForm

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

the class WorkspaceController method getKeywordsFormJson.

@RequestMapping(value = "/my-orcid/keywordsForms.json", method = RequestMethod.GET)
@ResponseBody
public KeywordsForm getKeywordsFormJson(HttpServletRequest request) throws NoSuchRequestHandlingMethodException {
    Keywords keywords = profileKeywordManager.getKeywords(getCurrentUserOrcid());
    KeywordsForm form = KeywordsForm.valueOf(keywords);
    // 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 : KeywordsForm(org.orcid.pojo.ajaxForm.KeywordsForm) Keywords(org.orcid.jaxb.model.v3.dev1.record.Keywords) ProfileEntity(org.orcid.persistence.jpa.entities.ProfileEntity) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

Keywords (org.orcid.jaxb.model.v3.dev1.record.Keywords)1 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)1 KeywordsForm (org.orcid.pojo.ajaxForm.KeywordsForm)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1