Permalink
Browse files

Changed the g.render tag to use the attribute 'plugin'

  • Loading branch information...
1 parent bbba09f commit eafb7b8e15e8ec330cdda73b340b396b037ae059 @himanshuseth himanshuseth committed Sep 8, 2010
View
@@ -1,3 +1,5 @@
File-Viewer-Grails-Plugin.iml
File-Viewer-Grails-Plugin.ipr
File-Viewer-Grails-Plugin.iws
+target
+File-Viewer-Grails-Plugin-grailsPlugins.iml
@@ -1,6 +1,7 @@
#Grails Metadata file
-#Tue Sep 07 17:41:15 IST 2010
+#Wed Sep 08 16:58:21 IST 2010
app.grails.version=1.3.3
app.name=fileViewer
plugins.hibernate=1.3.3
+plugins.jquery=1.4.2.5
plugins.tomcat=1.3.3
@@ -16,19 +16,14 @@ class FileController {
Boolean isFile = true
if (file.exists()) {
if ( file.isFile()) {
- if(FileViewerUtils.isText(file.name)) {
- String fileContents = getFileContents(file)
- message = g.render(template: "fileDetails", model: [fileContents: fileContents, filePath: file.absolutePath])
- } else {
- forward(action:'downloadFile', params:params)
- return
- }
+ String fileContents = getFileContents(file)
+ message = g.render(template: "/file/fileDetails", model: [fileContents: fileContents, filePath: file.absolutePath], plugin:'fileViewer')
} else {
List<String> locations = []
file.eachFile{File subFile->
locations << subFile.absolutePath
}
- message = g.render(template: "fileList", model: [locations:locations])
+ message = g.render(template: "/file/fileList", model: [locations:locations], plugin:'fileViewer')
isFile = false
}
}
@@ -9,7 +9,7 @@
<br/><strong>Please click on the links below to view detailed reports:</strong><br/><br/>
<div id="mainContainer">
<div id="left-container" style="width:30%; float:left;">
- <g:render template="fileList" model="[locations:locations]"/>
+ <g:render template="fileList" model="[locations:locations]" plugin='fileViewer'/>
</div>
<div id="right-container" style="width:69%; float:right;border:1px black solid;padding:5px;">
Clicking on the file in left will show the contents here
View
@@ -0,0 +1,19 @@
+<plugin name='file-viewer' version='0.1' grailsVersion='1.3.3 &gt; *'>
+ <author>Your name</author>
+ <title>Plugin summary/headline</title>
+ <description>\
+Brief description of the plugin.
+</description>
+ <documentation>http://grails.org/plugin/file-viewer</documentation>
+ <resources>
+ <resource>BuildConfig</resource>
+ <resource>Config</resource>
+ <resource>DataSource</resource>
+ <resource>UrlMappings</resource>
+ <resource>com.fileviewer.FileController</resource>
+ </resources>
+ <dependencies>
+ <plugin name='jquery' version='1.4.2.5 &gt; *' />
+ </dependencies>
+ <behavior />
+</plugin>
Oops, something went wrong.

0 comments on commit eafb7b8

Please sign in to comment.