Search in sources :

Example 96 with Qualifier

use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.

the class HTTPParser method printReportsQ.

private void printReportsQ() throws IOException {
    final String sNum = params.get("num");
    if (sNum == null)
        printError(RES.getString("reportEror"));
    final long num = Long.parseLong(sNum);
    Element report = null;
    if ((report = dataPlugin.getEngine().getElement(num)) == null) {
        printError(RES.getString("reportEror"));
        return;
    }
    htmlTitle = RES.getString("reportQuaryFor") + ": " + report.getName();
    printStartD();
    Qualifier qualifier = ((ReportQuery) dataPlugin.getEngine()).getHTMLReportQuery(report);
    if (qualifier == null) {
        printReport(report, null);
    } else
        printReportQuary(qualifier, Long.toString(report.getId()));
    printEndD();
}
Also used : ReportQuery(com.ramussoft.report.ReportQuery) Element(com.ramussoft.common.Element) Qualifier(com.ramussoft.common.Qualifier)

Example 97 with Qualifier

use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.

the class HTTPParser method printFunctionArrows.

private void printFunctionArrows(final Vector left, final String string) throws IOException {
    final Vector<Row> v = new Vector<Row>();
    for (int i = 0; i < left.size(); i++) {
        final Stream stream = (Stream) left.get(i);
        final Row[] rs = stream.getAdded();
        for (final Row row : rs) {
            if (v.indexOf(row) < 0)
                v.add(row);
        }
    }
    final Row[] rows = new Row[v.size()];
    for (int i = 0; i < rows.length; i++) rows[i] = v.get(i);
    if (rows.length == 0)
        return;
    RowFactory.sortByName(rows);
    htmlStream.println("<p>");
    htmlStream.println("<table border=1 width=100%>");
    printMainTableTitle(string, 3);
    htmlStream.print("<tr>");
    htmlStream.print("<td><b>");
    htmlStream.print(RES.getString("kod"));
    htmlStream.print("</b></td>");
    htmlStream.print("<td><b>");
    htmlStream.print(RES.getString("element"));
    htmlStream.print("</b></td>");
    htmlStream.print("<td><b>");
    htmlStream.print(RES.getString("clasificator"));
    htmlStream.print("</b></td>");
    htmlStream.println("</tr>");
    for (final Row row : rows) {
        htmlStream.print("<tr>");
        htmlStream.print("<td>");
        printStartATeg("rows/index.html?id=" + row.getGlobalId().toString());
        htmlStream.print(row.getKod());
        printEndATeg();
        htmlStream.print("</td>");
        htmlStream.print("<td width=100%>");
        printStartATeg("rows/index.html?id=" + row.getGlobalId().toString());
        htmlStream.print(row.getName());
        printEndATeg();
        htmlStream.print("</td>");
        Qualifier q = dataPlugin.getEngine().getQualifier(row.getElement().getQualifierId());
        Element element = StandardAttributesPlugin.getElement(dataPlugin.getEngine(), q.getId());
        htmlStream.print("<td>");
        String name = q.getName();
        if (element != null) {
            printStartATeg("rows/index.html?id=" + element.getId());
        } else {
            if (name.equals(StandardAttributesPlugin.QUALIFIERS_QUALIFIER))
                name = RES.getString("clasificator");
        }
        htmlStream.print(name);
        if (element != null) {
            printEndATeg();
        }
        htmlStream.print("</td>");
        htmlStream.println("</tr>");
    }
    htmlStream.println("</table>");
    htmlStream.println("</p>");
}
Also used : Element(com.ramussoft.common.Element) ByteArrayOutputStream(java.io.ByteArrayOutputStream) OutputStream(java.io.OutputStream) Stream(com.ramussoft.pb.Stream) InputStream(java.io.InputStream) Qualifier(com.ramussoft.common.Qualifier) Row(com.ramussoft.pb.Row) NRow(com.ramussoft.pb.data.negine.NRow) Vector(java.util.Vector)

Example 98 with Qualifier

use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.

the class HTTPParser method printReportsList.

/**
 * Друкує список звітів з посиланнями на них.
 *
 * @throws IOException
 */
protected void printReportsList() throws IOException {
    Engine engine = dataPlugin.getEngine();
    Qualifier qualifier = ReportPlugin.getReportsQualifier(engine);
    Attribute name = ReportPlugin.getReportNameAttribute(engine);
    RowSet rowSet = new RowSet(engine, qualifier, new Attribute[] { name }, null, true);
    List<Element> reports = ((ReportQuery) engine).getHTMLReports();
    if (reports.size() == 0)
        return;
    printMainTableTitle(RES.getString("reportsTitle"));
    for (com.ramussoft.database.common.Row element : rowSet.getAllRows()) {
        htmlStream.println("<tr>");
        htmlStream.println("<td colspan=2>");
        printStartATeg("reportsq/index.html?num=" + element.getElementId());
        htmlStream.println(element.getCode());
        printEndATeg();
        printStartATeg("reportsq/index.html?num=" + element.getElementId());
        htmlStream.print(element.getName());
        printEndATeg();
        htmlStream.println("</td>");
        htmlStream.println("</tr>");
    }
}
Also used : Attribute(com.ramussoft.common.Attribute) ReportQuery(com.ramussoft.report.ReportQuery) Element(com.ramussoft.common.Element) RowSet(com.ramussoft.database.common.RowSet) Qualifier(com.ramussoft.common.Qualifier) IEngine(com.ramussoft.common.IEngine) Engine(com.ramussoft.common.Engine)

Example 99 with Qualifier

use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.

the class FastIdef0Connection method getQualifiers.

public List<Qualifier> getQualifiers(Data data, String modelName) {
    Engine engine = data.getEngine();
    List<Qualifier> qualifiers = new ArrayList<Qualifier>();
    if ("[ALL MODELS]".equals(modelName)) {
        for (Qualifier qualifier : engine.getQualifiers()) if (IDEF0Plugin.isFunction(qualifier))
            qualifiers.add(qualifier);
    } else {
        com.ramussoft.database.common.RowSet rowSet = new com.ramussoft.database.common.RowSet(engine, IDEF0Plugin.getModelTree(engine), new Attribute[] { StandardAttributesPlugin.getAttributeNameAttribute(engine) }, null, true);
        StringTokenizer st = new StringTokenizer(modelName, Data.QUALIFIER_DELIMETER);
        while (st.hasMoreElements()) {
            com.ramussoft.database.common.Row row = rowSet.findRow(st.nextToken());
            if (row != null)
                addQualifiers(data.getEngine(), qualifiers, row);
        }
        Qualifier qualifier = engine.getQualifierByName(modelName);
        if (qualifier != null && !qualifiers.contains(qualifier))
            qualifiers.add(qualifier);
    }
    return qualifiers;
}
Also used : StringTokenizer(java.util.StringTokenizer) ArrayList(java.util.ArrayList) RowSet(com.ramussoft.report.data.RowSet) Qualifier(com.ramussoft.common.Qualifier) Engine(com.ramussoft.common.Engine)

Example 100 with Qualifier

use of com.ramussoft.common.Qualifier in project ramus by Vitaliy-Yakovchuk.

the class FastIdef0Connection method getConnected.

@Override
public Rows getConnected(Data data, Row row) {
    branchId = data.getBranchId();
    String modelName = data.getQuery().getAttribute("ReportFunction");
    if (modelName == null)
        throw new DataException("Error.noModelProperty", "Set model attribute for report first!!!");
    List<Qualifier> models = getQualifiers(data, modelName);
    Rows res = null;
    for (Qualifier model : models) {
        Key key = new Key(all, model);
        IDEF0Buffer[] buffer = getIDEF0Buffers(key, data);
        Rows rows;
        if (row.getElement().getQualifierId() == model.getId()) {
            rows = buffer[type].getStreams(row);
        } else {
            rows = buffer[type].getFunctions(row);
        }
        if (res == null)
            res = rows;
        else
            res.addAll(rows);
    }
    if (res == null)
        throw new DataException("Error.noModelProperty", "Set model attribute for report first!!!");
    return res;
}
Also used : DataException(com.ramussoft.report.data.DataException) Qualifier(com.ramussoft.common.Qualifier) Rows(com.ramussoft.report.data.Rows)

Aggregations

Qualifier (com.ramussoft.common.Qualifier)157 Attribute (com.ramussoft.common.Attribute)72 Element (com.ramussoft.common.Element)59 ArrayList (java.util.ArrayList)45 Engine (com.ramussoft.common.Engine)22 Row (com.ramussoft.database.common.Row)17 Row (com.ramussoft.pb.Row)14 List (java.util.List)12 Hashtable (java.util.Hashtable)11 QualifierEvent (com.ramussoft.common.event.QualifierEvent)10 ResultSet (java.sql.ResultSet)9 SQLException (java.sql.SQLException)9 AttributeType (com.ramussoft.common.AttributeType)8 RowSet (com.ramussoft.database.common.RowSet)8 DataPlugin (com.ramussoft.pb.DataPlugin)8 NFunction (com.ramussoft.pb.data.negine.NFunction)8 AttributeEvent (com.ramussoft.common.event.AttributeEvent)7 Journaled (com.ramussoft.common.journal.Journaled)7 RowMapper (com.ramussoft.jdbc.RowMapper)7 IEngine (com.ramussoft.common.IEngine)6