01: package org.osbl.orga.gui;
02:
03: import org.osbl.client.web.WebModule;
04: import org.osbl.ItemRegistry;
05: import org.osbl.item.BeanLocalizationCollector;
06: import org.osbl.item.BeanAuthorizationCollector;
07: import org.osbl.orga.model.*;
08: import org.osbl.plugin.PluginManager;
09: import org.osbl.plugin.Extension;
10: import org.osbl.identity.gui.*;
11: import org.osbl.client.ClientServiceProvider;
12: import org.osbl.client.wings.form.Editors;
13: import org.osbl.client.wings.navigation.NavigationStructure;
14: import org.osbl.client.wings.action.ShowEditorAction;
15: import org.osbl.client.wings.action.ShowToolAction;
16: import org.osbl.client.action.ActionRegistry;
17:
18: public class OrgaWebModule implements WebModule {
19: PluginManager pluginManager;
20: ItemRegistry authorizationItems;
21: ItemRegistry localizationItems;
22:
23: public void setPluginManager(PluginManager pluginManager) {
24: this .pluginManager = pluginManager;
25: }
26:
27: public void setAuthorizationItems(ItemRegistry authorizationItems) {
28: this .authorizationItems = authorizationItems;
29: }
30:
31: public void setLocalizationItems(ItemRegistry localizationItems) {
32: this .localizationItems = localizationItems;
33: }
34:
35: public void initialize() {
36: authorizationItems.addItems(new BeanAuthorizationCollector(
37: Organisation.class));
38: authorizationItems.addItems(new BeanAuthorizationCollector(
39: Group.class));
40: authorizationItems.addItems(new BeanAuthorizationCollector(
41: Member.class));
42: authorizationItems.addItems(new BeanAuthorizationCollector(
43: Membership.class));
44: authorizationItems.addItems(new BeanAuthorizationCollector(
45: Relationship.class));
46:
47: localizationItems.addItems(new BeanLocalizationCollector(
48: Organisation.class));
49: localizationItems.addItems(new BeanLocalizationCollector(
50: Group.class));
51: localizationItems.addItems(new BeanLocalizationCollector(
52: Member.class));
53: localizationItems.addItems(new BeanLocalizationCollector(
54: Membership.class));
55: localizationItems.addItems(new BeanLocalizationCollector(
56: Relationship.class));
57:
58: Editors.registerEditor(Organisation.class, OrgaEditor.class);
59: Editors.registerEditor(Group.class, OrgaEditor.class);
60: Editors.registerEditor(Membership.class, OrgaEditor.class);
61: Editors.registerEditor(Member.class, MemberEditor.class);
62:
63: ActionRegistry.registerAction(new ShowEditorAction(
64: Organisation.class, "org.osbl.orga.actions.manage"));
65:
66: NavigationStructure navigationStructure = NavigationStructure
67: .getInstance();
68: navigationStructure.addAction("administration",
69: "org.osbl.orga.actions.manage");
70:
71: pluginManager.registerExtension(new Extension("OrgaSubForm",
72: "org.osbl.identity.subForm", OrgaSubForm.class));
73: }
74: }
|