Skip to content

Commit

Permalink
Allowing for computate generated platform libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
computate committed Nov 9, 2023
1 parent 3b856e7 commit f326a91
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 8 deletions.
67 changes: 67 additions & 0 deletions src/gen/java/org/computate/vertx/openapi/BaseGeneratorGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,58 @@ public static String staticSearchFqAppPath(ComputateSiteRequest siteRequest_, St
return BaseGenerator.staticSearchStrAppPath(siteRequest_, BaseGenerator.staticSearchAppPath(siteRequest_, BaseGenerator.staticSetAppPath(siteRequest_, o)));
}

///////////////////////////
// platformPomArtifactId //
///////////////////////////


/** The entity platformPomArtifactId
* is defined as null before being initialized.
*/
@JsonProperty
@JsonInclude(Include.NON_NULL)
protected String platformPomArtifactId;

/** <br> The entity platformPomArtifactId
* is defined as null before being initialized.
* <br><a href="https://solr-solr.apps-crc.testing/solr/computate/select?q=*:*&fq=partEstEntite_indexed_boolean:true&fq=classeNomCanonique_enUS_indexed_string:org.computate.vertx.openapi.BaseGenerator&fq=entiteVar_enUS_indexed_string:platformPomArtifactId">Find the entity platformPomArtifactId in Solr</a>
* <br>
* @param w is for wrapping a value to assign to this entity during initialization.
**/
protected abstract void _platformPomArtifactId(Wrap<String> w);

public String getPlatformPomArtifactId() {
return platformPomArtifactId;
}
public void setPlatformPomArtifactId(String o) {
this.platformPomArtifactId = BaseGenerator.staticSetPlatformPomArtifactId(siteRequest_, o);
}
public static String staticSetPlatformPomArtifactId(ComputateSiteRequest siteRequest_, String o) {
return o;
}
protected BaseGenerator platformPomArtifactIdInit() {
Wrap<String> platformPomArtifactIdWrap = new Wrap<String>().var("platformPomArtifactId");
if(platformPomArtifactId == null) {
_platformPomArtifactId(platformPomArtifactIdWrap);
Optional.ofNullable(platformPomArtifactIdWrap.getO()).ifPresent(o -> {
setPlatformPomArtifactId(o);
});
}
return (BaseGenerator)this;
}

public static String staticSearchPlatformPomArtifactId(ComputateSiteRequest siteRequest_, String o) {
return o;
}

public static String staticSearchStrPlatformPomArtifactId(ComputateSiteRequest siteRequest_, String o) {
return o == null ? null : o.toString();
}

public static String staticSearchFqPlatformPomArtifactId(ComputateSiteRequest siteRequest_, String o) {
return BaseGenerator.staticSearchStrPlatformPomArtifactId(siteRequest_, BaseGenerator.staticSearchPlatformPomArtifactId(siteRequest_, BaseGenerator.staticSetPlatformPomArtifactId(siteRequest_, o)));
}

////////////////////
// openApiVersion //
////////////////////
Expand Down Expand Up @@ -1375,6 +1427,7 @@ public void initBaseGenerator() {
appNameInit();
languageNameInit();
appPathInit();
platformPomArtifactIdInit();
openApiVersionInit();
openApiVersionNumberInit();
tabsSchemaInit();
Expand Down Expand Up @@ -1459,6 +1512,8 @@ public Object obtainBaseGenerator(String var) {
return oBaseGenerator.languageName;
case "appPath":
return oBaseGenerator.appPath;
case "platformPomArtifactId":
return oBaseGenerator.platformPomArtifactId;
case "openApiVersion":
return oBaseGenerator.openApiVersion;
case "openApiVersionNumber":
Expand Down Expand Up @@ -1540,6 +1595,8 @@ public static Object staticSetBaseGenerator(String entityVar, ComputateSiteReque
return BaseGenerator.staticSetLanguageName(siteRequest_, o);
case "appPath":
return BaseGenerator.staticSetAppPath(siteRequest_, o);
case "platformPomArtifactId":
return BaseGenerator.staticSetPlatformPomArtifactId(siteRequest_, o);
case "openApiVersion":
return BaseGenerator.staticSetOpenApiVersion(siteRequest_, o);
case "openApiVersionNumber":
Expand Down Expand Up @@ -1578,6 +1635,8 @@ public static Object staticSearchBaseGenerator(String entityVar, ComputateSiteRe
return BaseGenerator.staticSearchLanguageName(siteRequest_, (String)o);
case "appPath":
return BaseGenerator.staticSearchAppPath(siteRequest_, (String)o);
case "platformPomArtifactId":
return BaseGenerator.staticSearchPlatformPomArtifactId(siteRequest_, (String)o);
case "openApiVersion":
return BaseGenerator.staticSearchOpenApiVersion(siteRequest_, (String)o);
case "openApiVersionNumber":
Expand Down Expand Up @@ -1616,6 +1675,8 @@ public static String staticSearchStrBaseGenerator(String entityVar, ComputateSit
return BaseGenerator.staticSearchStrLanguageName(siteRequest_, (String)o);
case "appPath":
return BaseGenerator.staticSearchStrAppPath(siteRequest_, (String)o);
case "platformPomArtifactId":
return BaseGenerator.staticSearchStrPlatformPomArtifactId(siteRequest_, (String)o);
case "openApiVersion":
return BaseGenerator.staticSearchStrOpenApiVersion(siteRequest_, (String)o);
case "openApiVersionNumber":
Expand Down Expand Up @@ -1654,6 +1715,8 @@ public static String staticSearchFqBaseGenerator(String entityVar, ComputateSite
return BaseGenerator.staticSearchFqLanguageName(siteRequest_, o);
case "appPath":
return BaseGenerator.staticSearchFqAppPath(siteRequest_, o);
case "platformPomArtifactId":
return BaseGenerator.staticSearchFqPlatformPomArtifactId(siteRequest_, o);
case "openApiVersion":
return BaseGenerator.staticSearchFqOpenApiVersion(siteRequest_, o);
case "openApiVersionNumber":
Expand Down Expand Up @@ -1694,6 +1757,7 @@ public static String staticSearchFqBaseGenerator(String entityVar, ComputateSite
public static final String VAR_appName = "appName";
public static final String VAR_languageName = "languageName";
public static final String VAR_appPath = "appPath";
public static final String VAR_platformPomArtifactId = "platformPomArtifactId";
public static final String VAR_openApiVersion = "openApiVersion";
public static final String VAR_openApiVersionNumber = "openApiVersionNumber";
public static final String VAR_tabsSchema = "tabsSchema";
Expand Down Expand Up @@ -1721,6 +1785,7 @@ public static String staticSearchFqBaseGenerator(String entityVar, ComputateSite
public static final String DISPLAY_NAME_appName = "";
public static final String DISPLAY_NAME_languageName = "";
public static final String DISPLAY_NAME_appPath = "";
public static final String DISPLAY_NAME_platformPomArtifactId = "";
public static final String DISPLAY_NAME_openApiVersion = "";
public static final String DISPLAY_NAME_openApiVersionNumber = "";
public static final String DISPLAY_NAME_tabsSchema = "";
Expand Down Expand Up @@ -1760,6 +1825,8 @@ public static String displayNameBaseGenerator(String var) {
return DISPLAY_NAME_languageName;
case VAR_appPath:
return DISPLAY_NAME_appPath;
case VAR_platformPomArtifactId:
return DISPLAY_NAME_platformPomArtifactId;
case VAR_openApiVersion:
return DISPLAY_NAME_openApiVersion;
case VAR_openApiVersionNumber:
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/org/computate/vertx/config/ComputateConfigKeys.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018-2022 Computate Limited Liability Company in Utah, USA.
*
* This program and the accompanying materials are made available under the
* terms of the GNU GENERAL PUBLIC LICENSE Version 3 which is available at
Expand Down Expand Up @@ -293,6 +294,21 @@ public class ComputateConfigKeys {
**/
public static final String SITE_POM_GROUP_ID = "SITE_POM_GROUP_ID";

/**
*
**/
public static final String SITE_POM_ARTIFACT_ID = "SITE_POM_ARTIFACT_ID";

/**
*
**/
public static final String PLATFORM_POM_GROUP_ID = "PLATFORM_POM_GROUP_ID";

/**
*
**/
public static final String PLATFORM_POM_ARTIFACT_ID = "PLATFORM_POM_ARTIFACT_ID";

/**
* The name Github organization for the site.
**/
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/org/computate/vertx/openapi/BaseGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ protected void _appPath(Wrap<String> c) {
c.o(config.getString(ComputateConfigKeys.SITE_PATH + "_" + languageName));
}

protected void _platformPomArtifactId(Wrap<String> w) {
w.o(config.getString(ComputateConfigKeys.PLATFORM_POM_ARTIFACT_ID));
}

protected void _openApiVersion(Wrap<String> c) {
c.o(config.getString(ComputateConfigKeys.OPEN_API_VERSION, "3.0"));
}
Expand Down Expand Up @@ -210,7 +214,7 @@ public Future<Void> loadClasses() {
SearchRequest searchClasses = new SearchRequest();
searchClasses.q("*:*");
searchClasses.rows(1000000);
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath));
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath) + (platformPomArtifactId == null ? "" : (" OR siteNom_indexed_string:" + SearchTool.escapeQueryChars(platformPomArtifactId))));
searchClasses.fq("classeApi_indexed_boolean:true");
searchClasses.fq("classeEtendGen_indexed_boolean:true");
searchClasses.fq("partEstClasse_indexed_boolean:true");
Expand Down Expand Up @@ -304,7 +308,7 @@ public Future<List<SolrResponse.Doc>> loadEntities(ComputateEnUSClass classDoc,
SearchRequest searchEntities = new SearchRequest();
searchEntities.q("*:*");
searchEntities.rows(1000000);
searchEntities.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath));
searchEntities.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath) + (platformPomArtifactId == null ? "" : (" OR siteNom_indexed_string:" + SearchTool.escapeQueryChars(platformPomArtifactId))));
searchEntities.fq("classeCheminAbsolu_indexed_string:" + SearchTool.escapeQueryChars(classDoc.getClassAbsolutePath()));
searchEntities.fq("partEstEntite_indexed_boolean:true");
searchEntities.sortAsc("partNumero_indexed_int");
Expand Down Expand Up @@ -357,7 +361,7 @@ public Future<Void> loadSql1() {
SearchRequest searchClasses = new SearchRequest();
searchClasses.q("*:*");
searchClasses.rows(1000000);
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath));
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath) + (platformPomArtifactId == null ? "" : (" OR siteNom_indexed_string:" + SearchTool.escapeQueryChars(platformPomArtifactId))));
searchClasses.fq("classeSauvegarde_indexed_boolean:true");
searchClasses.fq("partEstClasse_indexed_boolean:true");
searchClasses.fq("classeEstBase_indexed_boolean:false");
Expand Down Expand Up @@ -406,7 +410,7 @@ public Future<Void> loadSql1(List<SolrResponse.Doc> docs, Integer i) {
SearchRequest searchClasses = new SearchRequest();
searchClasses.q("*:*");
searchClasses.rows(1000000);
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath));
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath) + (platformPomArtifactId == null ? "" : (" OR siteNom_indexed_string:" + SearchTool.escapeQueryChars(platformPomArtifactId))));
searchClasses.fq("classeNomCanonique_" + langueNom + "_indexed_string:" + fqClassesSuperEtMoi);
searchClasses.fq("partEstEntite_indexed_boolean:true");
searchClasses.fq("-(entiteAttribuer_indexed_boolean:true AND entiteTypeJson_indexed_string:array)");
Expand Down Expand Up @@ -471,7 +475,7 @@ public Future<Void> loadSql2() {
SearchRequest searchClasses = new SearchRequest();
searchClasses.q("*:*");
searchClasses.rows(1000000);
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath));
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath) + (platformPomArtifactId == null ? "" : (" OR siteNom_indexed_string:" + SearchTool.escapeQueryChars(platformPomArtifactId))));
searchClasses.fq("partEstEntite_indexed_boolean:true");
searchClasses.fq("entiteTypeJson_indexed_string:array");
searchClasses.fq("entiteAttribuerTypeJson_indexed_string:array");
Expand Down Expand Up @@ -575,7 +579,7 @@ public Future<Void> loadArticle() {
SearchRequest searchClasses = new SearchRequest();
searchClasses.q("*:*");
searchClasses.rows(1000000);
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath));
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath) + (platformPomArtifactId == null ? "" : (" OR siteNom_indexed_string:" + SearchTool.escapeQueryChars(platformPomArtifactId))));
searchClasses.fq("article_indexed_boolean:true");
searchClasses.fq("partEstClasse_indexed_boolean:true");
searchClasses.sortAsc("classeNomCanonique_enUS_indexed_string");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public Future<Void> loadSmartDataModels() {
SearchRequest searchClasses = new SearchRequest();
searchClasses.q("*:*");
searchClasses.rows(1000000);
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath));
searchClasses.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath) + (platformPomArtifactId == null ? "" : (" OR siteNom_indexed_string:" + SearchTool.escapeQueryChars(platformPomArtifactId))));
searchClasses.fq("classeFiware_indexed_boolean:true");
searchClasses.fq("partEstClasse_indexed_boolean:true");
searchClasses.sortAsc("classeNomCanonique_enUS_indexed_string");
Expand Down Expand Up @@ -444,7 +444,7 @@ public Future<List<SolrResponse.Doc>> loadSmartDataModelEntities(ComputateEnUSCl
SearchRequest searchEntities = new SearchRequest();
searchEntities.q("*:*");
searchEntities.rows(1000000);
searchEntities.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath));
searchEntities.fq("siteChemin_indexed_string:" + SearchTool.escapeQueryChars(appPath) + (platformPomArtifactId == null ? "" : (" OR siteNom_indexed_string:" + SearchTool.escapeQueryChars(platformPomArtifactId))));
searchEntities.fq("classeCheminAbsolu_indexed_string:" + SearchTool.escapeQueryChars(classDoc.getClassAbsolutePath()));
searchEntities.fq("partEstEntite_indexed_boolean:true");
searchEntities.fq("entiteDefinir_indexed_boolean:true");
Expand Down

0 comments on commit f326a91

Please sign in to comment.