cancel
Showing results for 
Search instead for 
Did you mean: 

Webscripts Development Environment

dinger
Champ in-the-making
Champ in-the-making
How does everyone develop their webscripts? Text editor, with javascript and freemarker syntax highlighting? Eclipse? Something else?

How do you update your webscripts in situ?  Do you edit them in the webapps directory? How do you deal with version controlling?

I'm struggling to get a good environment setup for myself!

Rob
10 REPLIES 10

mikeh
Star Contributor
Star Contributor
Personally, I use TextMate on the Mac. There's no Freemarker syntax highlighting, but HTML is good enough. I used to use UltraEdit on the PC. The common "useful" feature between the two is being able to put together projects containing just the files of interest to the particular project (e.g. webscripts, client-side javascript, etc.) and not having to hunt around the local file system all the time.

When developing, we tend to use an exploded (i.e. no .war file) version of the webapp and update the webscripts using "ant incremental-tomcat-exploded"

We've got some in-house scripts to help this process (basically wrapping up the common ant targets using 2- or 3-letter shell scripts).

All version control is done using SVN tools, e.g. SmartSVN which has a good built-in filediff tool when merges and updates aren't automatic.

Does that help at all?
Mike

pmonks
Star Contributor
Star Contributor
I tend to use TextPad (it has syntax highlighting for both Javascript and Freemarker / HTML), but some of the other guys I work with use Eclipse with the JSEclipse plugin (from memory there's also an FTL plugin for Eclipse).  That said I've not developed any humungous web scripts - most of the ones I've written are only 100s of lines of code, so I haven't missed not having a specialised IDE.

I'm keen to hear what others are using - nothing better than being told about shiny new baubles to play with!  😉

Cheers,
Peter

jpfi
Champ in-the-making
Champ in-the-making
Hi,
I'm using eclipse + aptana (aptana.com) in my opsoro project. I'm deploying Web Scripts by using an custom Ant Build via CIFS Interface into data dictionary/Web Script Extension
folder in repo. For Freemarker files I'm using the freemarker IDE Feature/Plugins from JBosss/Red Hat IDE.
I think there is a great space for a community project implementing JavaScript and Freemarker code completion/editors for Alfresco JavaScript and Freemarker Templates.
Cheers,
Jan

dinger
Champ in-the-making
Champ in-the-making
@Mike

Thanks for that. I'll look into that ant target. Does it work whilst Tomcat is running or does it require a restart?

@Peter

I've been using the JBoss freemarker plugin but didn't have a very good process so just resorted to using notepad++. I think I'll try using eclipse with ant (using mike's advice) and have another go with the plugin.

@jan
I tried aptana before and have just downloaded it again. What specifically do you use it for? It's interesting that you use CIFS and put your scripts in data dictionary. I've been putting them directly into extension but might change that. How about an extension that could modify scripts in the repository itself (via webdav or REST etc)? I've not got much experience with eclipse development but perhaps this could also be a basis for a way for users to interact with Alfresco? Would it be possible to extend the JBOSS plugin to carry out code completion?

Thanks for all the info guys!

Rob

dgenard
Champ on-the-rise
Champ on-the-rise
Hi, I defined an Eclipse project with a source config directory, where I dropped my webscripts (config/alfresco/extension/templates/webscripts/…).
Since the config directory is in the project classpath, this lets me run Alfresco from Eclipse in debug mode (to debug custom Java code), and load webscripts directly from my Eclipse project.

All webscripts are edited in Eclipse (using regular text editor) and are controlled by SVN. No modification in webapps dir.

Note that this requires Alfresco 2.1.1E or 2.1.2E (see related post http://forums.alfresco.com/viewtopic.php?f=10&t=9171).

Denis

davidturner90
Champ in-the-making
Champ in-the-making
On the theme of developing webscripts - how do developers deploy their web scripts?

As I understand it there are a few options available here:

1. Via a templates/webscripts folder that is defined as a classpath folder
2. In a repository folder e.g. /Company Home/Data Dictionary/Web Scripts
3. Module deployment

Module deployment seems like the most managable and decoupled approach. Just wondered what the general consensus is?

jpfi
Champ in-the-making
Champ in-the-making
Hi,
I think we have to differ deployments during development from productive deployments.
Deployments during develpment have to be fast and uncomplicated. Productive Deployments have to be comprehensible and bundled.
So during develpment i choose simple copy to data dictionary. For productive deployment I'd choose the same way or building an AMP Module if the WebScripts depends on any other stuff like content models etc.
Cheers,
Jan

pmonks
Star Contributor
Star Contributor
@David: for development I copy the various Web Script files (descriptor, JS, FTL etc.) into my alfresco/extension folder and edit directly while the server is running - nothing like the productivity of edit / save / refresh browser / rinse & repeat!  😉

Once I have a "finished" version of a Web Script I tend to bundle it in an AMP file and distribute it that way - I've been using the maven4alfresco Maven plugin (available from http://forge.alfresco.com/projects/maven4alfresco/) to build AMPs.

Cheers,
Peter

agatap
Champ in-the-making
Champ in-the-making
Hello Dinger
Could you explain in a bit more detail how you have configured your eclipse, so that you can run your webscripts directly?
I would love to be able to do that!