Package org.apache.struts2.showcase.model

Examples of org.apache.struts2.showcase.model.Skill


    if (skills != null) {
      for (Object val : skills) {
        if (val instanceof Skill) {
          list.add(((Skill) val).getDescription());
        } else {
          Skill skill = skillDao.getSkill((String) val);
          list.add(skill.getDescription());
        }
      }
    }
    return list;
  }
View Full Code Here


   * This method is called to allow the action to prepare itself.
   *
   * @throws Exception thrown if a system level exception occurs.
   */
  public void prepare() throws Exception {
    Skill preFetched = (Skill) fetch(getSkillName(), getCurrentSkill());
    if (preFetched != null) {
      setCurrentSkill(preFetched);
    }
  }
View Full Code Here

  public Employee setSkills(Employee employee, List<String> skillNames) {
    if (employee != null && skillNames != null) {
      employee.setOtherSkills(new ArrayList());
      for (int i = 0, j = skillNames.size(); i < j; i++) {
        Skill skill = (Skill) skillDao.get(skillNames.get(i));
        employee.getOtherSkills().add(skill);
      }
    }
    return employee;
  }
View Full Code Here

     * creating new objects as necessary
     *
     */
    public JsfEmployeeAction() {
        Employee e = new Employee();
        e.setMainSkill(new Skill());
        setCurrentEmployee(e);
    }
View Full Code Here

     * Converting the Skill object list into a map
     */
    public Map<String, String> getAvailableSkills() {
        Map<String, String> map = new HashMap<String, String>();
        for (Object val : skillDao.findAll()) {
            Skill skill = (Skill) val;
            map.put(skill.getDescription(), skill.getName());
        }
        return map;
    }
View Full Code Here

        if (skills != null) {
            for (Object val : skills) {
                if (val instanceof Skill) {
                    list.add(((Skill) val).getDescription());
                } else {
                    Skill skill = skillDao.getSkill((String) val);
                    list.add(skill.getDescription());
                }
            }
        }
        return list;
    }
View Full Code Here

     * This method is called to allow the action to prepare itself.
     *
     * @throws Exception thrown if a system level exception occurs.
     */
    public void prepare() throws Exception {
        Skill preFetched = (Skill) fetch(getSkillName(), getCurrentSkill());
        if (preFetched != null) {
            setCurrentSkill(preFetched);
        }
    }
View Full Code Here

    public Employee setSkills(Employee employee, List skillNames) {
        if (employee!= null && skillNames != null) {
            employee.setOtherSkills(new ArrayList());
            for (int i = 0, j = skillNames.size(); i < j; i++) {
                Skill skill = (Skill) skillDao.get((String) skillNames.get(i));
                employee.getOtherSkills().add(skill);
            }
        }
        return employee;
    }
View Full Code Here

        extraContext.put("parameters", parameterMap);
        extraContext.put(MODE_NAMESPACE_MAP, modeMap);

        extraContext.put(PHASE, phase);

        AttributeMap attrMap = new AttributeMap(extraContext);
        extraContext.put("attr", attrMap);

        return extraContext;
    }
View Full Code Here

   * @param t
   *            the exception
   * @return the exception as a string.
   */
  protected String toString(Throwable t) {
    FastByteArrayOutputStream bout = new FastByteArrayOutputStream();
    PrintWriter wrt = new PrintWriter(bout);
    t.printStackTrace(wrt);
    wrt.close();
    return bout.toString();
  }
View Full Code Here

TOP

Related Classes of org.apache.struts2.showcase.model.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.