Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When submitted, if each checkbox is checked, it should do that action (if applicable).  If not applicable, give a warning.  The UI will pass the list of pojos, and "checkSubmitted" is set based on if the checkboxes were checked, to the base class, for a logic method, to implement the template.  There should be a base class method to validate the input, pass the response JS object, and the validate method can write error messages to the screen and return true or false if valid.

New template from GSH

Note: GSH must be run from the UI

Code Block
String templateType = "service";
String stemName = "aStem";
String templateKey = "app3";
String serviceDescription = "app3 app";
String serviceFriendlyName = "app3";
boolean createSubFolder = true;
GrouperSession grouperSession = GrouperSession.startRootSession();
Stem stem = StemFinder.findByName(grouperSession, stemName, true);
edu.internet2.middleware.grouper.grouperUi.beans.ui.GrouperRequestContainer.assignUseStaticRequestContainer(true);
edu.internet2.middleware.grouper.grouperUi.beans.ui.GrouperRequestContainer grouperRequestContainer = edu.internet2.middleware.grouper.grouperUi.beans.ui.GrouperRequestContainer.retrieveFromRequestOrCreate();
edu.internet2.middleware.grouper.grouperUi.beans.ui.StemTemplateContainer stemTemplateContainer = grouperRequestContainer.getStemTemplateContainer();
edu.internet2.middleware.grouper.grouperUi.beans.ui.GrouperTemplateLogicBase templateLogic = edu.internet2.middleware.grouper.grouperUi.serviceLogic.UiV2Template.getTemplateLogic(templateType, stemTemplateContainer);
templateLogic.setStemId(stem.getUuid());
stemTemplateContainer.setCreateNoSubfolder(!createSubFolder);
stemTemplateContainer.setTemplateKey(templateKey);
stemTemplateContainer.setTemplateDescription(serviceDescription);
stemTemplateContainer.setTemplateFriendlyName(serviceFriendlyName);
List allServiceActions = templateLogic.getServiceActions();
// if (templateLogic.validate(allServiceActions)) { throw new RuntimeException("Not valid"); } // dont include this line for some reason
for (edu.internet2.middleware.grouper.grouperUi.beans.ui.ServiceAction serviceAction: allServiceActions) { serviceAction.getServiceActionType().createTemplateItem(serviceAction); }