package com.vci.client.uif.actions.client;
|
|
import java.awt.Component;
|
|
import com.vci.client.common.objects.DeptObject;
|
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.uif.engine.client.SelectDeptDialog;
|
import com.vci.client.uif.engine.client.custom.AbstractCustomAttributeInteceptor;
|
import com.vci.corba.common.VCIError;
|
|
public class SelectDeptAction extends AbstractCustomAttributeInteceptor{
|
/**
|
*
|
*/
|
private static final long serialVersionUID = -7157576009760781065L;
|
|
public SelectDeptAction(){
|
super();
|
}
|
public SelectDeptAction(PRMItem item) {
|
super(item);
|
}
|
|
@Override
|
public String getCustomAttributeSaveValue(PRMItem prm,
|
Component parentComponent) throws VCIError {
|
SelectDeptDialog eid = new SelectDeptDialog(parentComponent);
|
DeptObject deptObj = eid.getDeptObj();
|
return deptObj.getId()+SPLIT_CHAR+deptObj.getName();
|
}
|
|
@Override
|
public String getCustomAttributeDisplayValue(String attrVal, PRMItem prm)
|
throws VCIError {
|
// TODO Auto-generated method stub
|
DeptObject deptObj = null;
|
try {
|
deptObj = new RightManagementClientDelegate().fetchDepartmentInfoById(attrVal);
|
} catch (VCIException e) {
|
// TODO Auto-generated catch block
|
e.printStackTrace();
|
}
|
return deptObj.getName();
|
}
|
|
}
|