Skip to content

Commit

Permalink
Fixing MID-2045 (add changes text formatter for generalNotifier).
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Oct 2, 2014
1 parent c02ba2a commit 2c1c020
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Expand Up @@ -209,6 +209,7 @@ public abstract class SchemaConstants {
public static final QName SE_EXECUTE_SCRIPT = new QName(SCRIPTING_EXTENSION_NS, "executeScript");

public static final QName C_EVENT = new QName(NS_C, "event");
public static final QName C_TEXT_FORMATTER = new QName(NS_C, "textFormatter");

public static final QName C_TRANSPORT_NAME = new QName(NS_C, "transportName");
public static final QName C_FROM = new QName(NS_C, "from");
Expand Down
Expand Up @@ -49,6 +49,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import static com.evolveum.midpoint.model.api.ProgressInformation.ActivityType.NOTIFICATIONS;
Expand All @@ -74,7 +75,7 @@ public class GeneralNotifier extends BaseHandler {
@Autowired
protected AggregatedEventHandler aggregatedEventHandler;

protected static final List<ItemPath> auxiliaryPaths = Arrays.asList(
protected static final List<ItemPath> auxiliaryPaths = Collections.unmodifiableList(Arrays.asList(
new ItemPath(ShadowType.F_METADATA),
new ItemPath(ShadowType.F_ACTIVATION, ActivationType.F_VALIDITY_STATUS), // works for user activation as well
new ItemPath(ShadowType.F_ACTIVATION, ActivationType.F_VALIDITY_CHANGE_TIMESTAMP),
Expand All @@ -85,7 +86,7 @@ public class GeneralNotifier extends BaseHandler {
new ItemPath(ShadowType.F_ITERATION),
new ItemPath(ShadowType.F_ITERATION_TOKEN),
new ItemPath(UserType.F_LINK_REF),
new ItemPath(ShadowType.F_TRIGGER)
new ItemPath(ShadowType.F_TRIGGER))
);


Expand Down Expand Up @@ -339,4 +340,15 @@ private String formatPath(ItemDelta itemDelta) {
}
return sb.toString();
}

@Override
protected ExpressionVariables getDefaultVariables(Event event, OperationResult result) {
ExpressionVariables variables = super.getDefaultVariables(event, result);
variables.addVariableDefinition(SchemaConstants.C_TEXT_FORMATTER, textFormatter);
return variables;
}

public static List<ItemPath> getAuxiliaryPaths() {
return auxiliaryPaths;
}
}

0 comments on commit 2c1c020

Please sign in to comment.