use of com.revolsys.ui.html.serializer.key.KeySerializer in project com.revolsys.open by revolsys.
the class RecordHtmlUiBuilder method newDataTableMap.
protected Map<String, Object> newDataTableMap(final HttpServletRequest request, final String pageName, final Query query) {
final String search = request.getParameter("search[value]");
final List<String> fieldNames = new ArrayList<>();
final List<KeySerializer> serializers = getSerializers(pageName, "list");
final Or or = new Or();
for (int i = 0; ; i++) {
final String name = request.getParameter("columns[" + i + "][name]");
if (Property.hasValue(name)) {
final KeySerializer serializer = serializers.get(i);
final String fieldName = serializer.getSortFieldName();
fieldNames.add(fieldName);
if (Property.hasValue(search)) {
if (HttpServletUtils.getBooleanParameter(request, "columns[" + i + "][searchable]")) {
or.or(Q.iLike("T." + fieldName, search));
}
}
} else {
break;
}
}
if (!or.isEmpty()) {
query.and(or);
}
final Map<String, Boolean> orderBy = getDataTableSortOrder(fieldNames, request);
query.setOrderBy(orderBy);
final RecordStore recordStore = getRecordStore();
return newDataTableMap(request, recordStore, query, pageName);
}
use of com.revolsys.ui.html.serializer.key.KeySerializer in project com.revolsys.open by revolsys.
the class KeySerializerDetailSerializer method serializeValue.
@Override
public void serializeValue(final XmlWriter out, final int index) {
if (index < getSize()) {
final KeySerializer serializer = this.serializers.get(index);
serializer.serialize(out, this.object);
} else {
out.entityRef("nbsp");
}
}
use of com.revolsys.ui.html.serializer.key.KeySerializer in project com.revolsys.open by revolsys.
the class KeySerializerDetailSerializer method serializeLabel.
@Override
public void serializeLabel(final XmlWriter out, final int index) {
if (index < getSize()) {
final KeySerializer serializer = this.serializers.get(index);
final String label = serializer.getLabel();
out.text(label);
} else {
out.entityRef("nbsp");
}
}
use of com.revolsys.ui.html.serializer.key.KeySerializer in project com.revolsys.open by revolsys.
the class KeySerializerTableSerializer method serializeHeaderCell.
@Override
public void serializeHeaderCell(final XmlWriter out, final int col) {
if (col < this.colCount) {
final KeySerializer serializer = getSerializer(col);
out.text(serializer.getLabel());
} else {
out.entityRef("nbsp");
}
}
use of com.revolsys.ui.html.serializer.key.KeySerializer in project com.revolsys.open by revolsys.
the class KeySerializerTableSerializer method getHeaderCssClass.
@Override
public String getHeaderCssClass(final int col) {
if (col < this.colCount) {
final KeySerializer serializer = getSerializer(col);
final String name = serializer.getName();
if (Property.hasValue(name)) {
return name.replaceAll("\\.", "_");
}
}
return "";
}
Aggregations