Skip to content

Commit

Permalink
Merge pull request #119 from kennardconsulting/master
Browse files Browse the repository at this point in the history
MVEL CompiledTemplate fix
  • Loading branch information
lincolnthree committed Mar 2, 2012
2 parents 91c635d + afe5421 commit 36cc0ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 22 deletions.
10 changes: 5 additions & 5 deletions dist/src/main/resources/bin/forge.bat
Expand Up @@ -28,11 +28,11 @@

@echo off

@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM set %USERHOME% to equivalent of $HOME
if "%USERHOME%" == "" (set "USERHOME=%HOMEDRIVE%%HOMEPATH%")

@REM Execute a user defined script before this one
if exist "%HOME%\forgerc_pre.bat" call "%HOME%\forgerc_pre.bat"
if exist "%USERHOME%\forgerc_pre.bat" call "%USERHOME%\forgerc_pre.bat"

set ERROR_CODE=0

Expand Down Expand Up @@ -140,7 +140,7 @@ goto runForge
@REM Start Forge
:runForge
set FORGE_MAIN_CLASS=org.jboss.forge.shell.Bootstrap
%FORGE_JAVA_EXE% %FORGE_OPTS% "-Dforge.home=%FORGE_HOME%" -Dforge.shell.colorEnabled=true -jar %JBOSS_MODULES% -modulepath "%FORGE_HOME%\modules;%HOME%\.forge\plugins" org.jboss.forge %FORGE_CMD_LINE_ARGS%
%FORGE_JAVA_EXE% %FORGE_OPTS% "-Dforge.home=%FORGE_HOME%" -Dforge.shell.colorEnabled=true -jar %JBOSS_MODULES% -modulepath "%FORGE_HOME%\modules;%USERHOME%\.forge\plugins" org.jboss.forge %FORGE_CMD_LINE_ARGS%
if ERRORLEVEL 1 goto error
goto end

Expand All @@ -164,7 +164,7 @@ goto postExec
@endlocal & set ERROR_CODE=%ERROR_CODE%

:postExec
if exist "%HOME%\forgerc_post.bat" call "%HOME%\forgerc_post.bat"
if exist "%USERHOME%\forgerc_post.bat" call "%USERHOME%\forgerc_post.bat"

if "%FORGE_TERMINATE_CMD%" == "on" exit %ERROR_CODE%

Expand Down
Expand Up @@ -60,6 +60,7 @@
import org.jboss.forge.shell.ShellPrompt;
import org.jboss.forge.shell.plugins.Alias;
import org.jboss.forge.shell.plugins.RequiresFacet;
import org.jboss.forge.shell.util.Streams;
import org.jboss.forge.spec.javaee.CDIFacet;
import org.jboss.forge.spec.javaee.EJBFacet;
import org.jboss.forge.spec.javaee.FacesFacet;
Expand Down Expand Up @@ -99,7 +100,7 @@
* writing Metawidget plugins, see <a href="http://metawidget.org/documentation.php">the Metawidget documentation</a>.
* <p>
* This Facet does <em>not</em> require Metawidget to be in the final project.
*
*
* @author <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a>
* @author Richard Kennard
*/
Expand Down Expand Up @@ -470,8 +471,7 @@ protected void loadTemplates()
if (this.backingBeanTemplate == null)
{
this.backingBeanTemplate = this.compiler.compile(BACKING_BEAN_TEMPLATE);
String template = String.valueOf(this.backingBeanTemplate
.getCompiledTemplate().getTemplate());
String template = Streams.toString(this.backingBeanTemplate.getSourceTemplateResource().getInputStream());
this.backingBeanTemplateQbeMetawidgetIndent = parseIndent(template, "@{qbeMetawidget}");
}
if (this.viewUtilsTemplate == null)
Expand All @@ -485,33 +485,29 @@ protected void loadTemplates()
if (this.viewTemplate == null)
{
this.viewTemplate = this.compiler.compile(VIEW_TEMPLATE);
String template = String.valueOf(this.viewTemplate
.getCompiledTemplate().getTemplate());
String template = Streams.toString(this.viewTemplate.getSourceTemplateResource().getInputStream());
this.viewTemplateNamespaces = parseNamespaces(template);
this.viewTemplateEntityMetawidgetIndent = parseIndent(template, "@{metawidget}");
}
if (this.createTemplate == null)
{
this.createTemplate = this.compiler.compile(CREATE_TEMPLATE);
String template = String.valueOf(this.createTemplate
.getCompiledTemplate().getTemplate());
String template = Streams.toString(this.createTemplate.getSourceTemplateResource().getInputStream());
this.createTemplateNamespaces = parseNamespaces(template);
this.createTemplateEntityMetawidgetIndent = parseIndent(template, "@{metawidget}");
}
if (this.searchTemplate == null)
{
this.searchTemplate = this.compiler.compile(SEARCH_TEMPLATE);
String template = String.valueOf(this.searchTemplate
.getCompiledTemplate().getTemplate());
String template = Streams.toString(this.searchTemplate.getSourceTemplateResource().getInputStream());
this.searchTemplateNamespaces = parseNamespaces(template);
this.searchTemplateSearchMetawidgetIndent = parseIndent(template, "@{searchMetawidget}");
this.searchTemplateBeanMetawidgetIndent = parseIndent(template, "@{beanMetawidget}");
}
if (this.navigationTemplate == null)
{
this.navigationTemplate = this.compiler.compile(NAVIGATION_TEMPLATE);
String template = String.valueOf(this.navigationTemplate
.getCompiledTemplate().getTemplate());
String template = Streams.toString(this.navigationTemplate.getSourceTemplateResource().getInputStream());
this.navigationTemplateIndent = parseIndent(template, "@{navigation}");
}
if (this.errorTemplate == null)
Expand Down
Expand Up @@ -105,10 +105,4 @@ protected Map<String, String> inspectProperty(Property property)

return attributes;
}

@Override
protected Map<String, String> inspectEntity(String declaredClass, String actualClass) throws Exception
{
return super.inspectEntity(declaredClass, actualClass);
}
}

0 comments on commit 36cc0ba

Please sign in to comment.