Package org.zeroexchange.model.user

Examples of org.zeroexchange.model.user.Skill


        add(new DataView<Skill>(CKEY_USER_SKILLS, skillsProvider) {
            private static final long serialVersionUID = 1L;

            @Override
            protected void populateItem(Item<Skill> item) {
                Skill skill = item.getModelObject();
                item.add(new MultiLineLabel(CKEY_USER_SKILL_TITLE, skill.getTitle()));
                item.add(new MultiLineLabel(CKEY_USER_SKILL_DESCRIPTIION, skill.getDescription()));
            }
           
        });
       
    }
View Full Code Here


     * Constructor.
     */
    public EditSkill(PageParameters pageParameters) {
        super(pageParameters);
       
        Skill skill = null;
        if(!pageParameters.get(PARAM_SKILL_ID).isEmpty()) {
            Integer skillId = pageParameters.get(PARAM_SKILL_ID).toInteger();
            skill = skillReader.getSkill(skillId);
        }
        setDefaultModel(new Model<Skill>(skill));
View Full Code Here

    @Override
    protected void onBeforeRender() {
        super.onBeforeRender();
       
        SkillData skillData = new SkillData();
        Skill currentSkill = (Skill) getDefaultModelObject();
        if(currentSkill != null) {
            skillData.setTitle(currentSkill.getTitle());
            skillData.setDescription(currentSkill.getDescription());
        }
        skillForm.setModelObject(skillData);
    }
View Full Code Here

    /**
     * Save submitted skill.
     */
    private void saveSkill(SkillData submittedData) {
        Skill currentSkill = (Skill) getDefaultModelObject();
        if(currentSkill == null) {
            currentSkill = new Skill();
            currentSkill.setUser(authorizedUserService.getCurrentUser());
            setDefaultModelObject(currentSkill);
        }

        currentSkill.setTitle(submittedData.getTitle());
        currentSkill.setDescription(submittedData.getDescription());
       
        currentSkill = skillsWriter.save(currentSkill);
        setDefaultModelObject(currentSkill);
    }
View Full Code Here

TOP

Related Classes of org.zeroexchange.model.user.Skill

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.