use of com.ramussoft.report.data.Rows in project ramus by Vitaliy-Yakovchuk.
the class QualifiersConnection method getConnected.
@SuppressWarnings("unchecked")
@Override
public Rows getConnected(Data data, Row row) {
if (!(row.getQualifier().equals(IDEF0Plugin.getBaseStreamQualifier(data.getEngine()))))
return new Rows(null, data, false);
List<AnyToAnyPersistent> list = (List) row.getAttribute(IDEF0Plugin.getStreamAddedAttribute(data.getEngine()));
final Engine engine = data.getEngine();
Rows rows = new Rows(null, data, false) {
/**
*/
private static final long serialVersionUID = -284240974188065028L;
@Override
public RowSet getRowSet() {
Row current = getCurrent();
if (current == null)
return null;
return current.getRowSet();
}
@Override
public Row addRow(long elementId) {
long qId = engine.getQualifierIdForElement(elementId);
if (qId >= 0l) {
Qualifier qualifier = this.data.getQualifier(qId);
if (qualifier != null) {
RowSet rowSet = this.data.getRowSet(qualifier);
Row row = (Row) rowSet.findRow(elementId);
if (row != null) {
add(row);
return row;
}
}
}
return null;
}
};
for (AnyToAnyPersistent p : list) {
Row row2 = rows.addRow(p.getOtherElement());
if (row2 != null)
row2.setElementStatus(p.getElementStatus());
}
return rows;
}
use of com.ramussoft.report.data.Rows 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;
}
use of com.ramussoft.report.data.Rows in project ramus by Vitaliy-Yakovchuk.
the class InputsControlsConnection method getConnected.
@Override
public Rows getConnected(Data data, Row row) {
Rows rows = inputs.getConnected(data, row);
rows.addAll(controls.getConnected(data, row));
return rows;
}
use of com.ramussoft.report.data.Rows in project ramus by Vitaliy-Yakovchuk.
the class OwnersConnection method getOuners.
private Rows getOuners(Data data, Row row) {
List<Row> ouner = owners.get(row);
if (ouner != null && ouner.size() > 0) {
Rows rows = new Rows(ouner.get(0).getRowSet(), data, false, 1);
rows.addAll(ouner);
return rows;
}
return new Rows(null, data, false, 0);
}
use of com.ramussoft.report.data.Rows in project ramus by Vitaliy-Yakovchuk.
the class RolesConnection method getRoles.
private Rows getRoles(Data data, Row row) {
List<Row> rRows = roles.get(row);
if (rRows != null && rRows.size() > 0) {
Rows rows = new Rows(rRows.get(0).getRowSet(), data, false, 1);
rows.addAll(rRows);
return rows;
}
return new Rows(null, data, false, 0);
}
Aggregations