001package org.kuali.ole.select.gokb; 002 003import org.apache.commons.lang.StringUtils; 004import org.kuali.ole.OLEConstants; 005import org.kuali.ole.select.bo.OLEPlatformStatus; 006import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; 007import org.kuali.rice.krad.service.KRADServiceLocator; 008 009import java.sql.Timestamp; 010import java.util.HashMap; 011import java.util.List; 012import java.util.Map; 013 014/** 015 * Created by premkumarv on 12/8/14. 016 */ 017public class OleGokbPlatform extends PersistableBusinessObjectBase { 018 019 private Integer gokbPlatformId; 020 private String platformName; 021 private String status; 022 private String statusId; 023 private Integer platformProviderId=0; 024 private String platformProvider; 025 private String authentication; 026 private String softwarePlatform; 027 private Timestamp dateCreated; 028 private Timestamp dateUpdated; 029 private OleGokbOrganization oleGokbOrganization; 030 031 032 033 public Integer getGokbPlatformId() { 034 return gokbPlatformId; 035 } 036 037 public void setGokbPlatformId(Integer gokbPlatformId) { 038 this.gokbPlatformId = gokbPlatformId; 039 } 040 041 public String getPlatformName() { 042 return platformName; 043 } 044 045 public void setPlatformName(String platformName) { 046 this.platformName = platformName; 047 } 048 049 public String getStatus() { 050 return status; 051 } 052 053 public void setStatus(String status) { 054 this.status = status; 055 } 056 057 public String getStatusId() { 058 if (StringUtils.isNotBlank(this.getStatus())){ 059 Map statusMap = new HashMap(); 060 statusMap.put(OLEConstants.PLATFORM_STATUS_NAME, this.getStatus()); 061 List<OLEPlatformStatus> platformStatusList = (List<OLEPlatformStatus>) KRADServiceLocator.getBusinessObjectService().findMatching(OLEPlatformStatus.class, statusMap); 062 if (platformStatusList != null && platformStatusList.size() > 0) { 063 return platformStatusList.get(0).getPlatformStatusId(); 064 } 065 } 066 return statusId; 067 } 068 069 public void setStatusId(String statusId) { 070 this.statusId = statusId; 071 } 072 073 public Integer getPlatformProviderId() { 074 return platformProviderId; 075 } 076 077 public void setPlatformProviderId(Integer platformProviderId) { 078 this.platformProviderId = platformProviderId; 079 } 080 081 public String getPlatformProvider() { 082 if (oleGokbOrganization!=null){ 083 return oleGokbOrganization.getOrganizationName(); 084 } 085 return platformProvider; 086 } 087 088 public void setPlatformProvider(String platformProvider) { 089 this.platformProvider = platformProvider; 090 } 091 092 public String getAuthentication() { 093 return authentication; 094 } 095 096 public void setAuthentication(String authentication) { 097 this.authentication = authentication; 098 } 099 100 public String getSoftwarePlatform() { 101 return softwarePlatform; 102 } 103 104 public void setSoftwarePlatform(String softwarePlatform) { 105 this.softwarePlatform = softwarePlatform; 106 } 107 108 public Timestamp getDateCreated() { 109 return dateCreated; 110 } 111 112 public void setDateCreated(Timestamp dateCreated) { 113 this.dateCreated = dateCreated; 114 } 115 116 public Timestamp getDateUpdated() { 117 return dateUpdated; 118 } 119 120 public void setDateUpdated(Timestamp dateUpdated) { 121 this.dateUpdated = dateUpdated; 122 } 123 124 public OleGokbOrganization getOleGokbOrganization() { 125 return oleGokbOrganization; 126 } 127 128 public void setOleGokbOrganization(OleGokbOrganization oleGokbOrganization) { 129 this.oleGokbOrganization = oleGokbOrganization; 130 } 131}