Skip to content

Commit

Permalink
BZ-996942 & BZ-996932: Fixing audit log for GDT widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
romartin committed Dec 13, 2013
1 parent 1c9bfe2 commit e76ffc1
Show file tree
Hide file tree
Showing 30 changed files with 322 additions and 283 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public interface GuidedDecisionTableConstants
Messages {

public static final GuidedDecisionTableConstants INSTANCE = GWT.create( GuidedDecisionTableConstants.class );
public static final String COLON = ":";

//Decision Table
String NoPatternBindingsAvailable();
Expand Down Expand Up @@ -77,7 +78,7 @@ public interface GuidedDecisionTableConstants

String LimitedEntryValue();

String LogicallyInsertColon();
String LogicallyInsert();

String YouMustEnterAColumnPattern();

Expand Down Expand Up @@ -321,15 +322,9 @@ String AuditLogEntryOn1( String date,

String DecisionTableAuditLogNoEntries();

String FactTypeColon();
String Value();

String FieldColon();

String OperatorColon();

String ValueColon();

String BoundVariableColon();
String BoundVariable();

String DecisionTableAuditLogUpdateCondition( String value);

Expand All @@ -345,14 +340,6 @@ String AuditLogEntryOn1( String date,

String ColumnHeader();

String ColumnsUpdated();

String FieldName();

String OldValue();

String NewValue();

//Wizard
String UseWizardToBuildAsset();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<gwt:TextBox ui:field="txtColumnHeader" styleName="{wizardResources.css.wizardDTableFields}"/>
</gwt:HorizontalPanel>
<gwt:HorizontalPanel styleName="{wizardResources.css.wizardDTableFieldContainerValid}">
<gwt:Label text="{i18n.HideThisColumn}" styleName="{wizardResources.css.wizardDTableFields}"/>
<gwt:Label text="{i18n.HideThisColumn}:" styleName="{wizardResources.css.wizardDTableFields}"/>
<b:CheckBox ui:field="chkHideColumn" styleName="{wizardResources.css.wizardDTableFields}"/>
</gwt:HorizontalPanel>
<gwt:ScrollPanel ui:field="brlEditorContainer" styleName="{wizardResources.css.scrollPanel}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<gwt:TextBox ui:field="txtColumnHeader" styleName="{wizardResources.css.wizardDTableFields}"/>
</gwt:HorizontalPanel>
<gwt:HorizontalPanel styleName="{wizardResources.css.wizardDTableFieldContainerValid}">
<gwt:Label text="{i18n.HideThisColumn}" styleName="{wizardResources.css.wizardDTableFields}"/>
<gwt:Label text="{i18n.HideThisColumn}:" styleName="{wizardResources.css.wizardDTableFields}"/>
<b:CheckBox ui:field="chkHideColumn" styleName="{wizardResources.css.wizardDTableFields}"/>
</gwt:HorizontalPanel>
<gwt:ScrollPanel ui:field="brlEditorContainer" styleName="{wizardResources.css.scrollPanel}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public ActionInsertFactPopup( final GuidedDecisionTable52 model,
ImageButton editField = createEditFieldButton();
editField.setEnabled( !isReadOnly );
field.add( editField );
addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
field );
doFieldLabel();

Expand Down Expand Up @@ -196,7 +196,7 @@ private void assertDefaultValue() {

//Default Value
if ( model.getTableFormat() == TableFormat.EXTENDED_ENTRY ) {
defaultValueWidgetContainerIndex = addAttribute( GuidedDecisionTableConstants.INSTANCE.DefaultValue(),
defaultValueWidgetContainerIndex = addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.DefaultValue()).append(GuidedDecisionTableConstants.COLON).toString(),
defaultValueWidgetContainer );
makeDefaultValueWidget();
}
Expand All @@ -209,11 +209,11 @@ private void assertDefaultValue() {
}

//Logical insertion
addAttribute( GuidedDecisionTableConstants.INSTANCE.LogicallyInsertColon(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.LogicallyInsert()).append(GuidedDecisionTableConstants.COLON).toString(),
doInsertLogical() );

//Hide column tick-box
addAttribute( GuidedDecisionTableConstants.INSTANCE.HideThisColumn(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString(),
DTCellValueWidgetFactory.getHideColumnIndicator( editingCol ) );

Button apply = new Button( GuidedDecisionTableConstants.INSTANCE.ApplyChanges() );
Expand Down Expand Up @@ -460,7 +460,7 @@ public void callback( final ModelField[] fields ) {
}
}
} );
pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
pop.addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
box );
Button b = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
pop.addAttribute( "",
Expand Down Expand Up @@ -546,7 +546,7 @@ protected void showNewPatternDialog() {
pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.FactType(),
types );
final TextBox binding = new BindingTextBox();
pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Binding(),
pop.addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Binding()).append(GuidedDecisionTableConstants.COLON).toString(),
binding );

Button ok = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void onChange( ChangeEvent event ) {
header );

//Hide column tick-box
addAttribute( GuidedDecisionTableConstants.INSTANCE.HideThisColumn(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString(),
DTCellValueWidgetFactory.getHideColumnIndicator( editingCol ) );

Button apply = new Button( GuidedDecisionTableConstants.INSTANCE.ApplyChanges() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void onClick( ClickEvent w ) {
} );
editField.setEnabled( !isReadOnly );
field.add( editField );
addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
field );
doFieldLabel();

Expand Down Expand Up @@ -201,7 +201,7 @@ private void assertDefaultValue() {

//Default Value
if ( model.getTableFormat() == TableFormat.EXTENDED_ENTRY ) {
defaultValueWidgetContainerIndex = addAttribute( GuidedDecisionTableConstants.INSTANCE.DefaultValue(),
defaultValueWidgetContainerIndex = addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.DefaultValue()).append(GuidedDecisionTableConstants.COLON).toString(),
defaultValueWidgetContainer );
makeDefaultValueWidget();
}
Expand All @@ -218,7 +218,7 @@ private void assertDefaultValue() {
doUpdate() );

//Hide column tick-box
addAttribute( GuidedDecisionTableConstants.INSTANCE.HideThisColumn(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString(),
DTCellValueWidgetFactory.getHideColumnIndicator( editingCol ) );

Button apply = new Button( GuidedDecisionTableConstants.INSTANCE.ApplyChanges() );
Expand Down Expand Up @@ -512,7 +512,7 @@ public void callback( final ModelField[] fields ) {
}
}
} );
pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
pop.addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
box );
Button b = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
pop.addAttribute( "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void onClick( ClickEvent w ) {
} );
editField.setEnabled( !isReadOnly );
field.add( editField );
addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
field );
doFieldLabel();

Expand All @@ -155,7 +155,7 @@ public void onChange( ChangeEvent event ) {
header );

//Logical insertion
addAttribute( GuidedDecisionTableConstants.INSTANCE.LogicallyInsertColon(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.LogicallyInsert()).append(GuidedDecisionTableConstants.COLON).toString(),
doInsertLogical() );

//Bind field to a WorkItem result parameter
Expand All @@ -179,7 +179,7 @@ public void onChange( ChangeEvent event ) {
}

//Hide column tick-box
addAttribute( GuidedDecisionTableConstants.INSTANCE.HideThisColumn(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString(),
DTCellValueWidgetFactory.getHideColumnIndicator( editingCol ) );

Button apply = new Button( GuidedDecisionTableConstants.INSTANCE.ApplyChanges() );
Expand Down Expand Up @@ -313,7 +313,7 @@ public void callback( final ModelField[] fields ) {
}
} );

pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
pop.addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
box );
Button b = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
pop.addAttribute( "",
Expand Down Expand Up @@ -395,7 +395,7 @@ protected void showNewPatternDialog() {
pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.FactType(),
types );
final TextBox binding = new BindingTextBox();
pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Binding(),
pop.addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Binding()).append(GuidedDecisionTableConstants.COLON).toString(),
binding );

Button ok = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void onChange( ChangeEvent event ) {
workItemDefinitions );

//Hide column tick-box
addAttribute( GuidedDecisionTableConstants.INSTANCE.HideThisColumn(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString(),
DTCellValueWidgetFactory.getHideColumnIndicator( editingCol ) );

Button apply = new Button( GuidedDecisionTableConstants.INSTANCE.ApplyChanges() );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public void onClick( ClickEvent w ) {
ImageButton editField = createEditField();
editField.setEnabled( !isReadOnly );
field.add( editField );
addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
field );
doFieldLabel();

Expand Down Expand Up @@ -172,7 +172,7 @@ public void onChange( ChangeEvent event ) {
}

//Hide column tick-box
addAttribute( GuidedDecisionTableConstants.INSTANCE.HideThisColumn(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString(),
DTCellValueWidgetFactory.getHideColumnIndicator( editingCol ) );

Button apply = new Button( GuidedDecisionTableConstants.INSTANCE.ApplyChanges() );
Expand Down Expand Up @@ -463,7 +463,7 @@ public void callback( final ModelField[] fields ) {
}
}
} );
pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
pop.addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
box );
Button b = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
pop.addAttribute( "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ public ConditionPopup( final GuidedDecisionTable52 model,
final boolean isNew,
final boolean isReadOnly ) {
this.rm = new BRLRuleModel( model );
this.editingPattern = model.getPattern( col );
Pattern52 originalPattern = model.getPattern( col );
this.editingPattern = originalPattern != null ? originalPattern.clonePattern() : null;
this.editingCol = cloneConditionColumn( col );
this.model = model;
this.oracle = oracle;
Expand Down Expand Up @@ -166,7 +167,7 @@ public void onClick( ClickEvent w ) {
valueTypes.add( literal );
valueTypes.add( formula );
valueTypes.add( predicate );
addAttribute( GuidedDecisionTableConstants.INSTANCE.CalculationType(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.CalculationType()).append(GuidedDecisionTableConstants.COLON).toString(),
valueTypes );

switch ( editingCol.getConstraintValueType() ) {
Expand Down Expand Up @@ -228,7 +229,7 @@ public void onClick( ClickEvent w ) {
} );
editField.setEnabled( !isReadOnly );
field.add( editField );
addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
field );
doFieldLabel();

Expand Down Expand Up @@ -266,7 +267,7 @@ public void onChange( ChangeEvent event ) {
}
} );
}
addAttribute( GuidedDecisionTableConstants.INSTANCE.DTLabelFromEntryPoint(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.DTLabelFromEntryPoint()).append(GuidedDecisionTableConstants.COLON).toString(),
entryPointName );

//Column header
Expand Down Expand Up @@ -334,7 +335,7 @@ private void assertDefaultValue() {

//Default value
if ( model.getTableFormat() == TableFormat.EXTENDED_ENTRY ) {
defaultValueWidgetContainerIndex = addAttribute( GuidedDecisionTableConstants.INSTANCE.DefaultValue(),
defaultValueWidgetContainerIndex = addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.DefaultValue()).append(GuidedDecisionTableConstants.COLON).toString(),
defaultValueWidgetContainer );
makeDefaultValueWidget();
}
Expand All @@ -355,11 +356,11 @@ public void onChange( ChangeEvent event ) {
}
} );
}
addAttribute( GuidedDecisionTableConstants.INSTANCE.Binding(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Binding()).append(GuidedDecisionTableConstants.COLON).toString(),
binding );

//Hide column tick-box
addAttribute( GuidedDecisionTableConstants.INSTANCE.HideThisColumn(),
addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString(),
DTCellValueWidgetFactory.getHideColumnIndicator( editingCol ) );

//Initialise view
Expand Down Expand Up @@ -872,7 +873,7 @@ public void callback( final ModelField[] fields ) {
}
} );

pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Field(),
pop.addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
box );
Button b = new Button( GuidedDecisionTableConstants.INSTANCE.OK() );
pop.addAttribute( "",
Expand Down Expand Up @@ -918,7 +919,7 @@ public void onChange( ChangeEvent event ) {
"" ) );
}
} );
pop.addAttribute( GuidedDecisionTableConstants.INSTANCE.Binding(),
pop.addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Binding()).append(GuidedDecisionTableConstants.COLON).toString(),
binding );

//Patterns can be negated, i.e. "not Pattern(...)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ private void refreshAttributeWidget() {
hp.add( label );

final MetadataCol52 at = atc;
final CheckBox hide = new CheckBox( GuidedDecisionTableConstants.INSTANCE.HideThisColumn() );
final CheckBox hide = new CheckBox( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString() );
hide.setStyleName( "form-field" );
hide.setValue( atc.isHideColumn() );
hide.addClickHandler( new ClickHandler() {
Expand Down Expand Up @@ -1397,10 +1397,10 @@ public void onClick( ClickEvent sender ) {
hp.add( new SmallLabel( ")" ) );
}
hp.add( new HTML( "&nbsp;&nbsp;" ) );
hp.add( new SmallLabel( GuidedDecisionTableConstants.INSTANCE.DefaultValue() ) );
hp.add( new SmallLabel( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.DefaultValue()).append(GuidedDecisionTableConstants.COLON).toString() ) );
hp.add( defaultValue );

final CheckBox hide = new CheckBox( GuidedDecisionTableConstants.INSTANCE.HideThisColumn() );
final CheckBox hide = new CheckBox( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.HideThisColumn()).append(GuidedDecisionTableConstants.COLON).toString() );
hide.setStyleName( "form-field" );
hide.setValue( at.isHideColumn() );
hide.addClickHandler( new ClickHandler() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,23 @@ SafeHtml entrySummary( String eventTypeDisplayText,

private final AuditLogEntryCellHelper helper;

// The CSS classes for generated html templates.
private String labelClass;
private String valueClass;


public AuditLogEntryCell( final DateTimeFormat format ) {
this.helper = new AuditLogEntryCellHelper( format );
this.format = format;
}

public AuditLogEntryCell( final DateTimeFormat format, String labelClass, String valueClass ) {
this.helper = new AuditLogEntryCellHelper( format, labelClass, valueClass );
this.format = format;
this.labelClass = labelClass;
this.valueClass = valueClass;
}

@Override
public void render( Context context,
AuditLogEntry value,
Expand Down
Loading

0 comments on commit e76ffc1

Please sign in to comment.