From: <fg...@us...> - 2009-08-04 21:00:04
|
Revision: 1246 http://openutils.svn.sourceforge.net/openutils/?rev=1246&view=rev Author: fgrilli Date: 2009-08-04 20:59:23 +0000 (Tue, 04 Aug 2009) Log Message: ----------- Updated deps to latest versions. Module now requires Magnolia 4.1. Some code clean up and minor improvements. Modified Paths: -------------- trunk/openutils-mgnlgroovy/pom.xml trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java trunk/openutils-mgnlgroovy/src/main/resources/META-INF/magnolia/groovyshell.xml trunk/openutils-mgnlgroovy/src/main/resources/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.html trunk/openutils-mgnlgroovy/src/site/apt/index.apt Modified: trunk/openutils-mgnlgroovy/pom.xml =================================================================== --- trunk/openutils-mgnlgroovy/pom.xml 2009-07-28 16:41:44 UTC (rev 1245) +++ trunk/openutils-mgnlgroovy/pom.xml 2009-08-04 20:59:23 UTC (rev 1246) @@ -38,7 +38,7 @@ <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> - <version>1.6.0</version> + <version>1.6.4</version> <exclusions> <exclusion> <groupId>junit</groupId> @@ -49,17 +49,17 @@ <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-core</artifactId> - <version>4.0</version> + <version>4.1</version> </dependency> <dependency> <groupId>info.magnolia</groupId> <artifactId>magnolia-module-admininterface</artifactId> - <version>4.0</version> + <version>4.1</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-mgnltasks</artifactId> - <version>3.5.5</version> + <version>4.0.1</version> </dependency> </dependencies> <repositories> Modified: trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java =================================================================== --- trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java 2009-07-28 16:41:44 UTC (rev 1245) +++ trunk/openutils-mgnlgroovy/src/main/java/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.java 2009-08-04 20:59:23 UTC (rev 1246) @@ -40,7 +40,7 @@ private String groovyScript; - private Document mgnlFileImport; + private Document groovyScriptFile; public GroovyShellPage(String name, HttpServletRequest request, HttpServletResponse response) { @@ -57,11 +57,9 @@ AlertUtil.setMessage(msg); return this.show(); } - if (log.isDebugEnabled()) - { - log.debug("executing script {}", groovyScript); - } + log.debug("executing script {}", groovyScript); + Object retVal; try @@ -73,14 +71,12 @@ } catch (CompilationFailedException e) { - log.error("An error occurred while parsing the script. Error message is {}", new Object[]{e.getMessage() }); + log.error("An error occurred while parsing the script. Error message is {}", e.getMessage()); AlertUtil.setMessage("An error occurred while parsing the script. Error message is " + e.getMessage()); } catch (Exception e) { - log.error( - "An error occurred while executing the script. Error message is {}", - new Object[]{e.getMessage() }); + log.error("An error occurred while executing the script. Error message is {}", e.getMessage()); AlertUtil.setMessage("An error occurred while executing the script. Error message is " + e.getMessage()); } @@ -92,35 +88,45 @@ return groovyScript; } + public void setGroovyScript(String groovyScript) + { + this.groovyScript = groovyScript; + } + public String getGroovyVersion() { return GROOVY_VERSION; } - public Document getMgnlFileImport() + public Document getGroovyScriptFile() { - return mgnlFileImport; + return groovyScriptFile; } + public void setGroovyScriptFile(Document groovyScriptFile) + { + this.groovyScriptFile = groovyScriptFile; + } + public String loadGroovyScript() { - if (mgnlFileImport == null) + if (groovyScriptFile == null) { String msg = "Please, select a file"; log.warn(msg); AlertUtil.setMessage(msg); return this.show(); } - if (!mgnlFileImport.getExtension().equalsIgnoreCase("groovy")) + if (!groovyScriptFile.getExtension().equalsIgnoreCase("groovy")) { - String msg = mgnlFileImport.getFileNameWithExtension() + " doesn't seem to be a valid groovy file"; + String msg = groovyScriptFile.getFileNameWithExtension() + " doesn't seem to be a valid groovy file"; log.warn(msg); AlertUtil.setMessage(msg); return this.show(); } - groovyScript = readFile(mgnlFileImport.getFile()); + groovyScript = readFile(groovyScriptFile.getFile()); - String msg = mgnlFileImport.getFileNameWithExtension() + " loaded"; + String msg = groovyScriptFile.getFileNameWithExtension() + " loaded"; log.info(msg); AlertUtil.setMessage(msg); return this.show(); @@ -160,14 +166,4 @@ } return contents.toString(); } - - public void setGroovyScript(String groovyScript) - { - this.groovyScript = groovyScript; - } - - public void setMgnlFileImport(Document mgnlFileImport) - { - this.mgnlFileImport = mgnlFileImport; - } } \ No newline at end of file Modified: trunk/openutils-mgnlgroovy/src/main/resources/META-INF/magnolia/groovyshell.xml =================================================================== --- trunk/openutils-mgnlgroovy/src/main/resources/META-INF/magnolia/groovyshell.xml 2009-07-28 16:41:44 UTC (rev 1245) +++ trunk/openutils-mgnlgroovy/src/main/resources/META-INF/magnolia/groovyshell.xml 2009-08-04 20:59:23 UTC (rev 1246) @@ -10,7 +10,7 @@ <dependencies> <dependency> <name>adminInterface</name> - <version>3.1/*</version> + <version>4</version> </dependency> </dependencies> </module> \ No newline at end of file Modified: trunk/openutils-mgnlgroovy/src/main/resources/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.html =================================================================== --- trunk/openutils-mgnlgroovy/src/main/resources/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.html 2009-07-28 16:41:44 UTC (rev 1245) +++ trunk/openutils-mgnlgroovy/src/main/resources/net/sourceforge/openutils/mgnlgroovy/pages/GroovyShellPage.html 2009-08-04 20:59:23 UTC (rev 1246) @@ -18,8 +18,8 @@ </div> <br/> <div class="formelement"> - <label for="mgnlFileImport">Upload groovy script</label> - <input type="file" name="mgnlFileImport" /> + <label for="groovyScriptFile">Upload groovy script</label> + <input type="file" name="groovyScriptFile" /> <input type="submit" value="Upload" onclick="uploadFile()" class="mgnlControlButton" /> </div> <br/> @@ -45,7 +45,7 @@ document.forms[0].submit() } function warnBeforeSubmit(){ - if(confirm('Are you sure, you want to run this script?')){ + if(confirm('Are you sure you want to run this script?')){ //console.log(groovyScriptTxtArea.getCode()) document.getElementById('groovyScript').value = groovyScriptTxtArea.getCode() document.getElementById('runBtn').disabled=true Modified: trunk/openutils-mgnlgroovy/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlgroovy/src/site/apt/index.apt 2009-07-28 16:41:44 UTC (rev 1245) +++ trunk/openutils-mgnlgroovy/src/site/apt/index.apt 2009-08-04 20:59:23 UTC (rev 1246) @@ -6,13 +6,13 @@ About openutils-mgnlgroovy - openutils-mgnlgroovy is a custom {{{http://www.magnolia.info}magnolia}} module which adds a console for running groovy - scripts inside the magnolia admin interface + openutils-mgnlgroovy is a custom {{{http://www.magnolia-cms.com}magnolia}} module which adds a console for running groovy + scripts inside Magnolia's adminCentral interface - <<This module requires magnolia 3.6.x>> + <<Latest module version requires Magnolia 4.1.x>> The module needs to be installed as usual, by declaring an additional dependency into your pom or by manually dropping the jar - into magnolia. If you are installing it manually, please note that you will also need to install other dependencies, see + into Magnolia. If you are installing it manually, please note that you will also need to install other dependencies, see the {{{dependencies.html}dependencies}} report for details More info about this module can be found in the {{{http://wiki.magnolia-cms.com/display/WIKI/Magnolia+groovy+shell+module}Magnolia Community Wiki}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |