Package org.projectforge.core

Examples of org.projectforge.core.UserException


      list = getHibernateTemplate().find("from SkillRatingDO s where s.user.id = ? and s.skill.id = ? and s.id != ?", new Object[] { skillRating.getUserId(), skillRating.getSkillId(), skillRating.getId()});
    } else {
      list = getHibernateTemplate().find("from SkillRatingDO s where s.user.id = ? and s.skill.id = ?", new Object[] { skillRating.getUserId(), skillRating.getSkillId()});
    }
    if(CollectionUtils.isNotEmpty(list) == true) {
      throw new UserException(I18N_KEY_ERROR_DUPLICATE_RATING);
    }

    if(skillRating.getSkill().isRateable() == false && skillRating.getSkillRating() != null) {
      throw new UserException(I18N_KEY_ERROR_UNRATEABLE_SKILL_WITH_RATING);
    } else if(skillRating.getSkill().isRateable() == true && skillRating.getSkillRating() == null) {
      throw new UserException(I18N_KEY_ERROR_RATEABLE_SKILL_WITH_NULL_RATING);
    }
  }
View Full Code Here


      sb.append(" and s.id != ?");
      params.add(skill.getId());
    }
    list = getHibernateTemplate().find(sb.toString(), params.toArray());
    if (CollectionUtils.isNotEmpty(list) == true) {
      throw new UserException(I18N_KEY_ERROR_DUPLICATE_CHILD_SKILL);
    }
  }
View Full Code Here

  private void checkCyclicReference(final SkillDO obj)
  {
    if (obj.getId().equals(obj.getParentId()) == true) {
      // Self reference
      throw new UserException(I18N_KEY_ERROR_CYCLIC_REFERENCE);
    }
    final SkillNode parent = skillTree.getSkillNodeById(obj.getParentId());
    if (parent == null && skillTree.isRootNode(obj) == false) {
      // Task is orphan because it has no parent task.
      throw new UserException(I18N_KEY_ERROR_PARENT_SKILL_NOT_FOUND);
    }
    final SkillNode node = skillTree.getSkillNodeById(obj.getId());
    if (node.isParentOf(parent) == true) {
      // Cyclic reference because task is ancestor of itself.
      throw new UserException(TaskDao.I18N_KEY_ERROR_CYCLIC_REFERENCE);
    }
  }
View Full Code Here

      }
    }
    do {
      day.add(Calendar.DAY_OF_MONTH, 1);
      if (dayCounter++ > 740) { // Endless loop protection, time period greater 2 years.
        throw new UserException(
            "getNumberOfWorkingDays does not support calculation of working days for a time period greater than two years!");
      }
      if (day.isWorkingDay() == true) {
        final BigDecimal workFraction = day.getWorkFraction();
        if (workFraction != null) {
View Full Code Here

  void setParent(final SkillNode parent)
  {
    if (parent != null) {
      if (parent.getId().equals(getId()) == true || this.isParentOf(parent)) {
        log.error("Oups, cyclic reference detection: skillId = " + getId() + ", parentSkillId = " + parent.getId());
        throw new UserException(SkillDao.I18N_KEY_ERROR_CYCLIC_REFERENCE);
      }
      this.parent = parent;
      this.skill.setParent(parent.getSkill());
    }
  }
View Full Code Here

TOP

Related Classes of org.projectforge.core.UserException

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.