Skip to Content.
Sympa Menu

grouper-users - Re: [grouper-users] Adding the Grouper Deployment Guide structure via GSH

Subject: Grouper Users - Open Discussion List

List archive

Re: [grouper-users] Adding the Grouper Deployment Guide structure via GSH


Chronological Thread 
  • From: Jonathan Keller <>
  • To: "David A. Kovacic" <>
  • Cc: "" <>
  • Subject: Re: [grouper-users] Adding the Grouper Deployment Guide structure via GSH
  • Date: Thu, 17 Jun 2021 21:17:03 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ucdavis.edu; dmarc=pass action=none header.from=ucdavis.edu; dkim=pass header.d=ucdavis.edu; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SBvUI6kz7w3V55t13RKcQkBeqjZGmpIJEH85fPPQUWA=; b=ac/la3N6oIvtkK5NDQMZ4LPCVsR1Z+BFLcQ0ue+bg7fReNXai668gg2pWE7xBjoGZZYUOuCWClkACsyIzOIDYfNbYjx2Wd+WiAxT5VF2x7chjdBzHWj/PFfzGDg+d9ExYb1BHzW9ZGw7yddlW02wGXgOq1cveZNPpVIaLDz+vl/cwvZlNWD8L5oZ0L9EGFLdjsYVrcbCVHi0+e79kfm8FPxGB26TpXSWrqEnFmtpen7nnT8JqXyve42yq6IH72PkmG0PFfZt5g/QVfekObOHbII4efcxY2Qn2aXvg1rCF9X7wdATqZ8PYyRhveKb9wkCiQLYW/fhumFz/MF5VC+tlg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HzAirFMFOkgev7PaSewh+0yyKryyZcZAE8E4CZ5riBIjzSNkJMsuVe0rbI0IRc8VIiY+n2mBXsPDT2pDTt5N48U8zDKvPObRQfXSM66qNf3mk8hJkCdRzrB9W99k0iK9tWd20Bnr9r4pC0PX4uwGKj3a+mRJ7hc8e4YDW1e3vHzzo96rocc2ArgBkRsBDgRGJIyP2Yx+8y5LKPFkgSIFQk+tMDT9uWd/xoySw9F+vyJ2gLGrCLnWA1n6/QlAw9FvG6l4KUFfoRhLBbRFijPkX6/T6sr5K/ky12u/qiy4jgbzVBEx2jTSAfW8EjRbrDUMcHECwha/vBOe0XcNS/FmSA==

Yep!  Due to the way that the template seems to reference Servlet API classes during execution, I found I needed to add this to the classpath when not running on the UI server.  On there, this seemed to be already present.

CLASSPATH=/opt/tomee/lib/servlet-api.jar

--
Jonathan Keller
Application Architect - Administrative IT


On Jun 17, 2021, at 11:50 AM, David A. Kovacic <> wrote:

The groovy script seems to have failed:  The imports and create GrouperSession s... seem to have worked but the following comands are giving a "definition not found error":

groovy:000> GrouperSession s = GrouperSession.startRootSession();
===> 7733c440b1144f00a986befb9bbb3e28,'GrouperSystem','application'
groovy:000> Stem stem = StemFinder.findByName(s, ":");
===> Stem[displayName=,name=,uuid=91aa5a37cc6145968295bd5e9ad79701,creator=cc0c3db0ccb84923ad9833d1d2821ef2]
groovy:000> GrouperRequestContainer.assignUseStaticRequestContainer(true);
ERROR java.lang.NoClassDefFoundError:
javax/servlet/http/HttpServletRequest
groovy:000> GrouperRequestContainer grouperRequestContainer = GrouperRequestContainer.retrieveFromRequestOrCreate();
ERROR java.lang.NoClassDefFoundError:
javax/servlet/http/HttpServletRequest

Any idea what we might be doing wrong?  This is under Grouper 2.5.44

Dave
On 6/15/21 7:02 PM, Jonathan Keller wrote:
"> If by command line you mean running a GSH script: Yes - I was setting up to do this.  We have not automated the running of the script on deployment, but the script to perform the GDG provisioning is part of the image.  But this is the relevant part.  I hope this helps your use case.  After this, the script proceeds to set up a number of stems within the GDG we also want to have as a standard.


import edu.internet2.middleware.grouper.grouperUi.beans.ui.GrouperRequestContainer;
import edu.internet2.middleware.grouper.grouperUi.beans.ui.StemTemplateContainer;
import edu.internet2.middleware.grouper.grouperUi.beans.ui.GrouperTemplateLogicBase;
import edu.internet2.middleware.grouper.grouperUi.beans.ui.ServiceAction;
import edu.internet2.middleware.grouper.grouperUi.serviceLogic.UiV2Template;


GrouperSession s = GrouperSession.startRootSession();

// This block pulls the GDG template (known as tierStructure) and applies it to the database
// Template application commands like these must be run against the UI server
Stem stem = StemFinder.findByName(s, ":");
GrouperRequestContainer.assignUseStaticRequestContainer(true);
GrouperRequestContainer grouperRequestContainer = GrouperRequestContainer.retrieveFromRequestOrCreate();
StemTemplateContainer stemTemplateContainer = grouperRequestContainer.getStemTemplateContainer();
GrouperTemplateLogicBase templateLogic = UiV2Template.getTemplateLogic("tierStructure", stemTemplateContainer);
templateLogic.setStemId(stem.getUuid());
stemTemplateContainer.setCreateNoSubfolder(true);
List allServiceActions = templateLogic.getServiceActions();
for (ServiceAction serviceAction: allServiceActions) { serviceAction.getServiceActionType().createTemplateItem(serviceAction); }

--
Jonathan Keller
Application Architect - Administrative IT

<image001.jpg>

On Jun 15, 2021, at 10:38 AM, David A. Kovacic <> wrote:

AT CWRU, we are trying to make deployment of Grouper more consistent using  ansible playbooks.  We have a number of sub-folders we would like to add to the basic app, basis, etc structure and would like to do them all as one GSH script.  It looks like the current GDG template uses straight Java rather than Groovy.  Is there any way to run the GDG template directly from the command line?

--
David A. Kovacic
Sr. Technical Lead
RCIS
University Technology, [U]Tech
Case Western Reserve University
Email:
Phone: 216.368.5892





--
David A. Kovacic
Sr. Technical Lead
RCIS
University Technology, [U]Tech
Case Western Reserve University
Email:
Phone: 216.368.5892







Archive powered by MHonArc 2.6.24.

Top of Page