本文整理汇总了Java中ai.elimu.model.enums.content.NumeracySkill类的典型用法代码示例。如果您正苦于以下问题:Java NumeracySkill类的具体用法?Java NumeracySkill怎么用?Java NumeracySkill使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NumeracySkill类属于ai.elimu.model.enums.content包,在下文中一共展示了NumeracySkill类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleRequest
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(
@PathVariable Long id,
Model model
) {
logger.info("handleRequest");
Application application = applicationDao.read(id);
model.addAttribute("application", application);
model.addAttribute("applicationStatuses", ApplicationStatus.values());
List<ApplicationVersion> applicationVersions = applicationVersionDao.readAll(application);
model.addAttribute("applicationVersions", applicationVersions);
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
return "admin/application/edit";
}
示例2: handleRequest
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(
HttpSession session,
Model model,
@PathVariable Long id) {
logger.info("handleRequest");
Contributor contributor = (Contributor) session.getAttribute("contributor");
Audio audio = audioDao.read(id);
model.addAttribute("audio", audio);
model.addAttribute("contentLicenses", ContentLicense.values());
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
// model.addAttribute("audioRevisionEvents", audioRevisionEventDao.readAll(audio));
model.addAttribute("letters", letterDao.readAllOrdered(contributor.getLocale()));
model.addAttribute("numbers", numberDao.readAllOrdered(contributor.getLocale()));
model.addAttribute("words", wordDao.readAllOrdered(contributor.getLocale()));
return "content/multimedia/audio/edit";
}
示例3: handleRequest
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(
HttpSession session,
Model model,
@PathVariable Long id) {
logger.info("handleRequest");
Contributor contributor = (Contributor) session.getAttribute("contributor");
Video video = videoDao.read(id);
model.addAttribute("video", video);
model.addAttribute("contentLicenses", ContentLicense.values());
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
model.addAttribute("videoRevisionEvents", videoRevisionEventDao.readAll(video));
model.addAttribute("letters", letterDao.readAllOrdered(contributor.getLocale()));
model.addAttribute("numbers", numberDao.readAllOrdered(contributor.getLocale()));
model.addAttribute("words", wordDao.readAllOrdered(contributor.getLocale()));
return "content/multimedia/video/edit";
}
示例4: convertToEntityProperty
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@Override
public Set<NumeracySkill> convertToEntityProperty(String databaseValue) {
Timber.d("convertToEntityProperty");
Set<NumeracySkill> set = new HashSet<>();
try {
JSONArray jsonArray = new JSONArray(databaseValue);
Timber.d("jsonArray: " + jsonArray);
for (int i = 0; i < jsonArray.length(); i++) {
String value = jsonArray.getString(i);
Timber.d("value: " + value);
NumeracySkill numeracySkill = NumeracySkill.valueOf(value);
set.add(numeracySkill);
}
} catch (JSONException e) {
Log.e(getClass().getName(), null, e);
}
return set;
}
示例5: handleRequest
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(Model model) {
logger.info("handleRequest");
Application application = new Application();
application.setApplicationStatus(ApplicationStatus.MISSING_APK);
model.addAttribute("application", application);
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
return "admin/application/create";
}
示例6: handleSubmit
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.POST)
public String handleSubmit(
HttpSession session,
@Valid Application application,
BindingResult result,
Model model
) {
logger.info("handleSubmit");
Application existingApplication = applicationDao.readByPackageName(application.getLocale(), application.getPackageName());
if (existingApplication != null) {
result.rejectValue("packageName", "NonUnique");
}
if (result.hasErrors()) {
model.addAttribute("application", application);
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
return "admin/application/create";
} else {
applicationDao.create(application);
if (EnvironmentContextLoaderListener.env == Environment.PROD) {
Contributor contributor = (Contributor) session.getAttribute("contributor");
String text = URLEncoder.encode(
contributor.getFirstName() + " just added a new Application:\n" +
"• Language: " + application.getLocale().getLanguage() + "\n" +
"• Package name: \"" + application.getPackageName() + "\"\n" +
"• Literacy skills: " + application.getLiteracySkills() + "\n" +
"• Numeracy skills: " + application.getNumeracySkills());
String iconUrl = contributor.getImageUrl();
SlackApiHelper.postMessage(SlackApiHelper.getChannelId(Team.DEVELOPMENT), text, iconUrl, null);
}
return "redirect:/admin/application/list";
}
}
示例7: handleSubmit
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(value = "/{id}", method = RequestMethod.POST)
public String handleSubmit(
HttpSession session,
@Valid Application application,
BindingResult result,
Model model
) {
logger.info("handleSubmit");
if (result.hasErrors()) {
model.addAttribute("application", application);
model.addAttribute("applicationStatuses", ApplicationStatus.values());
List<ApplicationVersion> applicationVersions = applicationVersionDao.readAll(application);
model.addAttribute("applicationVersions", applicationVersions);
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
return "admin/application/edit";
} else {
applicationDao.update(application);
if (EnvironmentContextLoaderListener.env == Environment.PROD) {
Contributor contributor = (Contributor) session.getAttribute("contributor");
String text = URLEncoder.encode(
contributor.getFirstName() + " just updated an Application:\n" +
"• Language: " + application.getLocale().getLanguage() + "\n" +
"• Package name: \"" + application.getPackageName() + "\"\n" +
"• Literacy skills: " + application.getLiteracySkills() + "\n" +
"• Numeracy skills: " + application.getNumeracySkills());
String iconUrl = contributor.getImageUrl();
SlackApiHelper.postMessage(SlackApiHelper.getChannelId(Team.DEVELOPMENT), text, iconUrl, null);
}
return "redirect:/admin/application/list";
}
}
示例8: handleRequest
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(Model model) {
logger.info("handleRequest");
Audio audio = new Audio();
model.addAttribute("audio", audio);
model.addAttribute("contentLicenses", ContentLicense.values());
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
return "content/multimedia/audio/create";
}
示例9: handleRequest
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(Model model) {
logger.info("handleRequest");
Image image = new Image();
model.addAttribute("image", image);
model.addAttribute("contentLicenses", ContentLicense.values());
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
return "content/multimedia/image/create";
}
示例10: handleRequest
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(
HttpSession session,
Model model,
@PathVariable Long id) {
logger.info("handleRequest");
Contributor contributor = (Contributor) session.getAttribute("contributor");
Image image = imageDao.read(id);
model.addAttribute("image", image);
model.addAttribute("contentLicenses", ContentLicense.values());
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
// model.addAttribute("imageRevisionEvents", imageRevisionEventDao.readAll(image));
model.addAttribute("letters", letterDao.readAllOrdered(contributor.getLocale()));
model.addAttribute("numbers", numberDao.readAllOrdered(contributor.getLocale()));
model.addAttribute("words", wordDao.readAllOrdered(contributor.getLocale()));
Audio audio = audioDao.read(image.getTitle(), contributor.getLocale());
model.addAttribute("audio", audio);
return "content/multimedia/image/edit";
}
示例11: handleRequest
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(Model model) {
logger.info("handleRequest");
Video video = new Video();
model.addAttribute("video", video);
model.addAttribute("contentLicenses", ContentLicense.values());
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
return "content/multimedia/video/create";
}
示例12: convertToDatabaseValue
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@Override
public String convertToDatabaseValue(Set<NumeracySkill> entityProperty) {
Timber.d("convertToDatabaseValue");
String databaseValue = entityProperty.toString();
Timber.d("databaseValue: " + databaseValue);
return databaseValue;
}
示例13: Application
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@Generated(hash = 2022782533)
public Application(Long id, @NotNull Locale locale, @NotNull String packageName,
Set<LiteracySkill> literacySkills, Set<NumeracySkill> numeracySkills,
@NotNull ApplicationStatus applicationStatus) {
this.id = id;
this.locale = locale;
this.packageName = packageName;
this.literacySkills = literacySkills;
this.numeracySkills = numeracySkills;
this.applicationStatus = applicationStatus;
}
示例14: handleSubmit
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.POST)
public String handleSubmit(
HttpSession session,
/*@Valid*/ Audio audio,
@RequestParam("bytes") MultipartFile multipartFile,
BindingResult result,
Model model) {
logger.info("handleSubmit");
Contributor contributor = (Contributor) session.getAttribute("contributor");
if (StringUtils.isBlank(audio.getTranscription())) {
result.rejectValue("transcription", "NotNull");
} else {
Audio existingAudio = audioDao.read(audio.getTranscription(), audio.getLocale());
if (existingAudio != null) {
result.rejectValue("transcription", "NonUnique");
}
}
try {
byte[] bytes = multipartFile.getBytes();
if (multipartFile.isEmpty() || (bytes == null) || (bytes.length == 0)) {
result.rejectValue("bytes", "NotNull");
} else {
String originalFileName = multipartFile.getOriginalFilename();
logger.info("originalFileName: " + originalFileName);
if (originalFileName.toLowerCase().endsWith(".mp3")) {
audio.setAudioFormat(AudioFormat.MP3);
} else if (originalFileName.toLowerCase().endsWith(".ogg")) {
audio.setAudioFormat(AudioFormat.OGG);
} else if (originalFileName.toLowerCase().endsWith(".wav")) {
audio.setAudioFormat(AudioFormat.WAV);
} else {
result.rejectValue("bytes", "typeMismatch");
}
if (audio.getAudioFormat() != null) {
String contentType = multipartFile.getContentType();
logger.info("contentType: " + contentType);
audio.setContentType(contentType);
audio.setBytes(bytes);
// TODO: convert to a default audio format?
}
}
} catch (IOException e) {
logger.error(e);
}
if (result.hasErrors()) {
model.addAttribute("contentLicenses", ContentLicense.values());
model.addAttribute("literacySkills", LiteracySkill.values());
model.addAttribute("numeracySkills", NumeracySkill.values());
return "content/multimedia/audio/create";
} else {
audio.setTranscription(audio.getTranscription().toLowerCase());
audio.setTimeLastUpdate(Calendar.getInstance());
audioDao.create(audio);
// TODO: store RevisionEvent
if (EnvironmentContextLoaderListener.env == Environment.PROD) {
String text = URLEncoder.encode(
contributor.getFirstName() + " just added a new Audio:\n" +
"• Language: \"" + audio.getLocale().getLanguage() + "\"\n" +
"• Transcription: \"" + audio.getTranscription() + "\"\n" +
"See ") + "http://elimu.ai/content/multimedia/audio/edit/" + audio.getId();
String iconUrl = contributor.getImageUrl();
SlackApiHelper.postMessage(SlackApiHelper.getChannelId(Team.CONTENT_CREATION), text, iconUrl, null);
}
return "redirect:/content/multimedia/audio/list#" + audio.getId();
}
}
示例15: getNumeracySkills
import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
public Set<NumeracySkill> getNumeracySkills() {
return numeracySkills;
}