use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class NotificationManagerTest method testSendVerifiedRequiredAnnouncement2017.
@Test
public void testSendVerifiedRequiredAnnouncement2017() throws JAXBException, IOException, URISyntaxException {
for (Locale locale : Locale.values()) {
OrcidProfile orcidProfile = getProfile(locale);
notificationManager.sendVerifiedRequiredAnnouncement2017(orcidProfile);
}
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class NotificationManagerTest method testSendWelcomeEmail.
@Test
public void testSendWelcomeEmail() throws JAXBException, IOException, URISyntaxException {
OrcidMessage orcidMessage = (OrcidMessage) unmarshaller.unmarshal(getClass().getResourceAsStream(ORCID_INTERNAL_FULL_XML));
OrcidProfile orcidProfile = orcidMessage.getOrcidProfile();
notificationManager.sendWelcomeEmail(orcidProfile.getOrcidIdentifier().getPath(), orcidProfile.getOrcidBio().getContactDetails().retrievePrimaryEmail().getValue());
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class GroupAdministratorController method getClients.
@RequestMapping(value = "/get-clients.json", method = RequestMethod.GET)
@Produces(value = { MediaType.APPLICATION_JSON })
@ResponseBody
public List<Client> getClients() {
OrcidProfile profile = getEffectiveProfile();
String groupOrcid = profile.getOrcidIdentifier().getPath();
if (profile.getType() == null || !profile.getType().equals(OrcidType.GROUP)) {
LOGGER.warn("Trying to get clients of non group user {}", profile.getOrcidIdentifier().getPath());
throw new OrcidClientGroupManagementException(getMessage("web.orcid.privilege.exception"));
}
OrcidClientGroup group = orcidClientGroupManager.retrieveOrcidClientGroup(groupOrcid);
List<Client> clients = new ArrayList<Client>();
for (OrcidClient orcidClient : group.getOrcidClient()) {
clients.add(Client.valueOf(orcidClient));
}
return clients;
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class DeveloperToolsController method disableDeveloperTools.
/**
* Disable developer tools on the current profile
*
* @return true if the developer tools were disabled on the profile
* */
@RequestMapping(value = "/disable-developer-tools.json", method = RequestMethod.POST)
@ResponseBody
public boolean disableDeveloperTools(HttpServletRequest request) {
OrcidProfile profile = getEffectiveProfile();
boolean updated = true;
if (profile.getOrcidInternal() != null && profile.getOrcidInternal().getPreferences() != null && profile.getOrcidInternal().getPreferences().getDeveloperToolsEnabled() != null && profile.getOrcidInternal().getPreferences().getDeveloperToolsEnabled().isValue()) {
// Disable the developer tools
updated = profileEntityManager.disableDeveloperTools(profile);
// Disable the sso access
orcidSSOManager.revokeSSOAccess(profile.getOrcidIdentifier().getPath());
}
return updated;
}
use of org.orcid.jaxb.model.message.OrcidProfile in project ORCID-Source by ORCID.
the class AddDelegateForm method getOrcidProfile.
public OrcidProfile getOrcidProfile(String orcid) {
OrcidProfile orcidProfile = new OrcidProfile();
orcidProfile.setOrcidIdentifier(orcid);
OrcidBio orcidBio = new OrcidBio();
orcidProfile.setOrcidBio(orcidBio);
Delegation delegation = new Delegation();
orcidBio.setDelegation(delegation);
GivenPermissionTo givenPermissionTo = new GivenPermissionTo();
delegation.setGivenPermissionTo(givenPermissionTo);
DelegationDetails delegationDetails = new DelegationDetails();
givenPermissionTo.getDelegationDetails().add(delegationDetails);
DelegateSummary delegateSummary = new DelegateSummary(new OrcidIdentifier(delegateOrcid));
delegationDetails.setDelegateSummary(delegateSummary);
return orcidProfile;
}
Aggregations