Class GshTemplateExec
java.lang.Object
edu.internet2.middleware.grouper.app.gsh.template.GshTemplateExec
Use this class to execute a custom gsh template
Sample call
GshTemplateExec exec = new GshTemplateExec();
exec.assignConfigId("testGshTemplateConfig");
exec.assignCurrentUser(subject);
exec.assignGshTemplateOwnerType(GshTemplateOwnerType.stem);
exec.assignOwnerStemName(ownerStem.getName());
GshTemplateInput input = new GshTemplateInput();
input.assignName("gsh_input_myExtension");
input.assignValueString("zoomTest");
exec.addGshTemplateInput(input);
GshTemplateExecOutput output = exec.execute();
if (output.getGshTemplateOutput().isError()) {
// handle this... e.g. from another template: gsh_builtin_gshTemplateOutput.addOutputLine("Error running sub-template");
}
if (GrouperUtil.length(output.getGshTemplateOutput().getValidationLines()) > 0) {
for (GshValidationLine gshValidationLine : output.getGshTemplateOutput().getValidationLines()) {
// handle this... e.g. from another template
// gsh_builtin_gshTemplateOutput.addOutputLine((String)(gshValidationLine.getInputName() + ": " + gshValidationLine.getText()));
}
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassignActAsSubject(Subject actAsSubject) assignConfigId(String configId) assignCurrentUser(Subject currentUser) assignGshTemplateOwnerType(GshTemplateOwnerType gshTemplateOwnerType) assignOwnerGroupName(String ownerGroupName) assignOwnerStemName(String ownerStemName) assignRemoteAddr(String remoteAddr) assignWsInput(Map<String, Object> wsInput) arbitrary wsInputexecute()execute the gsh templateexecute the gsh template (calls newInstance).pass in so you have a referencestore the outputhave a progress bean to be able to communicate progress to the UIarbitrary wsInputstatic void
-
Constructor Details
-
GshTemplateExec
public GshTemplateExec()
-
-
Method Details
-
getWsInput
arbitrary wsInput- Returns:
-
assignWsInput
arbitrary wsInput- Parameters:
wsInput-
-
getGrouperGroovyRuntime
pass in so you have a reference- Returns:
-
getProgressBean
have a progress bean to be able to communicate progress to the UI- Returns:
- the progressBean
-
getRemoteAddr
-
assignRemoteAddr
-
main
-
assignActAsSubject
-
assignGshTemplateOwnerType
-
assignOwnerStemName
-
assignOwnerGroupName
-
addGshTemplateInput
-
assignConfigId
-
assignCurrentUser
-
getCurrentUser
-
getGshTemplateOwnerType
-
getOwnerStemName
-
getOwnerGroupName
-
getGshTemplateInputs
-
getConfigId
-
getActAsSubject
-
getGshTemplateExecOutput
store the output- Returns:
- the output
-
execute
execute the gsh template- Returns:
-
executeForTemplateV2instance
execute the gsh template (calls newInstance).- Returns:
-