Search in sources :

Example 86 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility 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)

Example 87 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility in project ORCID-Source by ORCID.

the class MapperFacadeFactory method getAddressMapperFacade.

public MapperFacade getAddressMapperFacade() {
    MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
    ClassMapBuilder<Address, AddressEntity> addressClassMap = mapperFactory.classMap(Address.class, AddressEntity.class);
    addV3DateFields(addressClassMap);
    registerSourceConverters(mapperFactory, addressClassMap);
    addressClassMap.field("putCode", "id");
    addressClassMap.field("country.value", "iso2Country");
    addressClassMap.field("visibility", "visibility");
    addressClassMap.fieldBToA("displayIndex", "displayIndex");
    addressClassMap.byDefault();
    addressClassMap.register();
    return mapperFactory.getMapperFacade();
}
Also used : Address(org.orcid.jaxb.model.v3.dev1.record.Address) DefaultMapperFactory(ma.glasnost.orika.impl.DefaultMapperFactory) DefaultMapperFactory(ma.glasnost.orika.impl.DefaultMapperFactory) MapperFactory(ma.glasnost.orika.MapperFactory) AddressEntity(org.orcid.persistence.jpa.entities.AddressEntity)

Example 88 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility in project ORCID-Source by ORCID.

the class OrcidSecurityManagerTestBase method createQualificationSummary.

protected QualificationSummary createQualificationSummary(Visibility v, String sourceId) {
    QualificationSummary e = new QualificationSummary();
    e.setVisibility(v);
    setSource(e, sourceId);
    return e;
}
Also used : QualificationSummary(org.orcid.jaxb.model.v3.dev1.record.summary.QualificationSummary)

Example 89 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility in project ORCID-Source by ORCID.

the class OrcidSecurityManagerTestBase method createWorkSummary.

protected WorkSummary createWorkSummary(Visibility v, String sourceId, String extIdValue) {
    WorkSummary work = new WorkSummary();
    work.setVisibility(v);
    ExternalID extId = new ExternalID();
    extId.setValue(extIdValue);
    ExternalIDs extIds = new ExternalIDs();
    extIds.getExternalIdentifier().add(extId);
    work.setExternalIdentifiers(extIds);
    addSharedExtId(extIds);
    setSource(work, sourceId);
    return work;
}
Also used : WorkSummary(org.orcid.jaxb.model.v3.dev1.record.summary.WorkSummary) ExternalIDs(org.orcid.jaxb.model.v3.dev1.record.ExternalIDs) ExternalID(org.orcid.jaxb.model.v3.dev1.record.ExternalID)

Example 90 with Visibility

use of org.orcid.jaxb.model.v3.dev1.common.Visibility in project ORCID-Source by ORCID.

the class OrcidSecurityManagerTestBase method createEmploymentSummary.

protected EmploymentSummary createEmploymentSummary(Visibility v, String sourceId) {
    EmploymentSummary e = new EmploymentSummary();
    e.setVisibility(v);
    setSource(e, sourceId);
    return e;
}
Also used : EmploymentSummary(org.orcid.jaxb.model.v3.dev1.record.summary.EmploymentSummary)

Aggregations

Visibility (org.orcid.jaxb.model.v3.dev1.common.Visibility)44 ClientResponse (com.sun.jersey.api.client.ClientResponse)17 Test (org.junit.Test)17 ExternalID (org.orcid.jaxb.model.v3.dev1.record.ExternalID)14 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)12 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)12 Url (org.orcid.jaxb.model.v3.dev1.common.Url)11 OrcidError (org.orcid.jaxb.model.v3.dev1.error.OrcidError)11 ExternalIDs (org.orcid.jaxb.model.v3.dev1.record.ExternalIDs)11 SourceEntity (org.orcid.persistence.jpa.entities.SourceEntity)11 HashMap (java.util.HashMap)10 ProfileEntity (org.orcid.persistence.jpa.entities.ProfileEntity)10 Name (org.orcid.jaxb.model.v3.dev1.record.Name)7 OtherName (org.orcid.jaxb.model.v3.dev1.record.OtherName)7 Organization (org.orcid.jaxb.model.v3.dev1.common.Organization)6 Biography (org.orcid.jaxb.model.v3.dev1.record.Biography)6 Work (org.orcid.jaxb.model.v3.dev1.record.Work)6 EducationSummary (org.orcid.jaxb.model.v3.dev1.record.summary.EducationSummary)6 Date (java.util.Date)5 OrcidDuplicatedElementException (org.orcid.core.exception.OrcidDuplicatedElementException)5