use of org.orcid.pojo.ajaxForm.OrgDefinedFundingSubType in project ORCID-Source by ORCID.
the class FundingsController method getFunding.
/**
* Returns a blank funding form
* */
@RequestMapping(value = "/funding.json", method = RequestMethod.GET)
@ResponseBody
public FundingForm getFunding() {
FundingForm result = new FundingForm();
result.setAmount(new Text());
result.setCurrencyCode(Text.valueOf(""));
result.setDescription(new Text());
result.setFundingName(new Text());
result.setFundingType(Text.valueOf(""));
result.setSourceName(new String());
OrgDefinedFundingSubType subtype = new OrgDefinedFundingSubType();
subtype.setAlreadyIndexed(false);
subtype.setSubtype(Text.valueOf(""));
result.setOrganizationDefinedFundingSubType(subtype);
FundingTitleForm title = new FundingTitleForm();
title.setTitle(new Text());
TranslatedTitleForm tt = new TranslatedTitleForm();
tt.setContent(new String());
tt.setLanguageCode(new String());
tt.setLanguageName(new String());
title.setTranslatedTitle(tt);
result.setFundingTitle(title);
result.setUrl(new Text());
ProfileEntity profile = profileEntityCacheManager.retrieve(getEffectiveUserOrcid());
Visibility v = Visibility.valueOf(profile.getActivitiesVisibilityDefault() == null ? org.orcid.jaxb.model.common_v2.Visibility.fromValue(OrcidVisibilityDefaults.FUNDING_DEFAULT.getVisibility().value()) : profile.getActivitiesVisibilityDefault());
result.setVisibility(v);
Date startDate = new Date();
result.setStartDate(startDate);
startDate.setDay("");
startDate.setMonth("");
startDate.setYear("");
Date endDate = new Date();
result.setEndDate(endDate);
endDate.setDay("");
endDate.setMonth("");
endDate.setYear("");
// Set empty contributor
Contributor contr = new Contributor();
List<Contributor> contrList = new ArrayList<Contributor>();
Text rText = new Text();
rText.setValue("");
contr.setContributorRole(rText);
Text sText = new Text();
sText.setValue("");
contr.setContributorSequence(sText);
contrList.add(contr);
result.setContributors(contrList);
// Set empty external identifier
List<FundingExternalIdentifierForm> emptyExternalIdentifiers = new ArrayList<FundingExternalIdentifierForm>();
FundingExternalIdentifierForm f = new FundingExternalIdentifierForm();
f.setType(Text.valueOf(DEFAULT_FUNDING_EXTERNAL_IDENTIFIER_TYPE));
f.setUrl(new Text());
f.setValue(new Text());
f.setRelationship(Text.valueOf(Relationship.SELF.value()));
emptyExternalIdentifiers.add(f);
result.setExternalIdentifiers(emptyExternalIdentifiers);
result.setCity(new Text());
result.setCountry(Text.valueOf(""));
result.setRegion(new Text());
return result;
}
Aggregations