Possible to deploy WAR via Dreamweaver CS5? - ant

I use Dreamweaver heavily for modifying Liferay templates (Velocity files), and then have to run Apache Ant from Command Prompt to deploy the WAR to Tomcat . Is there anyway I can streamline this process so I can save/deploy straight from Dreamweaver?
I tried to setup a site and specify Tomcat as the local server, but obviously Dreamweaver just tries to push the raw file and does deploy the WAR.. Is there some sort of extension or way I can call Apache Ant from Dreamweaver?
Thanks!

I've not seen such an extension, you can search for one at the Adobe Exchange: http://www.adobe.com/go/exchange , however if there isn't one already available, which I suspect there isn't, it would be possible to write one of your own. The following links are for the extending Dreamweaver, and Dreamweaver extensibility APIs:
http://help.adobe.com/en_US/dreamweaver/cs/extend/index.html
http://help.adobe.com/en_US/dreamweaver/cs/apiref/index.html
In this particular case, I believe that you'd need to use an undocumented API call to communicate with an external process (in your case Ant), such as DWfile.runCommandLine() or MM.runCommandLine(). Paul Boon found these and blogged about them and a couple of others here:
http://communitymx.com/blog/index.cfm?newsid=179&blogger=35

Related

Generating Multiple Typescript Files with NSwag

I've just started looking into using NSwag to auto-generate typescript clients for a WebAPI project. I've naively started with this simple build step:
nswag webapi2swagger /assembly:bin\MyProject.WebAPI.dll /output:Swagger.json
nswag swagger2tsclient /input:Swagger.json /output:WebAPIs.ts
This works great... maybe too great. I've now got a 17000 line typescript file full of clients for every endpoint in the API.
I know I could specify individual classes or controllers for nswag to generate, but I'd like it to be automatic for new controllers as we continue to build the system. Ideally, I'd probably be best served with a set of typescript files where each file represented a single controller.
Does anyone know how I might use the command line tools to break up the output that way?
I don't think this is possible with the current CLI tools, so I wrote a small console application which uses reflection to gather controllers from the webapi assembly, then calls the WebApiToSwaggerGenerator and SwaggerToTypeScriptClientGenerator for each controller individually.
This is not possible yet but you can follow this feature's progress on: https://github.com/RicoSuter/NSwag/issues/1398
The page contains some suggested workarounds. One is to use this tool:
https://github.com/hemiaoio/nswag-ts-splitter

Sling Testing Tools Selector configuration

AEM 5.6.1
I am trying to run some server side testing using the sling testing tools. I have deployed the junit.core bundle and I can navigate to the JUnitServlet at /system/sling/junit/
When I hit this url there are tests visible from multiple bundles, I don't want to run the adobe ones but I can't figure out how to filter package names past the period using the url.
e.g
Available tests:
com.adobe.stuff
com.my.stuff
I tried:
/system/sling/junit/com/ <--works but isn't detailed enough
/system/sling/junit/com.my <-- breaks unsurprisingly
/system/sling/junit/com%2Emy <-- also breaks with 501
Is there an expected way of doing this? I couldn't find any documentation about this and the javadoc didn't really help either.
/system/sling/junit/com.my.html should work - you are right that the /system/sling/junit servlet should make this more explicit. There are examples of running such tests from proxy JUnit tests in the Sling codebase, see SlingServerSideTest for example.

Running grails test-app command from grails web console plugin

I have installed the grails web plugin. I can now browse to :
localhost:8080/myappname/console
And I can see the console displayed over there. I have bunch of test-cases written for application. I wish I can test my app from this web console.
Is it possible to do so? I'm very new to grails.
Thanks in advance.
Short answer no. The grails console is meant to write groovy code that interacts with your running application. Your running application does not include your test cases or the grails command line by default.
Long answer sort of. Provided you have all of your projects source code available somewhere in the file system where your application is running, you could call an external process to run test-app and return the result to the user. Here are some docs on running external processes in groovy: http://groovy.codehaus.org/Executing+External+Processes+From+Groovy. I suppose you could also package you application somehow to make this work, but I think doing that would be fairly complex.
I am not sure this is a good use case for the console plugin over all. Hope this helps

Modifying Grails apps post deployment

I'm investigating Grails vs. other Agile web frameworks, and one key use case I'm trying to support is the ability to modify controllers and install plugins post deployment. It appears that this isn't possible with Grails, but I want to make sure before I write it off.
As far as modifying controllers goes, it would be sufficient if the Groovlet behavior existed (compile-on-demand).
As far as plugin installs go, I understand this may be a long shot, but I thought I'd check to be sure.
For your information, I need this because I work on a product that requires a little site-specific customization, such as adding validation of simple meta-data, integrating with customer security environments, and maybe even including new controllers/pages quickly.
Out of the box, no, grails doesn't really support what you want. There may be ways to customize it but I've never looked into it. A PHP framework might be more of your ally since there is no real deployment process other than copying PHP files to a location.
That said, I personally would prefer a strict set of deployment policies. And honestly, deploying changes with Grails is as simple as running the 'grails war' command and copying that war to your servlet container. The site's downtime is negligible and if you have multiple web servers with a load-balancer, your customers should never see down time due to deployments.
Although it's not recommended for complex coding; You could execute groovy code from a string that you could store in database or a file on the fly at run time:
check out Groovy template engine:
http://groovy.codehaus.org/Groovy+Templates
but even then, you are still limited on what you can do or can't do let alone debugging will lack. you may want to consider an interpreted language; few to mention PHP/Perl/Coldfusion.

I want to use EtherPad (or a clone). My site is running Ruby on Rails. API or local install?

I'd like to utilize an etherpad interface on my website. Two questions:
1) is there any site with an etherpad api that I could just call remotely?
2) if not, how much trouble is it to install scala and have the two run concurrently?
Thanks
Check out http://piratepad.net and http://ietherpad.com
And you can embed those etherpad instances using a simple iframe as suggested here: http://etherpad.com/ep/blog/posts/embedding-etherpad
There doesn't seem to be a proper API yet for more robust interactions.
The original etherpad.com has now gone away but at that link there is a list of clones.
The instructions for embedding etherpads seems to have gone away with the rest of etherpad.com but I believe it's as simple as this:
<div id="ep">
<iframe src="http://etherpad.com/foo?fullScreen=1"></iframe>
</div>
Replace "etherpad.com" with whatever clone you're using, "foo" with the name of your pad, and you may or may not want to change that fullScreen=1 to fullScreen=0 (or leave it off altogether).
Installing scala might mean a few things:
Installing the SDK (i.e. scalac)
Installing the runtime
Assuming you mean the runtime, scala runs entirely on the Java Virtual Machine (JVM) so assuming you have 1.5+ JVM installed, you can run scala programs on it easily (Scala just compiles down to bytecode, after all). All a scala program requires is a few JARs on the classpath (scala-library and scala-compiler)
Now there is a better solution Etherpad Lite it is easily installable and embedable. See http://etherpad.org

Resources