Ejemplo n.º 1
0
 /**
  * Update Groups Registry from XML at URL.
  *
  * <p>
  *
  * @param i BeanShell interpreter.
  * @param stack BeanShell call stack.
  * @param url Use the XML at this <tt>URL</tt> for updates.
  * @return True if successful.
  * @throws GrouperShellException
  * @since 0.1.0
  */
 public static boolean invoke(Interpreter i, CallStack stack, URL url)
     throws GrouperShellException {
   GrouperShell.setOurCommand(i, true);
   try {
     GrouperSession s = GrouperShell.getSession(i);
     XmlImporter importer = new XmlImporter(s, new Properties());
     importer.update(XmlReader.getDocumentFromURL(url));
     return true;
   } catch (GrouperException eG) {
     GrouperShell.error(i, eG);
   }
   return false;
 } // public static boolean invoke(i, stack, url)
Ejemplo n.º 2
0
 /**
  * Add an <code>Attribute</code> to a <code>GroupType</code>.
  *
  * <p>
  *
  * @param i BeanShell interpreter.
  * @param stack BeanShell call stack.
  * @param type Add to this <code>GroupType</code>.
  * @param name Name of <code>Attribute</code>.
  * @param read <code>Privilege</code> required for reading.
  * @param write <code>Privilege</code> required for writing.
  * @param req Is <code>Attribute</code> required.
  * @return <code>Field</code>
  * @throws GrouperShellException
  * @since 0.1.0
  */
 public static Field invoke(
     Interpreter i,
     CallStack stack,
     String type,
     String name,
     Privilege read,
     Privilege write,
     boolean req)
     throws GrouperShellException {
   GrouperShell.setOurCommand(i, true);
   try {
     GrouperSession s = GrouperShell.getSession(i);
     GroupType t = GroupTypeFinder.find(type);
     return t.addAttribute(s, name, read, write, req);
   } catch (InsufficientPrivilegeException eIP) {
     GrouperShell.error(i, eIP);
   } catch (SchemaException eS) {
     GrouperShell.error(i, eS);
   }
   throw new GrouperShellException(E.TYPE_ADDATTR + name);
 } // public static Field invoke(i, stack, type, name, read, write, req)