You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/01/04 17:54:34 UTC

svn commit: r124123 - /lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/DeleteGroup.java

Author: andreas
Date: Tue Jan  4 08:54:34 2005
New Revision: 124123

URL: http://svn.apache.org/viewcvs?view=rev&rev=124123
Log:
group admin using usecase framework
Added:
   lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/DeleteGroup.java

Added: lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/DeleteGroup.java
Url: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/DeleteGroup.java?view=auto&rev=124123
==============================================================================
--- (empty file)
+++ lenya/trunk/src/java/org/apache/lenya/cms/ac/usecases/DeleteGroup.java	Tue Jan  4 08:54:34 2005
@@ -0,0 +1,43 @@
+/*
+ * Copyright  1999-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.lenya.cms.ac.usecases;
+
+import org.apache.lenya.ac.Group;
+
+/**
+ * Usecase to delete a group.
+ *
+ * @version $Id:$
+ */
+public class DeleteGroup extends AccessControlUsecase {
+
+    /**
+     * @see org.apache.lenya.cms.usecase.AbstractUsecase#doExecute()
+     */
+    protected void doExecute() throws Exception {
+        super.doExecute();
+
+        String groupId = getParameterAsString(GroupProfile.ID);
+        Group group = getGroupManager().getGroup(groupId);
+        if (group == null) {
+            throw new RuntimeException("Group [" + groupId + "] not found.");
+        }
+        
+        getGroupManager().remove(group);
+        group.delete();
+    }
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org