Versions Compared

Key

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

Include Page
spaceKeyGrouper
pageTitleNavigation

The template wizard feature is in Grouper patches grouper_v2_4_0_api_patch_5 and grouper_v2_4_0_ui_patch_2 and later.

Grouper UI templates are available in Grouper 2.4+.

The UI templates allow folder admins to run a function.  The template creates folders and groups and assigns The template wizard helps folder admins implement a new template which has a series of steps.  The template will create folders and groups and assign privileges based on inputs.  This will allow Grouper users to accomplish multiple tasks at once and save time and be more consistent.  An advantage of  The original template implementation was Java-based.  In 2.5+ templates can be implemented with configuration and GSH scripts (Java/groovy).

Tip

Using the template wizard

...

provides a convenient approach to implementing the recommendations for folder and group structure from

...

the Grouper Deployment Guide.

...


Children Display

Table of Contents

Using the Template Wizard

On a folder screen, under "more actions" will be an option for "New Run template"


The wizard will prompt for "Template type", which by default has "Application" and "Grouper Deployment Guide structure."

Application built-in template

The "application" option allows you to give a friendly name to an application and prompts you to set up the recommended folders for an application to be integrated with Grouper.

...



Grouper Deployment Guide structure built-in template

This is a convenient way to implement the recommendations for folder structure from the TIER the Grouper Deployment Guide


...


Creating your own template (GSH)

See the GSH templates for examples

Creating your own template (legacy)

New templates should be configured in grouper-ui.properties, and should extend a common base class.  GrouperTemplateLogicBase

...

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.

...

Run GSH template from GSH

See the GSH attribute sync example

Run template from GSH (legacy)

Note: GSH must be run from the UI.  This works in v4.1.5+

Code Block
    String templateType = "service";
    String stemName = "aStemtest";
    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.StemTemplateContainerGroupStemTemplateContainer stemTemplateContainergroupStemTemplateContainer = grouperRequestContainer.getStemTemplateContainergetGroupStemTemplateContainer();
    edu.internet2.middleware.grouper.grouperUi.beans.ui.GrouperTemplateLogicBase templateLogic = edu.internet2.middleware.grouper.grouperUi.serviceLogic.UiV2Template.getTemplateLogic(templateType, stemTemplateContainergroupStemTemplateContainer);
    templateLogic.setStemId(stem.getUuid());
stemTemplateContainer    groupStemTemplateContainer.setCreateNoSubfolder(!createSubFolder);
stemTemplateContainer    groupStemTemplateContainer.setTemplateKey(templateKey);
stemTemplateContainer    groupStemTemplateContainer.setTemplateDescription(serviceDescription);
stemTemplateContainer    groupStemTemplateContainer.setTemplateFriendlyName(serviceFriendlyName);
List    List<edu.internet2.middleware.grouper.grouperUi.beans.ui.ServiceAction> 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); }