Skip to content

Commit 7b0786b

Browse files
author
synapticloop
committed
allowed includes for views
1 parent 8fb9f03 commit 7b0786b

80 files changed

Lines changed: 80 additions & 1804 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.classpath

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" path="src/main/java"/>
4-
<classpathentry kind="src" path="src/main/resources"/>
5-
<classpathentry kind="src" path="src/test/java"/>
6-
<classpathentry kind="src" path="src/test/resources"/>
3+
<classpathentry kind="src" output="bin/main" path="src/main/java">
4+
<attributes>
5+
<attribute name="gradle_scope" value="main"/>
6+
<attribute name="gradle_used_by_scope" value="main,test"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="src" output="bin/main" path="src/main/resources">
10+
<attributes>
11+
<attribute name="gradle_scope" value="main"/>
12+
<attribute name="gradle_used_by_scope" value="main,test"/>
13+
</attributes>
14+
</classpathentry>
15+
<classpathentry kind="src" output="bin/test" path="src/test/java">
16+
<attributes>
17+
<attribute name="gradle_scope" value="test"/>
18+
<attribute name="gradle_used_by_scope" value="test"/>
19+
</attributes>
20+
</classpathentry>
21+
<classpathentry kind="src" output="bin/test" path="src/test/resources">
22+
<attributes>
23+
<attribute name="gradle_scope" value="test"/>
24+
<attribute name="gradle_used_by_scope" value="test"/>
25+
</attributes>
26+
</classpathentry>
727
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7/"/>
828
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
9-
<classpathentry kind="output" path="bin"/>
29+
<classpathentry kind="output" path="bin/default"/>
1030
</classpath>

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
group = 'synapticloop'
2020
archivesBaseName = 'h2zero'
2121
description = """lightweight ORM generator for mysql, java and optionally jsp/servlets"""
22-
version = '2.2.1'
22+
version = '3.0.0'
2323

2424
tasks.withType(Javadoc).all { enabled = false }
2525

@@ -44,15 +44,15 @@ dependencies {
4444
runtime 'org.slf4j:slf4j-api:1.7.25'
4545
runtime 'io.dropwizard.metrics:metrics-core:3.1.2'
4646
runtime 'javax.mail:javax.mail-api:1.6.1'
47+
runtime 'synapticloop:h2zero-extension-taglibs:1.0.0'
4748

4849
compile gradleApi()
4950
compile 'synapticloop:templar:1.4.4'
5051
compile 'org.json:json:20180130'
5152
compile 'org.apache.ant:ant:1.10.2'
52-
compile 'javax.servlet.jsp:jsp-api:2.2'
53-
compile 'javax.servlet:javax.servlet-api:3.1.0'
5453
compile 'com.mchange:c3p0:0.9.5.2'
5554
compile 'commons-validator:commons-validator:1.6'
55+
compile 'synapticloop:h2zero-extension-taglibs:1.0.0'
5656

5757
compile 'org.slf4j:slf4j-api:1.7.25'
5858
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.10.0'

src/main/java/synapticloop/h2zero/H2ZeroParser.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,21 @@ public JSONObject getJSONFileContents(File file) throws H2ZeroParseException {
336336

337337
databaseObject.put(JSONKeyConstants.TABLES, newTablesArray);
338338

339+
JSONArray newViewsArray = new JSONArray();
340+
JSONArray viewsArray = databaseObject.getJSONArray(JSONKeyConstants.VIEWS);
341+
int j = 0;
342+
for (Object object : viewsArray) {
343+
JSONObject viewObject = (JSONObject) object;
344+
if(viewObject.has(H2ZERO_KEY_INCLUDE)) {
345+
newViewsArray.put(j, new JSONObject(getFileContents(new File(absolutePath + "/" + viewObject.getString(H2ZERO_KEY_INCLUDE)))));
346+
} else {
347+
newViewsArray.put(viewObject);
348+
}
349+
j++;
350+
}
351+
352+
databaseObject.put(JSONKeyConstants.VIEWS, newViewsArray);
353+
339354
return jsonObject;
340355
}
341356

src/main/java/synapticloop/h2zero/base/taglib/BaseVarTag.java

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/main/java/synapticloop/h2zero/generator/JavaGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ private void generateViews(TemplarContext templarContext) throws ParseException,
158158
View view = viewsIterator.next();
159159

160160
templarContext.add("view", view);
161+
161162
// hack for finder taglibs for views - should be split out
162163
templarContext.add("table", view);
163164

src/main/java/synapticloop/h2zero/generator/TaglibGenerator.java

Lines changed: 0 additions & 143 deletions
This file was deleted.

src/main/java/synapticloop/h2zero/model/Options.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
public class Options {
4040
public static final String OPTION_FORMBEANS = "formbeans";
4141
public static final String OPTION_ADMINPAGES = "adminpages";
42-
public static final String OPTION_TAGLIB = "taglib";
4342
public static final String OPTION_JSP = "jsp";
4443
public static final String OPTION_JAVA = "java";
4544
public static final String OPTION_SQL = "sql";
@@ -55,7 +54,6 @@ public class Options {
5554
ALLOWABLE_GENERATORS.add(OPTION_SQL);
5655
ALLOWABLE_GENERATORS.add(OPTION_JAVA);
5756
ALLOWABLE_GENERATORS.add(OPTION_JSP);
58-
ALLOWABLE_GENERATORS.add(OPTION_TAGLIB);
5957
ALLOWABLE_GENERATORS.add(OPTION_ADMINPAGES);
6058
ALLOWABLE_GENERATORS.add(OPTION_FORMBEANS);
6159
ALLOWABLE_GENERATORS.add(OPTION_REPORTS);

src/main/java/synapticloop/h2zero/plugin/BaseH2ZeroGenerator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import synapticloop.h2zero.generator.MetricsGenerator;
3636
import synapticloop.h2zero.generator.ReportGenerator;
3737
import synapticloop.h2zero.generator.SqlGenerator;
38-
import synapticloop.h2zero.generator.TaglibGenerator;
3938
import synapticloop.h2zero.generator.UtilGenerator;
4039
import synapticloop.h2zero.model.Database;
4140
import synapticloop.h2zero.model.Options;
@@ -106,7 +105,6 @@ public void generateH2zero() {
106105

107106
generators.add(new SqlGenerator(database, options, outFile, verbose));
108107
generators.add(new JavaGenerator(database, options, outFile, verbose));
109-
generators.add(new TaglibGenerator(database, options, outFile, verbose));
110108
generators.add(new AdminPagesGenerator(database, options, outFile, verbose));
111109
generators.add(new MetricsGenerator(database, options, outFile, verbose));
112110
generators.add(new UtilGenerator(database, options, outFile, verbose));

src/main/java/synapticloop/h2zero/revenge/model/Options.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public class Options {
55
public String toJsonString() {
66
StringBuilder stringBuilder = new StringBuilder();
77
stringBuilder.append(" \"options\": {\n");
8-
stringBuilder.append(" \"generators\": [ \"java\", \"sql\", \"taglib\" ]\n");
8+
stringBuilder.append(" \"generators\": [ \"java\", \"sql\" ]\n");
99
stringBuilder.append(" },\n");
1010
return(stringBuilder.toString());
1111
}

src/main/java/synapticloop/h2zero/util/SimpleLogger.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public enum LoggerType {
3838
GENERATE_FORM_BEANS,
3939
GENERATE_JAVA,
4040
GENERATE_JAVA_UTIL,
41-
GENERATE_TAGLIB,
4241
GENERATE_METRICS,
4342
TEMPLAR_LOAD,
4443
TEMPLAR_RENDER,

0 commit comments

Comments
 (0)