Package framework.generic

Examples of framework.generic.ClipsServerException


                if (method == null) {
                    String alterName = "is" + Converter.firstUpper(field.getName(), false);
                    try {
                        method = aClass.getMethod(alterName);
                    } catch (NoSuchMethodException ex) {
                        throw new ClipsServerException("Несоответствие методов в сущности", ex);
                    } catch (SecurityException ex) {
                        throw new ClipsServerException("Метод в сущности заблокирован", ex);
                    }
                }
                if (!methodMap.containsKey(field) && method != null) {
                    methodMap.put(field, method);
                }
View Full Code Here


                } else if (getClassName().equals("Certificate")) {
                    valueField = Parser.xmlCertificateToUserView(field.toString(), metaData);
                } else if (getClassName().equals("Collaborator")) {
                    valueField = Parser.xmlCollaboratorToUserView(field.toString(), metaData);
                } else {
                    throw new ClipsServerException("Неизвестный формат XML");
                }
            } catch (JDOMException ex) {
                throw new ClipsServerException("Невалидная XML");
            }
        } else {
            valueField = field.toString();
        }
        return valueField;
View Full Code Here

    @Override
    protected void onUpdate(ReportgenQuery entity,
            EntityDetails details, AuditDoc auditDoc, List<AuditDoc> auditDocList) throws ClipsServerException {
        QueryDetails d = (QueryDetails) details;
        if(d.query == null || d.query.length() == 0) {
            throw new ClipsServerException("Попытка сохранения пустого отчета");
        }
        if(d.title == null || d.title.length() > 255 || d.title.length() < 10) {
            throw new ClipsServerException("Название должно быть от 10 до 255 символов в длину");
        }
        if(d.description != null && d.description.length() > 1024) {
            throw new ClipsServerException("Описание должно быть не более 1024 символов в длину");
        }
        if (d.reportType == 0) {
            throw new ClipsServerException("Отчет не привязан ни к какой группе");
        }

        // check report
        Report report = null;
        try {
            report = ReportFactory.fromString(entity.getId(), d.query, this);
        } catch (ReportException ex) {
            throw new ClipsServerException("Попытка сохранения некорректного отчета", ex);
        }

        HashSet<String> newCols = new HashSet<String>();
        ResultColumnList newColsSelector = report.getColumns();
        for(int i=0; i<newColsSelector.size(); i++) {
            newCols.add(newColsSelector.get(i).getTitle());
        }

        //check super reports
        Field[] f = new Field[]{new Field("id", entity.getId(), Field.OPERATOR_NOT_EQUAL)};
        Iterator iterator = findEntityList(ReportgenQuery.class, f).iterator();
        while (iterator.hasNext()) {
            ReportgenQuery superReportQuery = (ReportgenQuery) iterator.next();
            ReportQuery superReport  = null;
            try {
                superReport = ReportFactory.fromString(superReportQuery.getId(),
                        superReportQuery.getQuery(), this);
            } catch (ReportException ex) {
                //do nothing
            }
            if(superReport == null) {
                continue;
            }
           
            Iterator<String> usedSubreportColumns = superReport.getUsedSubreportColumns(entity.getId()).iterator();
            while(usedSubreportColumns.hasNext()) {
                String col = usedSubreportColumns.next();
                if(!newCols.contains(col)) {
                    throw new ClipsServerException("Отчет '" + superReportQuery.getTitle()
                            + "' использует столбец данного отчета с именем '" + col
                            + "', который в новой редакции отсутствует.");
                }
            }
        }
View Full Code Here

            ItemSelectorEditable<QueryExecuterSub> usedSubreports = superReport.getSubReports();
            for(int i=0; i<usedSubreports.size(); i++) {
                QueryExecuterSub col = usedSubreports.get(i);
                if(col.getReportId() == entity.getId()) {
                    throw new ClipsServerException("Отчет '" + col.getReportTitle()
                            + "' не может быть удален, поскольку его использует отчет '"
                            + superReportQuery.getTitle() + "'");
                }
            }
        }
View Full Code Here

            System.out.println("TESTING XML:\n" + reportXML);
            ReportQuery report = ReportFactory.fromString(0, reportXML, this);
            rootQuery = new QueryExecuter(0, report, "Тестовый отчет", "");
            rr = executeQuery(rootQuery);
        } catch (Exception reportException) {
            throw new ClipsServerException("При обработке отчета произошла ошибка", reportException);
        }

        return rr;
    }
View Full Code Here

        try {
            ReportQuery report = ReportFactory.fromString(id, query.getQuery(), this);
            rootQuery = new QueryExecuter(id, report, query.getTitle(), query.getDescription());
            return executeQuery(rootQuery);
        } catch (Exception reportException) {
            throw new ClipsServerException("При обработке отчета произошла ошибка", reportException);
        }
    }
View Full Code Here

    public Object continueReport(UserInputChunk input) throws ClipsServerException {
        if(!canCollabToDo(getCollaboratorId())) {
            checkCommandAccessibility(COMMAND_READ);
        }
        if(rootQuery == null) {
            throw new ClipsServerException("Некорректная попытка продолжить выполнение отчета");
        }
        try {
            if(input != null) {
                setInput(rootQuery, input);
            }
            return executeQuery(rootQuery);
        } catch (ReportException reportException) {
            throw new ClipsServerException("При обработке отчета произошла ошибка", reportException);
        }
    }
View Full Code Here

      ConfigBeanRemoteM    config = getBean(ConfigBeanRemoteM.class);

            getExtraDefaultParameters(target, config);
            return target;
        } catch (RuntimeException ex) {
            throw new ClipsServerException("Ошибка получения параметров отчета", ex);
        }
    }
View Full Code Here

        try {
            checkCommandAccessibility(COMMAND_READ_REPORT);
            try {
                ReportBaseConstant.initReportsFonts();
            } catch (IOException ex) {
                throw new ClipsServerException("Ошибка при загрузке шрифтов отчета", ex);
            }
            JRResourcesUtil.setThreadJRCostumFileSource(this);
            JasperPrint report;
            try {
                @SuppressWarnings("unchecked")

                InputStream is = getInputStream(entity.getMainFileName());
                if (is == null) {
                    throw new ClipsServerException("Файл отчета не найден");
                }
                JasperReport jasperReport = (JasperReport) JRLoader.loadObject(is);
                HashMap<String, Object> map = putParams(params, jasperReport);
                report = JasperFillManager.fillReport(jasperReport, map);
                try {
                    is.close();
                } catch (IOException ex) {
                    throw new ClipsServerException("Ошибка закрытия виртуального потока", ex);
                }
            } finally {
                JRResourcesUtil.resetJRCostumFileSource();
            }
            return report;
        } catch (JRException ex) {
            // work around - для глюка в маршаленге исключений
            ex.getStackTrace();
            throw ex;
        } catch (RuntimeException ex) {
            throw new ClipsServerException("Ошибка при заполнении отчета", ex);
        }
    }
View Full Code Here

                entData.setFileTable(entFile);
                saveFileData(entData);
            }
            return entFile.getId();
        } catch (RuntimeException ex) {
            throw new ClipsServerException("Не удалось сохранить файл отчета!", ex);
        }
    }
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.