Skip to content

Commit

Permalink
Code cleanup and bump version to v1.0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
vscheuber committed Feb 8, 2020
1 parent bbf10ab commit 3aaaaea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<artifactId>HTMLMessageNode</artifactId>

<groupId>org.forgerock.am</groupId>
<version>1.0.0</version>
<version>1.0.1</version>
<name>Template for an Auth Tree Node maven project</name>
<description>An Authentication Tree Node for ForgeRock's Identity Platform</description>

Expand Down
17 changes: 4 additions & 13 deletions src/main/java/org/forgerock/openam/auth/nodes/HTMLMessageNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import javax.inject.Inject;

import org.forgerock.json.JsonValue;
import org.forgerock.openam.annotations.sm.Attribute;
import org.forgerock.openam.auth.node.api.Action;
import org.forgerock.openam.auth.node.api.Node;
Expand All @@ -41,20 +40,16 @@
import com.google.inject.assistedinject.Assisted;
import com.sun.identity.authentication.callbacks.HiddenValueCallback;
import com.sun.identity.authentication.callbacks.ScriptTextOutputCallback;
import com.sun.identity.shared.debug.Debug;
import com.sun.identity.sm.RequiredValueValidator;

@Node.Metadata(outcomeProvider = HTMLMessageNode.OutcomeProvider.class,
configClass = HTMLMessageNode.Config.class)
public class HTMLMessageNode extends SingleOutcomeNode {

private static final String BUNDLE = HTMLMessageNode.class.getName().replace(".", "/");
private final Logger logger = LoggerFactory.getLogger(HTMLMessageNode.class);
private final static String DEBUG_FILE = "HTMLMessageNode";
private final Logger logger = LoggerFactory.getLogger("amAuth");
private static final String VALIGN_NEUTRAL_ANCHOR = "HTMLMessageNode_vAlign_Neutral";
protected Debug debug = Debug.getInstance(DEBUG_FILE);
private final LocaleSelector localeSelector;

private final Config config;

/*
Expand Down Expand Up @@ -130,14 +125,11 @@ public enum Style {

@Override
public Action process(TreeContext context) throws NodeProcessException {
JsonValue sharedState = context.sharedState;
JsonValue transientState = context.transientState;

if (context.hasCallbacks()) {
debug.error("[" + DEBUG_FILE + "]: Done.");
logger.debug("Done.");
return goToNext().build();
}
debug.error("[" + DEBUG_FILE + "]: Display message.");
logger.debug("Display message.");
ScriptTextOutputCallback scriptAndSelfSubmitCallback = new ScriptTextOutputCallback(createClientSideScriptExecutorFunction(getScript(context)));
return Action.send(Arrays.asList(
scriptAndSelfSubmitCallback,
Expand Down Expand Up @@ -192,7 +184,7 @@ private String getScript(TreeContext context) {
}
if (config.overwriteButton()) {
String overwriteButtonText = substitute(context, getLocalisedMessage(context, config.overwriteButtonText(), "default.overwriteButtonText"));
debug.error("[" + DEBUG_FILE + "]: Overwriting button: " + overwriteButtonText);
logger.debug("Overwriting button: " + overwriteButtonText);
script
.append(" var button = document.getElementById(\"loginButton_0\");\n")
.append(" button.value = \"").append(overwriteButtonText).append("\";\n")
Expand Down Expand Up @@ -243,7 +235,6 @@ private String substitute(TreeContext context, String input) {
}
else {
logger.debug("Shared state property not found: "+key);
debug.error("[" + DEBUG_FILE + "]: Shared state property not found: "+key);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,10 @@
import java.util.Collections;
import java.util.Map;

import javax.inject.Inject;

import org.forgerock.openam.auth.node.api.AbstractNodeAmPlugin;
import org.forgerock.openam.auth.node.api.Node;
import org.forgerock.openam.plugins.PluginException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
* Definition of an <a href="https://backstage.forgerock.com/docs/am/6/apidocs/org/forgerock/openam/auth/node/api/AbstractNodeAmPlugin.html">AbstractNodeAmPlugin</a>.
Expand Down Expand Up @@ -62,7 +57,7 @@
*/
public class HTMLMessageNodePlugin extends AbstractNodeAmPlugin {

static private String currentVersion = "1.0.0";
static private String currentVersion = "1.0.1";

/**
* Specify the Map of list of node classes that the plugin is providing. These will then be installed and
Expand Down

0 comments on commit 3aaaaea

Please sign in to comment.