KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > corbaclient > workflowadmin > user > actions > RemoveUserMapping


1 package org.enhydra.shark.corbaclient.workflowadmin.user.actions;
2
3 import java.awt.event.*;
4 import javax.swing.*;
5
6 import org.omg.WfBase.*;
7 import org.enhydra.shark.corbaclient.*;
8 import org.enhydra.shark.corbaclient.workflowadmin.*;
9 import org.enhydra.shark.corbaclient.workflowadmin.user.*;
10 import org.enhydra.shark.corba.WorkflowService.*;
11
12 /**
13  * Removes xpdl participant to system user mapping.
14  *
15  * @author Sasa Bojanic
16  * @version 1.0
17  */

18 public class RemoveUserMapping extends ActionBase {
19
20    public RemoveUserMapping (UserMappingManagement umm) {
21       super(umm);
22    }
23
24    public void actionPerformed(ActionEvent e) {
25       UserMappingManagement umm=(UserMappingManagement)actionPanel;
26       SharkAdmin workflowAdmin=umm.getWorkflowAdmin();
27
28       MappingAdministration mm=SharkAdmin.getMappingAdmin();
29
30       try {
31          String JavaDoc packageId=(String JavaDoc)umm.getExistingMappingsPanel().getColumnValueOfSelectedRow(0);
32          String JavaDoc processDefinitionId=(String JavaDoc)umm.getExistingMappingsPanel().getColumnValueOfSelectedRow(1);
33          String JavaDoc participantId=(String JavaDoc)umm.getExistingMappingsPanel().getColumnValueOfSelectedRow(2);
34          String JavaDoc username=(String JavaDoc)umm.getExistingMappingsPanel().getColumnValueOfSelectedRow(5);
35          boolean isGroupUser=((Boolean JavaDoc)umm.getExistingMappingsPanel().getColumnValueOfSelectedRow(8)).booleanValue();
36          ParticipantMap pm=mm.createParticipantMap();
37          pm.setPackageId(packageId);
38          pm.setProcessDefinitionId(processDefinitionId);
39          pm.setParticipantId(participantId);
40          pm.setUsername(username);
41          pm.setIsGroupUser(isGroupUser);
42          mm.removeParticipantMapping(pm);
43          umm.refresh(true);
44       } catch (Exception JavaDoc ex) {
45           JOptionPane.showMessageDialog(workflowAdmin.getFrame(),
46             ResourceManager.getLanguageDependentString("MessageMappingCannotBeRemovedAtTheMoment"),
47             workflowAdmin.getAppTitle(),JOptionPane.INFORMATION_MESSAGE);
48       }
49    }
50 }
51
Popular Tags