1 /*
2 * Copyright 2008 :torweg free software group
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 */18 package org.torweg.pulse.component.core.accesscontrol.admin;
19 20 importorg.torweg.pulse.annotations.Action;
21 importorg.torweg.pulse.annotations.Groups;
22 importorg.torweg.pulse.annotations.Permission;
23 importorg.torweg.pulse.annotations.RequireToken;
24 importorg.torweg.pulse.bundle.Bundle;
25 importorg.torweg.pulse.bundle.Controller;
26 importorg.torweg.pulse.configuration.ConfigBean;
27 importorg.torweg.pulse.configuration.DeprecatedConfigurable;
28 importorg.torweg.pulse.service.event.XSLTOutputEvent;
29 importorg.torweg.pulse.service.request.ServiceRequest;
30 31 /**
32 * Initializes the WEST-Panel for the access-control of the <em>pulse</em>
33 * -web-site-administration.
34 *
35 * @author Daniel Dietz
36 * @version $Revision: 1914 $
37 */38 publicclass AccessControlEditor extendsControllerimplementsDeprecatedConfigurable {
39 40 /**
41 * the configuration.
42 */43 privateAccessControlEditorConfig config;
44 45 /**
46 * Initializes the WEST-Panel within the <em>pulse</em>
47 * -web-site-administration.
48 *
49 * @param bundle
50 * the current {@code Bundle}
51 * @param request
52 * the current {@code ServiceRequest}
53 * @return the initialization {@code Result} for the
54 * {@code AccessControlEditor}
55 */56 @RequireToken57 @Action(value = "accessControlInit", generate = true)
58 @Permission("viewAccessControl")
59 @Groups(values = { "AccessControl:Administrator" })
60 publicfinalAccessControlEditorResult initAccessControl(finalBundle bundle,
61 finalServiceRequest request) {
62 AccessControlEditorResult result = newAccessControlEditorResult();
63 XSLTOutputEvent event = newXSLTOutputEvent(this.config
64 .getAjaxWestXSL());
65 event.setStopEvent(true);
66 request.getEventManager().addEvent(event);
67 return result;
68 }
69 70 /**
71 * initializes the {@code AccessControlEditor}.
72 *
73 * @param c
74 * the {@code ConfigBean} of this {@code Controller}
75 */76 publicfinalvoid init(finalConfigBean c) {
77 this.config = (AccessControlEditorConfig) c;
78 }
79 80 }
81