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();
}
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>");
}
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>");
}
}
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;
}
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;
}
Aggregations