Skip to content

Commit 0664cdf

Browse files
committed
EQX-211: Removed need for detecting AppFuse by moving JSPs to same location for Spring/Struts in AppFuse Light.
1 parent 1b0412e commit 0664cdf

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

plugins/appfuse-maven-plugin/src/main/java/org/appfuse/mojo/exporter/AppFuseGeneratorMojo.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,6 @@ protected Exporter configureExporter(Exporter exp) throws MojoExecutionException
280280
}
281281
}
282282
}
283-
284-
boolean isAppFuse = (getProject().getParent().getArtifactId().contains("appfuse-web") ||
285-
getProject().getParent().getParent().getGroupId().contains("appfuse"));
286-
exporter.getProperties().setProperty("isAppFuse", String.valueOf(isAppFuse));
287-
288283
exporter.getProperties().setProperty("hasSecurity", String.valueOf(hasSecurity));
289284

290285
// determine if using Main or Home for Tapestry

plugins/appfuse-maven-plugin/src/main/java/org/appfuse/tool/ArtifactInstaller.java

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public void execute() {
7474
copyGeneratedObjects(this.sourceDirectory, this.destinationDirectory, "**/webapp/**/*.java");
7575

7676
String webFramework = project.getProperties().getProperty("web.framework");
77-
String pagesPath = isAppFuse() ? "/src/main/webapp/WEB-INF/pages/" : "/src/main/webapp/";
7877

7978
if ("jsf".equalsIgnoreCase(webFramework)) {
8079
log("Installing JSF views and configuring...");
@@ -87,14 +86,14 @@ public void execute() {
8786
destinationDirectory + "/src/main/resources", "**/model/*.xml");
8887
copyGeneratedObjects(sourceDirectory + "/src/main/resources",
8988
destinationDirectory + "/src/main/resources", "**/webapp/action/*.xml");
90-
installStrutsViews(pagesPath);
89+
installStrutsViews();
9190
} else if ("spring".equalsIgnoreCase(webFramework) || "spring-security".equalsIgnoreCase(webFramework)) {
9291
log("Installing Spring views...");
9392
installSpringValidation();
94-
installSpringViews(pagesPath);
93+
installSpringViews();
9594
} else if ("spring-freemarker".equalsIgnoreCase(webFramework)) {
9695
log("Installing Freemarker views...");
97-
installSpringFreemarkerViews(pagesPath);
96+
installSpringFreemarkerViews();
9897
} else if ("stripes".equalsIgnoreCase(webFramework)) {
9998
log("Installing Stripes views...");
10099
installStripesViews();
@@ -258,25 +257,25 @@ private void installJSFViews() {
258257
copy.execute();
259258
}
260259

261-
private void installSpringViews(String pagesPath) {
260+
private void installSpringViews() {
262261
Copy copy = (Copy) antProject.createTask("copy");
263262
copy.setFile(new File(sourceDirectory + "/src/main/webapp/WEB-INF/pages/" + pojoName + "form.jsp"));
264-
copy.setTofile(new File(destinationDirectory + pagesPath + pojoNameLower + "form.jsp"));
263+
copy.setTofile(new File(destinationDirectory + "/src/main/webapp/WEB-INF/pages/" + pojoNameLower + "form.jsp"));
265264
copy.execute();
266265

267266
copy.setFile(new File(sourceDirectory + "/src/main/webapp/WEB-INF/pages/" + pojoName + "s.jsp"));
268-
copy.setTofile(new File(destinationDirectory + pagesPath + util.getPluralForWord(pojoNameLower) + ".jsp"));
267+
copy.setTofile(new File(destinationDirectory + "/src/main/webapp/WEB-INF/pages/" + util.getPluralForWord(pojoNameLower) + ".jsp"));
269268
copy.execute();
270269
}
271270

272-
private void installSpringFreemarkerViews(String pagesPath) {
271+
private void installSpringFreemarkerViews() {
273272
Copy copy = (Copy) antProject.createTask("copy");
274273
copy.setFile(new File(sourceDirectory + "/src/main/webapp/" + pojoName + "form.ftl"));
275-
copy.setTofile(new File(destinationDirectory + pagesPath + pojoNameLower + "form.ftl"));
274+
copy.setTofile(new File(destinationDirectory + "/src/main/webapp/" + pojoNameLower + "form.ftl"));
276275
copy.execute();
277276

278277
copy.setFile(new File(sourceDirectory + "/src/main/webapp/" + pojoName + "list.ftl"));
279-
copy.setTofile(new File(destinationDirectory + pagesPath + util.getPluralForWord(pojoNameLower) + ".ftl"));
278+
copy.setTofile(new File(destinationDirectory + "/src/main/webapp/" + util.getPluralForWord(pojoNameLower) + ".ftl"));
280279
copy.execute();
281280
}
282281

@@ -291,14 +290,14 @@ private void installStripesViews() {
291290
copy.execute();
292291
}
293292

294-
private void installStrutsViews(String pagesPath) {
293+
private void installStrutsViews() {
295294
Copy copy = (Copy) antProject.createTask("copy");
296295
copy.setFile(new File(sourceDirectory + "/src/main/webapp/WEB-INF/pages/" + pojoName + "Form.jsp"));
297-
copy.setTofile(new File(destinationDirectory + pagesPath + pojoNameLower + "Form.jsp"));
296+
copy.setTofile(new File(destinationDirectory + "/src/main/webapp/WEB-INF/pages/" + pojoNameLower + "Form.jsp"));
298297
copy.execute();
299298

300299
copy.setFile(new File(sourceDirectory + "/src/main/webapp/WEB-INF/pages/" + pojoName + "List.jsp"));
301-
copy.setTofile(new File(destinationDirectory + pagesPath + pojoNameLower + "List.jsp"));
300+
copy.setTofile(new File(destinationDirectory + "/src/main/webapp/WEB-INF/pages/" + pojoNameLower + "List.jsp"));
302301
copy.execute();
303302
}
304303

@@ -371,7 +370,7 @@ private void installInternationalizationKeys(String webFramework) {
371370

372371
// if ApplicationResources doesn't exist, assume appfuse-light and use messages instead
373372
if (!existingFile.exists()) {
374-
if ("wicket".equalsIgnoreCase(webFramework) && !isAppFuse()) {
373+
if ("wicket".equalsIgnoreCase(webFramework)) {
375374
existingFile = new File(destinationDirectory + "/src/main/java/" + project.getGroupId().replace(".", "/")
376375
+ "/webapp/pages/AbstractWebPage.properties");
377376
} else {

0 commit comments

Comments
 (0)