-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/MARP-473-follow-up-for-marp-264-i…
…nstallation-frequency-providing-data
- Loading branch information
Showing
32 changed files
with
2,310 additions
and
1,559 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
...place-service/src/main/java/com/axonivy/market/assembler/ProductDetailModelAssembler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.axonivy.market.assembler; | ||
|
||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.linkTo; | ||
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.methodOn; | ||
|
||
import com.axonivy.market.controller.ProductDetailsController; | ||
import com.axonivy.market.entity.Product; | ||
import com.axonivy.market.entity.ProductModuleContent; | ||
import com.axonivy.market.model.ProductDetailModel; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.springframework.hateoas.server.mvc.RepresentationModelAssemblerSupport; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.List; | ||
|
||
@Component | ||
public class ProductDetailModelAssembler extends RepresentationModelAssemblerSupport<Product, ProductDetailModel> { | ||
|
||
private final ProductModelAssembler productModelAssembler; | ||
|
||
public ProductDetailModelAssembler(ProductModelAssembler productModelAssembler) { | ||
super(ProductDetailsController.class, ProductDetailModel.class); | ||
this.productModelAssembler = productModelAssembler; | ||
} | ||
|
||
@Override | ||
public ProductDetailModel toModel(Product product) { | ||
return createModel(product, null); | ||
} | ||
|
||
public ProductDetailModel toModel(Product product, String tag) { | ||
return createModel(product, tag); | ||
} | ||
|
||
private ProductDetailModel createModel(Product product, String tag) { | ||
ResponseEntity<ProductDetailModel> selfLinkWithTag; | ||
ProductDetailModel model = instantiateModel(product); | ||
productModelAssembler.createResource(model, product); | ||
if (StringUtils.isBlank(tag)) { | ||
selfLinkWithTag = methodOn(ProductDetailsController.class).findProductDetails(product.getId()); | ||
} else { | ||
selfLinkWithTag = methodOn(ProductDetailsController.class).findProductDetailsByVersion(product.getId(), tag); | ||
} | ||
model.add(linkTo(selfLinkWithTag).withSelfRel()); | ||
createDetailResource(model, product, tag); | ||
return model; | ||
} | ||
|
||
private void createDetailResource(ProductDetailModel model, Product product, String tag) { | ||
model.setVendor(product.getVendor()); | ||
model.setNewestReleaseVersion(product.getNewestReleaseVersion()); | ||
model.setPlatformReview(product.getPlatformReview()); | ||
model.setSourceUrl(product.getSourceUrl()); | ||
model.setStatusBadgeUrl(product.getStatusBadgeUrl()); | ||
model.setLanguage(product.getLanguage()); | ||
model.setIndustry(product.getIndustry()); | ||
model.setCompatibility(product.getCompatibility()); | ||
model.setContactUs(product.getContactUs()); | ||
model.setCost(product.getCost()); | ||
|
||
if (StringUtils.isBlank(tag) && StringUtils.isNotBlank(product.getNewestReleaseVersion())) { | ||
tag = product.getNewestReleaseVersion(); | ||
} | ||
ProductModuleContent content = getProductModuleContentByTag(product.getProductModuleContents(), tag); | ||
model.setProductModuleContent(content); | ||
} | ||
|
||
private ProductModuleContent getProductModuleContentByTag(List<ProductModuleContent> contents, String tag) { | ||
return contents.stream().filter(content -> StringUtils.equals(content.getTag(), tag)).findAny().orElse(null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 9 additions & 14 deletions
23
marketplace-service/src/main/java/com/axonivy/market/constants/MavenConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
package com.axonivy.market.constants; | ||
|
||
public class MavenConstants { | ||
private MavenConstants() { | ||
} | ||
private MavenConstants() {} | ||
|
||
public static final String SNAPSHOT_RELEASE_POSTFIX = "-SNAPSHOT"; | ||
public static final String SPRINT_RELEASE_POSTFIX = "-m"; | ||
public static final String PRODUCT_ARTIFACT_POSTFIX = "-product"; | ||
public static final String METADATA_URL_FORMAT = "%s/%s/%s/maven-metadata.xml"; | ||
public static final String DEFAULT_IVY_MAVEN_BASE_URL = "https://maven.axonivy.com"; | ||
public static final String DOT_SEPARATOR = "."; | ||
public static final String GROUP_ID_URL_SEPARATOR = "/"; | ||
public static final String ARTIFACT_ID_SEPARATOR = "-"; | ||
public static final String ARTIFACT_NAME_SEPARATOR = " "; | ||
public static final String ARTIFACT_DOWNLOAD_URL_FORMAT = "%s/%s/%s/%s/%s-%s.%s"; | ||
public static final String ARTIFACT_NAME_FORMAT = "%s (%s)"; | ||
public static final String VERSION_EXTRACT_FORMAT_FROM_METADATA_FILE = "//versions/version/text()"; | ||
public static final String SNAPSHOT_RELEASE_POSTFIX = "-SNAPSHOT"; | ||
public static final String SPRINT_RELEASE_POSTFIX = "-m"; | ||
public static final String PRODUCT_ARTIFACT_POSTFIX = "-product"; | ||
public static final String METADATA_URL_FORMAT = "%s/%s/%s/maven-metadata.xml"; | ||
public static final String DEFAULT_IVY_MAVEN_BASE_URL = "https://maven.axonivy.com"; | ||
public static final String ARTIFACT_DOWNLOAD_URL_FORMAT = "%s/%s/%s/%s/%s-%s.%s"; | ||
public static final String ARTIFACT_NAME_FORMAT = "%s (%s)"; | ||
public static final String VERSION_EXTRACT_FORMAT_FROM_METADATA_FILE = "//versions/version/text()"; | ||
} |
11 changes: 11 additions & 0 deletions
11
marketplace-service/src/main/java/com/axonivy/market/constants/MetaConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.axonivy.market.constants; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class MetaConstants { | ||
public static final String META_FILE = "meta.json"; | ||
public static final String DEFAULT_VENDOR_NAME = "Axon Ivy AG"; | ||
public static final String DEFAULT_VENDOR_URL = "https://www.axonivy.com"; | ||
} |
39 changes: 23 additions & 16 deletions
39
...ervice/src/main/java/com/axonivy/market/constants/NonStandardProductPackageConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
package com.axonivy.market.constants; | ||
|
||
public class NonStandardProductPackageConstants { | ||
private NonStandardProductPackageConstants() { | ||
} | ||
private NonStandardProductPackageConstants() {} | ||
|
||
public static final String PORTAL = "portal"; | ||
public static final String MICROSOFT_365 = ""; // No meta.json | ||
public static final String MICROSOFT_CALENDAR = "msgraph-calendar"; // no fix product json | ||
public static final String MICROSOFT_MAIL = "msgraph-mail";// no fix product json | ||
public static final String MICROSOFT_TEAMS = "msgraph-chat";// no fix product json | ||
public static final String MICROSOFT_TODO = "msgraph-todo";// no fix product json | ||
public static final String CONNECTIVITY_FEATURE = "connectivity-demo"; | ||
public static final String EMPLOYEE_ONBOARDING = "employee-onboarding"; // Invalid meta.json | ||
public static final String ERROR_HANDLING = "error-handling-demo"; | ||
public static final String RULE_ENGINE_DEMOS = "rule-engine-demo"; | ||
public static final String WORKFLOW_DEMO = "workflow-demo"; | ||
public static final String HTML_DIALOG_DEMO = "html-dialog-demo"; | ||
public static final String PROCESSING_VALVE_DEMO = "processing-valve-demo";// no product json | ||
} | ||
public static final String PORTAL = "portal"; | ||
public static final String MICROSOFT_REPO_NAME = "msgraph-connector"; | ||
public static final String MICROSOFT_365 = "msgraph"; // No meta.json | ||
public static final String MICROSOFT_CALENDAR = "msgraph-calendar"; // no fix product json | ||
public static final String MICROSOFT_MAIL = "msgraph-mail";// no fix product json | ||
public static final String MICROSOFT_TEAMS = "msgraph-chat";// no fix product json | ||
public static final String MICROSOFT_TODO = "msgraph-todo";// no fix product json | ||
public static final String CONNECTIVITY_FEATURE = "connectivity-demo"; | ||
public static final String EMPLOYEE_ONBOARDING = "employee-onboarding"; // Invalid meta.json | ||
public static final String ERROR_HANDLING = "error-handling-demo"; | ||
public static final String RULE_ENGINE_DEMOS = "rule-engine-demo"; | ||
public static final String WORKFLOW_DEMO = "workflow-demo"; | ||
public static final String HTML_DIALOG_DEMO = "html-dialog-demo"; | ||
public static final String PROCESSING_VALVE_DEMO = "processing-valve-demo";// no product json | ||
public static final String OPENAI_CONNECTOR = "openai-connector"; | ||
public static final String OPENAI_ASSISTANT = "openai-assistant"; | ||
// Non standard image folder name | ||
public static final String EXCEL_IMPORTER = "excel-importer"; | ||
public static final String EXPRESS_IMPORTER = "express-importer"; | ||
public static final String GRAPHQL_DEMO = "graphql-demo"; | ||
public static final String DEEPL_CONNECTOR = "deepl-connector"; | ||
} |
32 changes: 16 additions & 16 deletions
32
marketplace-service/src/main/java/com/axonivy/market/constants/ProductJsonConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
package com.axonivy.market.constants; | ||
|
||
public class ProductJsonConstants { | ||
public static final String PRODUCT_JSON_FILE = "product.json"; | ||
public static final String DATA = "data"; | ||
public static final String REPOSITORIES = "repositories"; | ||
public static final String URL = "url"; | ||
public static final String ID = "id"; | ||
public static final String PROJECTS = "projects"; | ||
public static final String ARTIFACT_ID = "artifactId"; | ||
public static final String GROUP_ID = "groupId"; | ||
public static final String TYPE = "type"; | ||
public static final String DEPENDENCIES = "dependencies"; | ||
public static final String INSTALLERS = "installers"; | ||
public static final String DEPENDENCY_SUFFIX = "-dependency"; | ||
public static final String MAVEN_IMPORT_INSTALLER_ID = "maven-import"; | ||
public static final String MAVEN_DROPIN_INSTALLER_ID = "maven-dropins"; | ||
public static final String MAVEN_DEPENDENCY_INSTALLER_ID = "maven-dependency"; | ||
|
||
public static final String DATA = "data"; | ||
public static final String REPOSITORIES = "repositories"; | ||
public static final String URL = "url"; | ||
public static final String ID = "id"; | ||
public static final String PROJECTS = "projects"; | ||
public static final String ARTIFACT_ID = "artifactId"; | ||
public static final String GROUP_ID = "groupId"; | ||
public static final String TYPE = "type"; | ||
public static final String DEPENDENCIES = "dependencies"; | ||
public static final String INSTALLERS = "installers"; | ||
public static final String MAVEN_IMPORT_INSTALLER_ID = "maven-import"; | ||
public static final String MAVEN_DROPIN_INSTALLER_ID = "maven-dropins"; | ||
public static final String MAVEN_DEPENDENCY_INSTALLER_ID = "maven-dependency"; | ||
|
||
private ProductJsonConstants() { | ||
} | ||
private ProductJsonConstants() {} | ||
} |
12 changes: 12 additions & 0 deletions
12
marketplace-service/src/main/java/com/axonivy/market/constants/ReadmeConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.axonivy.market.constants; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class ReadmeConstants { | ||
public static final String IMAGES = "images"; | ||
public static final String README_FILE = "README.md"; | ||
public static final String DEMO_PART = "## Demo"; | ||
public static final String SETUP_PART = "## Setup"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.