Package framework.generic

Examples of framework.generic.ClipsServerException


        item.title = item.title.trim();
        checkUniqe(item);
        checkTitleValid(item.title);
        DEN entity = findEntity(entityClass, item.id, hudClassName);
     if (!HardCodedIDs.canModify(entityClass, entity.getId())) {
      throw new ClipsServerException("Запрещено изменять элемент справочника " + hudClassName + " cо значением: " + entity.getTitle());
    }
        onUpdate(entity, item);
        set(entity, item);
        manager.persist(entity);
        manager.flush();
View Full Code Here


    @Override
    final public int remove(int id) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_WRITE);
        DEN entity = findEntity(entityClass, id, hudClassName);
        if (!HardCodedIDs.canRemove(entityClass, entity.getId())) {
                throw new ClipsServerException("Запрещено удалять элемент справочника: " + hudClassName + " cо значением: " + entity.getTitle());
        }
        try {
            onRemove(entity);
            manager.remove(entity);
            manager.flush();
View Full Code Here

            @SuppressWarnings("unchecked")
            T bean = (T) c.lookup(name);
            bean.setSession(sessionID);
            return bean;
        } catch (NamingException ne) {
            throw new ClipsServerException("Не удалось получить сервис " + name, ne);
        }
    }
View Full Code Here

    protected void checkXML(String xml) throws ClipsServerException {
        try {
            Converter.stringToXml(xml);
        } catch (JDOMException ex) {
            throw new ClipsServerException("Некорректный формат данных");
        }
    }
View Full Code Here

    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    @Override
    final public DETAILSTYPE append(DETAILSTYPE item) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_CREATE);
     if (!HardCodedIDs.canModify(entityClass, 0)) {
      throw new ClipsServerException("Запрещено добавлять элементы в справочник " + hudClassName);
    }
        item.title = item.title.trim();
        checkUniqe(item);
        try {
            item.id = 0;
            checkTitleValid(item.title);
            onAppend(item);           
            DEN entity = entityClass.newInstance();
            set(entity, item);
            manager.persist(entity);
            manager.flush();
            manager.refresh(entity);
            return entity.getDetails((RightChecker) this);
        } catch(InstantiationException ex) {
            throw new ClipsServerException("Не удалось создать класс строки таблицы '"
                    + hudClassName + "'", ex);
        } catch(IllegalAccessException ex) {
            throw new ClipsServerException("Не удалось получить доступ к классу строки таблицы '"
                    + hudClassName + "'", ex);
        }
    }
View Full Code Here

                    if (current.getKladrCode().equals(object.getKladrCode())){
                        items.add(current1.toString());
                    }
                    current1 = current1.getParent();
                }
                throw  new ClipsServerException("Циклическая ссылка: " + items + ", замыкается на элементе: " + current);
            }
            current = current.getParent();
        }
    }
View Full Code Here

//        if ((item.entity.getParent() != null)
//                && (item.entity.getParent().getKladrCode().equals(item.entity.getKladrCode()))){
//            System.out.println("FUCKING 498: "+ item);
//        }
        if (type == null){
            throw new ClipsServerException("недопустимый тип адресуемого объекта: "
                    + item.item.title + " type id: " + item.item.typeId
                    + " обновите справочник типов");
        }
        if (item == null || item.entity == null || item.item == null){
            throw new ClipsServerException("FUCKING NULL");
        }
        if (item.entity.getIfnsCode() != item.item.ifnsCode
                || item.entity.getIfnsLocalCode() != item.item.ifnsLocalCode
                || item.entity.getOkato() != item.item.okato
                || item.entity.getPostIndex() != item.item.postIndex
View Full Code Here

        try {
            MessageDigest md = MessageDigest.getInstance(ClipsServerConstants.PASSWORD_DIGEST_ALGORITHM);
            md.update(char2byte(aPassword));
            return md.digest();
        } catch (NoSuchAlgorithmException ex) {
            throw new ClipsServerException("Не поддерживается алгоритм " + ClipsServerConstants.PASSWORD_DIGEST_ALGORITHM);
        }
    }
View Full Code Here

            MessageDigest md = MessageDigest.getInstance(ClipsServerConstants.PASSWORD_DIGEST_ALGORITHM);
            md.update(passwordHash);
            md.update(salt);
            return md.digest();
        } catch (NoSuchAlgorithmException ex) {
            throw new ClipsServerException("Не поддерживается алгоритм " + ClipsServerConstants.PASSWORD_DIGEST_ALGORITHM);
        }
    }
View Full Code Here

            }
        }
        entity.setSheduled(d.sheduled);
        //entity.setLoginGroup(findEntity(LoginGroup.class, d.loginGroup));
        if (d.code == null || d.code.isEmpty()) {
            throw new ClipsServerException("Не указан табельный номер сотрудника");
        }
        //Проверка Существует ли другой сотрудник с таким табельным номером
        Collaborator coll = findEntity(Collaborator.class, getCollaboratorId());
        Lpu lpu = coll.getLpu();

        Field[] f = {new Field("code", d.code), new Field("lpu", lpu)};
        List<Collaborator> collabList = findEntityList(Collaborator.class, f);
        boolean founded = false;
        for (Collaborator collaborator : collabList) {
            if (collaborator.getId() != d.id) {
                founded = true;
                break;
            }
        }
        if (founded) {
            throw new ClipsServerException("Существует сотрудник с таким табельным номером в данной поликлинике");
        }
        entity.setCode(d.code);
        entity.setDlo(d.dlo);
        entity.setLpu(findEntity(Lpu.class, d.lpuID));
    }
View Full Code Here

TOP

Related Classes of framework.generic.ClipsServerException

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.