Skip to content

Commit

Permalink
Merge pull request #12161 from dulithsenanayake/api-tile-enhancement
Browse files Browse the repository at this point in the history
[Feature] Api tile enhancement
  • Loading branch information
dulithsenanayake authored Oct 2, 2023
2 parents b403923 + adb77ba commit c2d8c7c
Show file tree
Hide file tree
Showing 24 changed files with 1,093 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3925,6 +3925,11 @@ public Map<String, Object> searchPaginatedContent(String searchQuery, String org
api.setContextTemplate(publiserAPI.getContext());
api.setStatus(publiserAPI.getStatus());
api.setBusinessOwner(publiserAPI.getBusinessOwner());
api.setBusinessOwnerEmail(publiserAPI.getBusinessOwnerEmail());
api.setTechnicalOwner(publiserAPI.getTechnicalOwner());
api.setTechnicalOwnerEmail(publiserAPI.getTechnicalOwnerEmail());
api.setMonetizationEnabled(publiserAPI.getMonetizationStatus());
api.setAdvertiseOnly(publiserAPI.getAdvertiseOnly());
api.setRating(0);// need to retrieve from db
apiSet.add(api);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5179,6 +5179,12 @@ public Map<String, Object> searchPaginatedContent(String searchQuery, String org
api.setContextTemplate(publiserAPI.getContext());
api.setStatus(publiserAPI.getStatus());
api.setThumbnailUrl(publiserAPI.getThumbnailUri());
api.setBusinessOwner(publiserAPI.getBusinessOwner());
api.setBusinessOwnerEmail(publiserAPI.getBusinessOwnerEmail());
api.setTechnicalOwner(publiserAPI.getTechnicalOwner());
api.setTechnicalOwnerEmail(publiserAPI.getTechnicalOwnerEmail());
api.setMonetizationEnabled(publiserAPI.getMonetizationStatus());
api.setAdvertiseOnly(publiserAPI.getAdvertiseOnly());
apiSet.add(api);
} else if ("APIProduct".equals(item.getType())) {

Expand All @@ -5189,6 +5195,11 @@ public Map<String, Object> searchPaginatedContent(String searchQuery, String org
api.setContextTemplate(publiserAPI.getContext());
api.setState(publiserAPI.getStatus());
api.setThumbnailUrl(publiserAPI.getThumbnailUri());
api.setBusinessOwner(publiserAPI.getBusinessOwner());
api.setBusinessOwnerEmail(publiserAPI.getBusinessOwnerEmail());
api.setTechnicalOwner(publiserAPI.getTechnicalOwner());
api.setTechnicalOwnerEmail(publiserAPI.getTechnicalOwnerEmail());
api.setMonetizationEnabled(publiserAPI.getMonetizationStatus());
apiProductSet.add(api);
} else if (item instanceof DocumentSearchContent) {
// doc item
Expand Down Expand Up @@ -5337,6 +5348,11 @@ public Map<String, Object> searchPaginatedAPIProducts(String searchQuery, String
mappedAPI.setContext(publisherAPIInfo.getContext());
mappedAPI.setApiSecurity(publisherAPIInfo.getApiSecurity());
mappedAPI.setThumbnailUrl(publisherAPIInfo.getThumbnail());
mappedAPI.setBusinessOwner(publisherAPIInfo.getBusinessOwner());
mappedAPI.setBusinessOwnerEmail(publisherAPIInfo.getBusinessOwnerEmail());
mappedAPI.setTechnicalOwner(publisherAPIInfo.getTechnicalOwner());
mappedAPI.setTechnicalOwnerEmail(publisherAPIInfo.getTechnicalOwnerEmail());
mappedAPI.setMonetizationEnabled(publisherAPIInfo.getMonetizationStatus());
populateAPIStatus(mappedAPI);
productList.add(mappedAPI);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,12 @@ private PublisherAPISearchResult searchPaginatedPublisherAPIs(Registry userRegis
apiInfo.setGatewayVendor(String.valueOf(artifact.getAttribute(APIConstants.API_OVERVIEW_GATEWAY_VENDOR)));
apiInfo.setAdvertiseOnly(Boolean.parseBoolean(artifact
.getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY)));
apiInfo.setBusinessOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER));
apiInfo.setBusinessOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL));
apiInfo.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER));
apiInfo.setTechnicalOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL));
apiInfo.setMonetizationStatus(Boolean.parseBoolean(artifact.
getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS)));
publisherAPIInfoList.add(apiInfo);

// Ensure the APIs returned matches the length, there could be an additional API
Expand Down Expand Up @@ -1094,6 +1100,9 @@ private DevPortalAPISearchResult searchPaginatedDevPortalAPIs(Registry userRegis
apiInfo.setStatus(artifact.getAttribute(APIConstants.API_OVERVIEW_STATUS));
apiInfo.setThumbnail(artifact.getAttribute(APIConstants.API_OVERVIEW_THUMBNAIL_URL));
apiInfo.setBusinessOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER));
apiInfo.setBusinessOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL));
apiInfo.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER));
apiInfo.setTechnicalOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL));
apiInfo.setVersion(artifact.getAttribute(APIConstants.API_OVERVIEW_VERSION));
String tiers = artifact.getAttribute(APIConstants.API_OVERVIEW_TIER);
Set<String> availableTiers = new HashSet<String>();
Expand All @@ -1109,6 +1118,10 @@ private DevPortalAPISearchResult searchPaginatedDevPortalAPIs(Registry userRegis
apiInfo.setSubscriptionAvailableOrgs(
artifact.getAttribute(APIConstants.API_OVERVIEW_SUBSCRIPTION_AVAILABLE_TENANTS));
apiInfo.setGatewayVendor(artifact.getAttribute(APIConstants.API_OVERVIEW_GATEWAY_VENDOR));
apiInfo.setMonetizationStatus(Boolean.parseBoolean(artifact.
getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS)));
apiInfo.setAdvertiseOnly(Boolean.parseBoolean(artifact
.getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY)));
devPortalAPIInfoList.add(apiInfo);

// Ensure the APIs returned matches the length, there could be an additional API
Expand Down Expand Up @@ -1223,6 +1236,15 @@ private DevPortalAPISearchResult searchPaginatedDevPortalAPIsByDoc(Registry regi
apiInfo.setSubscriptionAvailableOrgs(artifact
.getAttribute(APIConstants.API_OVERVIEW_SUBSCRIPTION_AVAILABLE_TENANTS));
apiInfo.setGatewayVendor(artifact.getAttribute(APIConstants.API_OVERVIEW_GATEWAY_VENDOR));
apiInfo.setAdvertiseOnly(Boolean.parseBoolean(artifact
.getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY)));
apiInfo.setBusinessOwnerEmail(artifact.
getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL));
apiInfo.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER));
apiInfo.setTechnicalOwnerEmail(artifact.
getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL));
apiInfo.setMonetizationStatus(Boolean.parseBoolean(artifact.
getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS)));
devPortalAPIInfoList.add(apiInfo);
}

Expand Down Expand Up @@ -1338,6 +1360,14 @@ private PublisherAPISearchResult searchPaginatedPublisherAPIsByDoc(Registry regi
apiInfo.setVersion(artifact.getAttribute(APIConstants.API_OVERVIEW_VERSION));
apiInfo.setAdvertiseOnly(Boolean.parseBoolean(artifact
.getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY)));
apiInfo.setBusinessOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER));
apiInfo.setBusinessOwnerEmail(artifact.
getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL));
apiInfo.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER));
apiInfo.setTechnicalOwnerEmail(artifact.
getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL));
apiInfo.setMonetizationStatus(Boolean.parseBoolean(artifact.
getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS)));
publisherAPIInfoList.add(apiInfo);
}

Expand Down Expand Up @@ -1508,6 +1538,11 @@ public PublisherContentSearchResult searchContentForPublisher(Organization org,
content.setStatus(pubAPI.getStatus());
content.setAdvertiseOnly(pubAPI.isAdvertiseOnly());
content.setThumbnailUri(pubAPI.getThumbnail());
content.setBusinessOwner(pubAPI.getBusinessOwner());
content.setBusinessOwnerEmail(pubAPI.getBusinessOwnerEmail());
content.setTechnicalOwner(pubAPI.getTechnicalOwner());
content.setTechnicalOwnerEmail(pubAPI.getTechnicalOwnerEmail());
content.setMonetizationStatus(pubAPI.getMonetizationStatus());
contentData.add(content);
} else {
throw new GovernanceException("artifact id is null for " + resourcePath);
Expand Down Expand Up @@ -1646,6 +1681,11 @@ public DevPortalContentSearchResult searchContentForDevPortal(Organization org,
content.setStatus(devAPI.getStatus());
content.setBusinessOwner(devAPI.getBusinessOwner());
content.setBusinessOwnerEmail(devAPI.getBusinessOwnerEmail());
content.setBusinessOwnerEmail(devAPI.getBusinessOwnerEmail());
content.setTechnicalOwner(devAPI.getTechnicalOwner());
content.setTechnicalOwnerEmail(devAPI.getTechnicalOwnerEmail());
content.setMonetizationStatus(devAPI.getMonetizationStatus());
content.setAdvertiseOnly(devAPI.isAdvertiseOnly());

contentData.add(content);
} else {
Expand Down Expand Up @@ -3303,6 +3343,12 @@ public PublisherAPIProductSearchResult searchAPIProductsForPublisher(Organizatio
info.setVersion(artifact.getAttribute(APIConstants.API_OVERVIEW_VERSION));
info.setApiSecurity(artifact.getAttribute(APIConstants.API_OVERVIEW_API_SECURITY));
info.setThumbnail(artifact.getAttribute(APIConstants.API_OVERVIEW_THUMBNAIL_URL));
info.setBusinessOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER));
info.setBusinessOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL));
info.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER));
info.setTechnicalOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL));
info.setMonetizationStatus(Boolean.parseBoolean(artifact.
getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS)));

publisherAPIProductInfoList.add(info);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public class DevPortalAPIInfo {
private String description;
private String gatewayVendor;
private Map<String, String> additionalProperties;
private String businessOwnerEmail;
private String technicalOwner;
private String technicalOwnerEmail;
private Boolean isMonetizationEnabled;
private boolean advertiseOnly;

public void setGatewayVendor(String gatewayVendor) {
this.gatewayVendor = gatewayVendor;
Expand Down Expand Up @@ -145,13 +150,56 @@ public void setAdditionalProperties(Map<String, String> additionalProperties) {
this.additionalProperties = additionalProperties;
}

public String getBusinessOwnerEmail() {
return businessOwnerEmail;
}

public void setBusinessOwnerEmail(String businessOwnerEmail) {
this.businessOwnerEmail = businessOwnerEmail;
}

public String getTechnicalOwner() {
return technicalOwner;
}

public void setTechnicalOwner(String technicalOwner) {
this.technicalOwner = technicalOwner;
}

public String getTechnicalOwnerEmail() {
return technicalOwnerEmail;
}

public void setTechnicalOwnerEmail(String technicalOwnerEmail) {
this.technicalOwnerEmail = technicalOwnerEmail;
}

public Boolean getMonetizationStatus() {
return isMonetizationEnabled;
}

public void setMonetizationStatus(Boolean isMonetizationEnabled) {
this.isMonetizationEnabled = isMonetizationEnabled;
}

public boolean isAdvertiseOnly() {
return advertiseOnly;
}

public void setAdvertiseOnly(boolean advertiseOnly) {
this.advertiseOnly = advertiseOnly;
}

@Override
public String toString() {
return "DevPortalAPIInfo [id=" + id + ", apiName=" + apiName + ", description=" + description + ", version="
+ version + ", providerName=" + providerName + ", context=" + context + ", type=" + type + ", " +
"thumbnail=" + thumbnail + ", businessOwner=" + businessOwner + ", status=" + status + ", " +
"availableTierNames=" + availableTierNames + ", subscriptionAvailability=" + subscriptionAvailability
+ ", subscriptionAvailableOrgs=" + subscriptionAvailableOrgs + "]";
"thumbnail=" + thumbnail + ", businessOwner=" + businessOwner + ", businessOwnerEmail="
+ businessOwnerEmail + ", technicalOwner=" + technicalOwner + ", technicalOwnerEmail="
+ technicalOwnerEmail + ", status=" + status + ", " + "availableTierNames=" + availableTierNames +
", subscriptionAvailability=" + subscriptionAvailability + ", subscriptionAvailableOrgs="
+ subscriptionAvailableOrgs + ", isMonetizationEnabled=" + isMonetizationEnabled + ", advertiseOnly="
+ advertiseOnly +"]";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class DevPortalSearchContent implements SearchContent {
String technicalOwner;
String technicalOwnerEmail;
String avgRating;
Boolean isMonetizationEnabled;
Boolean advertiseOnly;

@Override
public String getId() {
Expand Down Expand Up @@ -155,4 +157,20 @@ public void setAvgRating(String avgRating) {
this.avgRating = avgRating;
}

public Boolean getAdvertiseOnly() {
return advertiseOnly;
}

public void setAdvertiseOnly(Boolean advertiseOnly) {
this.advertiseOnly = advertiseOnly;
}

public Boolean getMonetizationStatus() {
return isMonetizationEnabled;
}

public void setMonetizationStatus(Boolean isMonetizationEnabled) {
this.isMonetizationEnabled = isMonetizationEnabled;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public class PublisherAPIInfo {
private String gatewayVendor;
private boolean advertiseOnly;
private String updatedBy;
private String businessOwner;
private String businessOwnerEmail;
private String technicalOwner;
private String technicalOwnerEmail;
private Boolean isMonetizationEnabled;

public String getAudience() {
return audience;
Expand Down Expand Up @@ -156,11 +161,53 @@ public void setAdvertiseOnly(boolean advertiseOnly) {
this.advertiseOnly = advertiseOnly;
}

public String getBusinessOwner() {
return businessOwner;
}

public void setBusinessOwner(String businessOwner) {
this.businessOwner = businessOwner;
}

public String getBusinessOwnerEmail() {
return businessOwnerEmail;
}

public void setBusinessOwnerEmail(String businessOwnerEmail) {
this.businessOwnerEmail = businessOwnerEmail;
}

public String getTechnicalOwner() {
return technicalOwner;
}

public void setTechnicalOwner(String technicalOwner) {
this.technicalOwner = technicalOwner;
}

public String getTechnicalOwnerEmail() {
return technicalOwnerEmail;
}

public void setTechnicalOwnerEmail(String technicalOwnerEmail) {
this.technicalOwnerEmail = technicalOwnerEmail;
}

public Boolean getMonetizationStatus() {
return isMonetizationEnabled;
}

public void setMonetizationStatus(Boolean isMonetizationEnabled) {
this.isMonetizationEnabled = isMonetizationEnabled;
}

@Override
public String toString() {
return "PublisherAPIInfo [id=" + id + ", apiName=" + apiName + ", description=" + description + ", version=" +
version + ", providerName=" + providerName + ", context=" + context + ", status=" + status + ", type="
+ type + ", thumbnail=" + thumbnail + ", advertiseOnly=" + advertiseOnly + "]";
+ type + ", thumbnail=" + thumbnail + ", advertiseOnly=" + advertiseOnly + ", businessOwner=" +
businessOwner + ", businessOwnerEmail=" + businessOwnerEmail + ", technicalOwner=" + technicalOwner +
", technicalOwnerEmail=" + technicalOwnerEmail + ", isMonetizationEnabled=" + isMonetizationEnabled +"]";
}

public Map<String, String> getAdditionalProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ public class PublisherAPIProductInfo {
private String type;
private String apiSecurity;
private String thumbnail;
private String businessOwner;
private String businessOwnerEmail;
private String technicalOwner;
private String technicalOwnerEmail;
private Boolean isMonetizationEnabled;
public String getThumbnail() {
return thumbnail;
}
Expand Down Expand Up @@ -88,5 +93,34 @@ public void setApiSecurity(String apiSecurity) {
this.apiSecurity = apiSecurity;
}
private String gatewayVendor;

public String getBusinessOwner() {
return businessOwner;
}
public void setBusinessOwner(String businessOwner) {
this.businessOwner = businessOwner;
}
public String getBusinessOwnerEmail() {
return businessOwnerEmail;
}
public void setBusinessOwnerEmail(String businessOwnerEmail) {
this.businessOwnerEmail = businessOwnerEmail;
}
public String getTechnicalOwner() {
return technicalOwner;
}
public void setTechnicalOwner(String technicalOwner) {
this.technicalOwner = technicalOwner;
}
public String getTechnicalOwnerEmail() {
return technicalOwnerEmail;
}
public void setTechnicalOwnerEmail(String technicalOwnerEmail) {
this.technicalOwnerEmail = technicalOwnerEmail;
}
public Boolean getMonetizationStatus() {
return isMonetizationEnabled;
}
public void setMonetizationStatus(Boolean isMonetizationEnabled) {
this.isMonetizationEnabled = isMonetizationEnabled;
}
}
Loading

0 comments on commit c2d8c7c

Please sign in to comment.