Dreamweaver + Grails
Asked Answered
A

3

8

Has anybody tried doing GSP design with Adobe Dreamweaver CS4? It has support for JSPs, but it doesn't recognize the gsp extension, and even if it did I think there would be problems regarding the gsp tags that it would not recognize. I found a little cookbook here (http://www.bitwalker.nl/blog/using-groovyserver-pages-in-dreamweaver) for getting GSPs partially working with Dreamweaver CS3, but many of the files and directories it references no longer appear to exist in CS4.

Atwater answered 3/1, 2009 at 0:33 Comment(2)
Did you find a solution for your problem elsewhare? Or is it not possible to use Dreamweaver?Count
Sorry, I was unable to find a workable solution for Dreamweaver. We still do our coding in IntelliJ, but we nixed Dreamweaver altogether now that our initial design work is done and we are just making adjustments. We now use Firebug to try things out, and make final edits with IntelliJ.Atwater
W
4

I think I got it working for CS5 after messing around for a while. Steps you need to do are similar to the article mentioned above, but with slight changes for Dreamweaver CS5. So five steps to go through and please make a test after each step to make sure you are on the right path.

  1. Add *.gsp file extension to Open Dialog. Edit %APPDATA%\Adobe\Dreamweaver CS5\en_US\Configuration\Extensions.txt to add "GSP:Groovy Server Pages" (no quotes) to the bottom of the file, as well as GSP extension to the first line just before :All Documents. Now restart Dreamweaver CS5 and test if File > Open... dialog has GSP extension in the list.
  2. Now we need to add correct document type so Dreamweaver CS5 knows about GSP. Edit %DreamweaverInstallationDirectory%\configuration\DocumentTypes\MMDocumentTypes.xml to add the following document type as the last node.

    <documenttype id="GSP" servermodel="JSP" internaltype="Dynamic" winfileextension="gsp" macfileextension="gsp" file="Default.gsp" writebyteordermark="false" mimetype="text/html"> <TITLE>GSP</TITLE> <description>Groovy Server Pages (GSP) document</description> <dtdcontext>html</dtdcontext> </documenttype>

If you want to provide Title and Description as localized strings refer to this article.

  1. Create template for new document. Copy %DreamweaverInstallationDirectory%\configuration\DocumentTypes\NewDocuments\Default.jsp to Default.gsp, edit it to remove first line. (You can edit this file as you like as it acts as a template for newly created file). Now restart Dreamweaver CS5 and test if File > New... dialog has GSP Page Type with your description in place. Test new file creation.
  2. Setup GSP tag library. Download and unpack GspTagLibrary for Dreamweaver. Copy GSP folder with lots of *.vtm files into %DreamweaverInstallationDirectory%\configuration\TagLibraries. Edit %APPDATA%\Adobe\Dreamweaver CS5\en_US\Configuration\TagLibraries\TagLibraries.vtm to add content of gspTagLibrary.vtm as a last node. Replace first line with the following:

    <taglibrary name="GSP tags" doctypes="GSP" id="DWTagLibrary_GSP" prefix="&lt;g:">

Also add GSP into doctypes of <taglibrary> with id="DWTagLibrary_html" (should be very first node). Do the same changes for %DreamweaverInstallationDirectory%\configuration\TagLibraries\TagLibraries.vtm just in case. Restart Dreamweaver CS5 and make sure you can see GSP tags library in Edit > Tag Libraries... with correct Tag prefix (g:). Check if the 'Used in: GSP' checkbox is ticked for 'GSP tags' and 'HTML tags'.

  1. And as the last step we have to enable code coloring. Edit %APPDATA%\Adobe\Dreamweaver CS5\en_US\Configuration\CodeColoring\CodeColoring.xml to search & replace ',JSP,' with ',JSP,GSP,' (no quotes and pay attention to commas). Also find the line <sampleText doctypes="JSP"> and add GSP doctype there, like <sampleText doctypes="JSP,GSP"> (if you really want to you can create your own GSP code sample the same way as the JSP's one). Do same changes in %DreamweaverInstallationDirectory%\configuration\CodeColoring\CodeColoring.xml just in case.

Restart Dreamweaver CS5 and test if Edit > Preferences... > Code Coloring has GSP document type. Click 'Edit Coloring Scheme' to test if Preview has the code sample with code coloring as well as GSP tags mentioned in 'Styles for' list. And finally open up any of GSP files and check if it has code coloring for HTML, CSS, JavaScript and GSP tags.

That's it! Hope this helps to someone! And thanks to Harald Walker for the article I based my research on.

Wilburn answered 12/1, 2011 at 10:45 Comment(1)
I cannot find gsptaglibrary.zip anywhere. Has anyone still got this file for public access?Wilburn
G
1

Agreed, coding in intelliJ is the way forward but HTML and css design is best done in another tool more suited to the purpose, just as intelliJ is to java and things groovy. Any thoughts welcome.

Guerdon answered 20/9, 2009 at 1:7 Comment(0)
M
0

I am not going to directly answer your question, but really, an IDE like NetBeans or Eclipse would be much better suited for Groovy/Grails development. Dreamweaver was never intended to be a developers editor but to be more of a designers editor. Hence it lacks many features that more developer-centric IDEs have.

I am assuming that you are using Dreamweaver for its design-centric behavior. Both NetBeans and Eclipse have preview modes where you can see your changes in a near instant fashion, just like what I am guessing you like about Dreamweaver.

Long story short, use a more appropriate IDE.

Muriah answered 3/1, 2009 at 2:4 Comment(3)
The person said DESIGN in his first sentence. Assume that he uses an IDE for development and he really wants to use Dreamweaver appropriately, do you have a more useful answer?Perfunctory
You're right, I did shy away from suggesting a clear cut answer based on Dreamweaver. In my head I was thinking something along the lines of: "use Dreamweaver for its design capabilities, but when you need to atually code, switch over to NetBeans/Eclipse/etc"Muriah
Yes that is actually what we are doing right now... coding in IntelliJ, doing html/css design with dreamweaver, then applying the html and css to our views manually. Mostly I just want dreamweaver not to puke on a gsp tag so we can do the design directly to the gsp views without the extra step.Atwater

© 2022 - 2024 — McMap. All rights reserved.