use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.
the class AuditLogEntryCellHelper method getSafeHtml.
private SafeHtml getSafeHtml(final UpdateColumnAuditLogEntry event) {
SafeHtmlBuilder sb = new SafeHtmlBuilder();
buildColumnDetailsUpdate(event.getDetails(), event.getOriginalDetails(), event.getDiffs(), sb);
return sb.toSafeHtml();
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.
the class AuditLogEntryCellHelper method buildColumnDetailsUpdate.
/**
* BZ-996932: Added column update details for attribute columns.
* @param details The new details column.
* @param originalDetails The origin details column.
* @param diffs A part from the column details, the column fields update information must be present too.
* @param sb The html bulder buffer.
*/
private void buildColumnDetailsUpdate(final AttributeColumnDetails details, final AttributeColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateAttribute(details.getAttribute())));
SafeHtmlBuilder sbFields = null;
// Show changed fields too.
if (diffs != null && !diffs.isEmpty()) {
sbFields = new SafeHtmlBuilder();
for (BaseColumnFieldDiff diff : diffs) {
String changedFieldName = diff.getFieldName();
if (changedFieldName.equals(DTColumnConfig52.FIELD_HIDE_COLUMN)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.HideThisColumn(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(DTColumnConfig52.FIELD_DEFAULT_VALUE)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DefaultValue(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(AttributeCol52.FIELD_REVERSE_ORDER)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ReverseOrder(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(AttributeCol52.FIELD_USE_ROW_NUMBER)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.UseRowNumber(), diff.getOldValue(), diff.getValue(), sbFields);
}
}
}
if (sbFields != null) {
sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
}
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.
the class AuditLogEntryCellHelper method buildColumnDetailsUpdate.
private void buildColumnDetailsUpdate(final ActionWorkItemInsertFactColumnDetails details, final ActionWorkItemInsertFactColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateAction(details.getColumnHeader())));
SafeHtmlBuilder sbFields = null;
// Show changed fields too.
if (diffs != null && !diffs.isEmpty()) {
sbFields = new SafeHtmlBuilder();
for (BaseColumnFieldDiff diff : diffs) {
String changedFieldName = diff.getFieldName();
if (changedFieldName.equals(DTColumnConfig52.FIELD_HEADER)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ColumnHeader(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(DTColumnConfig52.FIELD_HIDE_COLUMN)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.HideThisColumn(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionInsertFactCol52.FIELD_BOUND_NAME)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Binding(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionInsertFactCol52.FIELD_FACT_TYPE)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.FactType(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionInsertFactCol52.FIELD_FACT_FIELD)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.Field(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionInsertFactCol52.FIELD_IS_INSERT_LOGICAL)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.LogicallyInsert(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionWorkItemInsertFactCol52.FIELD_WORK_ITEM_NAME)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemName(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionWorkItemInsertFactCol52.FIELD_WORK_ITEM_RESULT_PARAM_NAME)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterName(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionWorkItemInsertFactCol52.FIELD_PARAMETER_CLASSNAME)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterClassName(), diff.getOldValue(), diff.getValue(), sbFields);
}
}
}
if (sbFields != null) {
sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
}
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.
the class AuditLogEntryCellHelper method buildColumnDetailsUpdate.
private void buildColumnDetailsUpdate(final ActionWorkItemColumnDetails details, final ActionWorkItemColumnDetails originalDetails, final List<BaseColumnFieldDiff> diffs, final SafeHtmlBuilder sb) {
sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogUpdateAction(details.getColumnHeader())));
SafeHtmlBuilder sbFields = null;
// Show changed fields too.
if (diffs != null && !diffs.isEmpty()) {
sbFields = new SafeHtmlBuilder();
for (BaseColumnFieldDiff diff : diffs) {
String changedFieldName = diff.getFieldName();
if (changedFieldName.equals(DTColumnConfig52.FIELD_HEADER)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.ColumnHeader(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(DTColumnConfig52.FIELD_HIDE_COLUMN)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.HideThisColumn(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionWorkItemCol52.FIELD_WORKITEM_DEFINITION_NAME)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemName(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionWorkItemCol52.FIELD_WORKITEM_DEFINITION_PARAMETER_NAME)) {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterName(), diff.getOldValue(), diff.getValue(), sbFields);
} else if (changedFieldName.equals(ActionWorkItemCol52.FIELD_WORKITEM_DEFINITION_PARAMETER_VALUE)) {
if (diff instanceof WorkItemColumnParameterValueDiffImpl) {
final String parameterName = ((WorkItemColumnParameterValueDiffImpl) diff).getParameterName();
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterValueOnly0(parameterName), diff.getOldValue(), diff.getValue(), sbFields);
} else {
buildColumnUpdateFields(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogWorkItemParameterValue(), diff.getOldValue(), diff.getValue(), sbFields);
}
}
}
}
if (sbFields != null) {
sb.append(TEMPLATE.updatedFields(sbFields.toSafeHtml(), labelClass));
}
}
use of com.google.gwt.safehtml.shared.SafeHtmlBuilder in project drools-wb by kiegroup.
the class AuditLogEntryCellHelper method getSafeHtml.
private SafeHtml getSafeHtml(final DeleteColumnAuditLogEntry event) {
SafeHtmlBuilder sb = new SafeHtmlBuilder();
sb.append(TEMPLATE.commentHeader(GuidedDecisionTableConstants.INSTANCE.DecisionTableAuditLogDeleteColumn0(event.getColumnHeader())));
return sb.toSafeHtml();
}
Aggregations