01: package org.osbl.riskmanagement.gui;
02:
03: import org.osbl.ItemRegistry;
04: import org.osbl.plugin.PluginManager;
05: import org.osbl.client.ClientServiceProvider;
06: import org.osbl.client.action.ActionRegistry;
07: import org.osbl.client.web.spring.SpringWebModule;
08: import org.osbl.client.wings.action.*;
09: import org.osbl.client.wings.form.Editors;
10: import org.osbl.client.wings.navigation.NavigationStructure;
11: import org.osbl.client.wings.concern.SubjectEditor;
12: import org.osbl.item.BeanAuthorizationCollector;
13: import org.osbl.item.BeanLocalizationCollector;
14: import org.osbl.riskmanagement.model.*;
15: import org.osbl.riskmanagement.gui.report.RiskReport;
16:
17: public class RiskManagementWebModule extends SpringWebModule {
18: ItemRegistry authorizationItems;
19: ItemRegistry localizationItems;
20:
21: public void setAuthorizationItems(ItemRegistry authorizationItems) {
22: this .authorizationItems = authorizationItems;
23: }
24:
25: public void setLocalizationItems(ItemRegistry localizationItems) {
26: this .localizationItems = localizationItems;
27: }
28:
29: public void initialize() {
30: authorizationItems.addItems(new BeanAuthorizationCollector(
31: Classification.class));
32: authorizationItems.addItems(new BeanAuthorizationCollector(
33: RiskType.class));
34: authorizationItems.addItems(new BeanAuthorizationCollector(
35: Risk.class));
36: authorizationItems.addItems(new BeanAuthorizationCollector(
37: Record.class));
38:
39: localizationItems.addItems(new BeanLocalizationCollector(
40: Classification.class));
41: localizationItems.addItems(new BeanLocalizationCollector(
42: RiskType.class));
43: localizationItems.addItems(new BeanLocalizationCollector(
44: Risk.class));
45: localizationItems.addItems(new BeanLocalizationCollector(
46: Record.class));
47:
48: Editors.registerEditor(Classification.class,
49: RiskTypeEditor.class);
50: Editors.registerEditor(RiskType.class, RiskTypeEditor.class);
51:
52: ActionRegistry.registerAction(new ShowEditorAction(
53: RiskType.class,
54: "org.osbl.riskmanagement.actions.manage"));
55: ActionRegistry.registerAction(new ShowApplicationAction(
56: RiskReport.class,
57: "org.osbl.riskmanagement.actions.report"));
58: ActionRegistry
59: .registerAction(new QueryAction(
60: "org.osbl.riskmanagement.actions.create",
61: "edit=org.concern.model.Process&process=RiskManagement"));
62:
63: NavigationStructure navigationStructure = NavigationStructure
64: .getInstance();
65: navigationStructure.addAction("riskmanagement",
66: "org.osbl.riskmanagement.actions.manage");
67: navigationStructure.addAction("riskmanagement",
68: "org.osbl.riskmanagement.actions.create");
69: navigationStructure.addAction("riskmanagement",
70: "org.osbl.riskmanagement.actions.report");
71: }
72: }
|