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();
|
}
|
|
}
|