SSISetpublic class SSISet extends Object implements SSICommandImplements the Server-side #set command |
Methods Summary |
---|
public long | process(SSIMediator ssiMediator, java.lang.String commandName, java.lang.String[] paramNames, java.lang.String[] paramValues, java.io.PrintWriter writer)
long lastModified = 0;
String errorMessage = ssiMediator.getConfigErrMsg();
String variableName = null;
for (int i = 0; i < paramNames.length; i++) {
String paramName = paramNames[i];
String paramValue = paramValues[i];
if (paramName.equalsIgnoreCase("var")) {
variableName = paramValue;
} else if (paramName.equalsIgnoreCase("value")) {
if (variableName != null) {
String substitutedValue = ssiMediator
.substituteVariables(paramValue);
ssiMediator.setVariableValue(variableName,
substitutedValue);
lastModified = System.currentTimeMillis();
} else {
ssiMediator.log("#set--no variable specified");
writer.write(errorMessage);
throw new SSIStopProcessingException();
}
} else {
ssiMediator.log("#set--Invalid attribute: " + paramName);
writer.write(errorMessage);
throw new SSIStopProcessingException();
}
}
return lastModified;
|
|