use of org.apache.ranger.entity.XXPortalUser in project ranger by apache.
the class XAuditMapService method mapEntityToViewBean.
@Override
protected VXAuditMap mapEntityToViewBean(VXAuditMap vObj, XXAuditMap mObj) {
if (mObj != null && vObj != null) {
super.mapEntityToViewBean(vObj, mObj);
XXPortalUser xXPortalUser = null;
if (stringUtil.isEmpty(vObj.getOwner())) {
xXPortalUser = daoManager.getXXPortalUser().getById(mObj.getAddedByUserId());
if (xXPortalUser != null) {
vObj.setOwner(xXPortalUser.getLoginId());
}
}
if (stringUtil.isEmpty(vObj.getUpdatedBy())) {
xXPortalUser = daoManager.getXXPortalUser().getById(mObj.getUpdatedByUserId());
if (xXPortalUser != null) {
vObj.setUpdatedBy(xXPortalUser.getLoginId());
}
}
}
return vObj;
}
use of org.apache.ranger.entity.XXPortalUser in project ranger by apache.
the class XGroupService method createXGroupWithOutLogin.
public VXGroup createXGroupWithOutLogin(VXGroup vxGroup) {
XXGroup xxGroup = daoManager.getXXGroup().findByGroupName(vxGroup.getName());
boolean groupExists = true;
if (xxGroup == null) {
xxGroup = new XXGroup();
groupExists = false;
}
xxGroup = mapViewToEntityBean(vxGroup, xxGroup, 0);
XXPortalUser xXPortalUser = daoManager.getXXPortalUser().getById(createdByUserId);
if (xXPortalUser != null) {
xxGroup.setAddedByUserId(createdByUserId);
xxGroup.setUpdatedByUserId(createdByUserId);
}
if (groupExists) {
xxGroup = getDao().update(xxGroup);
} else {
xxGroup = getDao().create(xxGroup);
}
vxGroup = postCreate(xxGroup);
return vxGroup;
}
use of org.apache.ranger.entity.XXPortalUser in project ranger by apache.
the class XPermMapService method mapViewToEntityBean.
@Override
protected XXPermMap mapViewToEntityBean(VXPermMap vObj, XXPermMap mObj, int OPERATION_CONTEXT) {
if (vObj != null && mObj != null) {
super.mapViewToEntityBean(vObj, mObj, OPERATION_CONTEXT);
XXPortalUser xXPortalUser = null;
if (mObj.getAddedByUserId() == null || mObj.getAddedByUserId() == 0) {
if (!stringUtil.isEmpty(vObj.getOwner())) {
xXPortalUser = daoManager.getXXPortalUser().findByLoginId(vObj.getOwner());
if (xXPortalUser != null) {
mObj.setAddedByUserId(xXPortalUser.getId());
}
}
}
if (mObj.getUpdatedByUserId() == null || mObj.getUpdatedByUserId() == 0) {
if (!stringUtil.isEmpty(vObj.getUpdatedBy())) {
xXPortalUser = daoManager.getXXPortalUser().findByLoginId(vObj.getUpdatedBy());
if (xXPortalUser != null) {
mObj.setUpdatedByUserId(xXPortalUser.getId());
}
}
}
}
return mObj;
}
use of org.apache.ranger.entity.XXPortalUser in project ranger by apache.
the class XResourceService method mapViewToEntityBean.
@Override
protected XXResource mapViewToEntityBean(VXResource vObj, XXResource mObj, int OPERATION_CONTEXT) {
if (vObj != null && mObj != null) {
super.mapViewToEntityBean(vObj, mObj, OPERATION_CONTEXT);
mObj.setUdfs(vObj.getUdfs());
XXPortalUser xXPortalUser = null;
if (mObj.getAddedByUserId() == null || mObj.getAddedByUserId() == 0) {
if (!stringUtil.isEmpty(vObj.getOwner())) {
xXPortalUser = daoManager.getXXPortalUser().findByLoginId(vObj.getOwner());
if (xXPortalUser != null) {
mObj.setAddedByUserId(xXPortalUser.getId());
}
}
}
if (mObj.getUpdatedByUserId() == null || mObj.getUpdatedByUserId() == 0) {
if (!stringUtil.isEmpty(vObj.getUpdatedBy())) {
xXPortalUser = daoManager.getXXPortalUser().findByLoginId(vObj.getUpdatedBy());
if (xXPortalUser != null) {
mObj.setUpdatedByUserId(xXPortalUser.getId());
}
}
}
}
return mObj;
}
use of org.apache.ranger.entity.XXPortalUser in project ranger by apache.
the class XTrxLogService method mapEntityToViewBean.
@Override
protected VXTrxLog mapEntityToViewBean(VXTrxLog vObj, XXTrxLog mObj) {
if (mObj != null && vObj != null) {
super.mapEntityToViewBean(vObj, mObj);
XXPortalUser xXPortalUser = null;
if (stringUtil.isEmpty(vObj.getOwner())) {
xXPortalUser = daoManager.getXXPortalUser().getById(mObj.getAddedByUserId());
if (xXPortalUser != null) {
vObj.setOwner(xXPortalUser.getLoginId());
}
}
if (stringUtil.isEmpty(vObj.getUpdatedBy())) {
xXPortalUser = daoManager.getXXPortalUser().getById(mObj.getUpdatedByUserId());
if (xXPortalUser != null) {
vObj.setUpdatedBy(xXPortalUser.getLoginId());
}
}
}
return vObj;
}
Aggregations