田源
2025-01-09 8a166a60cfd1a2e593ffa103d10c0dc224fc8628
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.vci.client.uif.actions.client;
 
import java.awt.Component;
 
import com.vci.client.common.objects.RoleObject;
import com.vci.client.framework.delegate.RightManagementClientDelegate;
import com.vci.client.portal.utility.PRMItem;
import com.vci.client.ui.exception.VCIException;
import com.vci.client.ui.swing.components.VCIJOptionPane;
import com.vci.client.uif.engine.client.SelectRoleDialog;
import com.vci.client.uif.engine.client.custom.AbstractCustomAttributeInteceptor;
import com.vci.corba.common.VCIError;
import com.vci.mw.ClientContextVariable;
 
public class SelectRoleAction extends AbstractCustomAttributeInteceptor{
    /**
     * 
     */
    private static final long serialVersionUID = 3408321168989363609L;
 
    public SelectRoleAction(){
        super();
    }
    public SelectRoleAction(PRMItem item) {
        super(item);
    }
 
    @Override
    public String getCustomAttributeSaveValue(PRMItem prm,
            Component parentComponent) throws VCIError {
        // TODO Auto-generated method stub
        SelectRoleDialog eid = new SelectRoleDialog(parentComponent);
        RoleObject role = eid.getRoleObject();
        return role.getId()+SPLIT_CHAR+role.getName();
    }
 
    @Override
    public String getCustomAttributeDisplayValue(String attrVal, PRMItem prm)
            throws VCIError {
        // TODO Auto-generated method stub
        RoleObject role = null;
        try {
            role = new RightManagementClientDelegate().fetchRoleInfoById(attrVal);
        } catch (VCIException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            VCIJOptionPane.showError(ClientContextVariable.getFrame(), "查询角色显示值发生错误" + e.toString());
        }
        return role.getName();
    }
 
}