当前位置: 首页>>代码示例>>Java>>正文


Java NumeracySkill类代码示例

本文整理汇总了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";
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:21,代码来源:ApplicationEditController.java

示例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";
    }
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:26,代码来源:AudioEditController.java

示例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";
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:26,代码来源:VideoEditController.java

示例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;
}
 
开发者ID:elimu-ai,项目名称:appstore,代码行数:22,代码来源:NumeracySkillSetConverter.java

示例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";
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:14,代码来源:ApplicationCreateController.java

示例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";
    }
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:38,代码来源:ApplicationCreateController.java

示例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";
    }
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:40,代码来源:ApplicationEditController.java

示例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";
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:15,代码来源:AudioCreateController.java

示例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";
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:15,代码来源:ImageCreateController.java

示例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";
    }
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:29,代码来源:ImageEditController.java

示例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";
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:15,代码来源:VideoCreateController.java

示例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;
}
 
开发者ID:elimu-ai,项目名称:appstore,代码行数:9,代码来源:NumeracySkillSetConverter.java

示例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;
}
 
开发者ID:elimu-ai,项目名称:appstore,代码行数:12,代码来源:Application.java

示例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();
    }
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:79,代码来源:AudioCreateController.java

示例15: getNumeracySkills

import ai.elimu.model.enums.content.NumeracySkill; //导入依赖的package包/类
public Set<NumeracySkill> getNumeracySkills() {
    return numeracySkills;
}
 
开发者ID:elimu-ai,项目名称:webapp,代码行数:4,代码来源:Application.java


注:本文中的ai.elimu.model.enums.content.NumeracySkill类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。