Debug Alfresco 4.2 Web scripts in Eclipse - eclipse

Is there a way to debug Alfresco Web Scripts at runtime ? I am talking about webscripts server side. In particular I am developing an AMP for Alfresco 4.2 which make use of a WS in the classic form: .xml + .js + .ftl, therefore not a Java Backed Web Scripts.
The .js controller is developed as part of the AMP, and is placed in the relevant directory for being uploaded at AMP developing/run time.
I would like to put breakpoints in .js controller to use all facilities provided by the Eclipse debug perspective.

If you want to do this thing in eclipse below blow will help you in that case.
Details are on middle of blog.
http://axel-faust.de/?cat=3&lang=en
There is also debugger available in alfresco and share ,in webscript servuce page.
You will also find option for same in below url.
http://localhost:8080/alfresco/service/index
Click Refresh Web Scripts on the Web Scripts Home page to ensure the Web Script Framework has cleared its caches.
Click List Web Scripts.
Click Alfresco JavaScript Debugger.
Click Enable to launch the JavaScript Debugger in a separate window.

Related

missing profile for a server adapter in Eclipse

I am trying to set up a dynamic web project in Eclipse 2018-12. Within the Java EE perspective, the lower panel is hosting several commonly used views (markers, console, snippets, search ), among which the Servers view offers the possibility to bind the current project to an already existing server.
If no such server is defined, this view is showing a quick link to "add new server. When one is about to define a new server, a creation wizard takes off, and the first window you get is the profile select window. I would like to set up a Tomcat server, but my initial list does not include Apache Tomcat at all.
Question: how am I supposed top populate the initial list with a desired web server profile template ?
I have searched for Eclipse download links and the first link (and the only one shown there) on the Eclipse Foundation page was Eclipse 2018-12. It seemed pretty good at the time. Now the same page shows Eclipse 2019-06 (64-bits).
Upgrading the current intallation with the JST Server Adapter Extensions did the job nicely. Thank you nitind !

Auto refresh browser on save for Grails project?

I am working on Grails 3 project and I cannot find a way to auto-refresh browser upon save LESS/SASS files and HTML/CSS files and Groovy and GSP files. Assume I have chrome browser window opened to my application page. For quicker development it should refresh automatically when I make a change and save any of the mentioned file types in my project. Eclipse based solution is preferred but IntelliJ IDEA Community edition may be considered or other open source but well maintained and stable solution that works with Grails/Gradle projects.
FYI I am using Mac OS X.
If you use Sublime Text you can install the following plugin: https://github.com/gcollazo/BrowserRefresh-Sublime
It adds a key binding to refresh your browser on save. But this would mean starting/stopping your server using some other method. I prefer cmd line or just a terminal screen than a heavy IDE for Grails.

How to import Google App Script projects into Eclipse?

I searched if there is a way to work on my Google App Script projects using Eclipse (Eclipse Luna) and I landed on this page. But I couldn't follow it to the end because the Eclipse dialog that should've shown my projects so I can import what project I want to start working on, was empty and had only a folder icon named My Drive. I clicked and double-clicked it, nothing happens.
So I searched more and found this page and when I reached the authorization section , I felt totally lost !
The authorization page instructed me to register my application using this page but now I don't know what else should I do to enable Google App Script development on Eclipse !
So how can I enabled Google App Script devlopment on Eclipse ?
The Google Plugin is based on the Google Apps Import/Export API. From the documentation:
The API allows access to standalone scripts (the scripts that appear in your Google Drive). Container-bound scripts cannot be accessed through the API.
So if you created an earlier project from with (for example) Google sheets, it will not show up in the import.
To test:
login to Google and go to google Script.
Choose: Create a blank project.
Save the project as (for example) my-project.
The project you created should now show up in the Import wizard.
See also here: developers.google.com/eclipse/docs/apps_script :
Creating a new project in Eclipse is not supported. You can only import existing projects.
Renaming the project in your workspace does not rename it in the script editor or Google Drive.
All .gs and .html files that are to be saved back to Google Drive must be in the project's root folder. Other types of files, and files in subfolders of the Eclipse project, are not considered to be part of the Apps Script project on Google Drive.
Autocomplete suggestions are not provided for libraries or advanced Google services.
Autocomplete may not always reflect the methods most recently added to Apps Script. Any code valid in the script editor will still run correctly."

Reflecting changes from jsp, css, js, html onto browser without reloading the page

I have a Dynamic Web Project on eclipse and Tomcat 7 as the server (using within eclipse). After doing 'Run on Server' on the project, it gets deployed and runs on the browser. However, any changes made to the css/js/html/jsp files do get published automatically on save, however doesn't get reflected on the browser without reload.
Is there any way to make changes visible on the browser without any reload?
For me the problem appears to be fixed by removing the "antiResourceLocking=true" attribute from the Tomcat "context.xml" element.
This is consistent with this post
I'm still trying to determine why Eclipse WTP decides to put this attribute in there in some situations and not others. I have other webapps that are run in Eclipse in the same way and they don't have that attribute set.

Eclipse PDT: put my workspace under htdocs or is there a "move files" build directive?

I am using Eclipse PDT with the Zend community server to develop PHP.
If I write some code and hit Run As...PHP Web Page, I get "Page cannot be found". This makes sense since my workspace is off in my documents folder, not in the Zend/Apache's htdocs tree.
So one option would be to move my workspace to a folder under the Apache htdocs. But that just seems wrong ;-) Also, I keep my workspace in a Dropbox folder.
Is there an alternative directive/configuration setting for Eclipse PDT that says "when I say Run or Build, I want you to copy the project to folder X and run it as a web page from there". Or perhaps something else I'm missing about Eclipse PDT?
I found a method, using Ant: http://www.tellingmachine.com/post/Configuring-Eclipse-PDT-to-work-with-Ant-build-tasks.aspx
Here is my method for developing PHP on Windows in Eclipse:
Download the Zend all-in-one Eclipse environment
Download the Zend Server CE
Install Zend into someplace like c:\Zend. If you put it in Program Files, you'll need to do extra security configuration or else your build directives will fail.
Using the link above to setup Ant and a build directive
Wah-lah. You can setup a Run Configuration and then Run As... and view your php script in a web browser.
You could also use the stock Eclipse PDT and WAMP and achieve the same effect. The key is (1) putting your htdocs outside of Program Files, and (2) using Ant to automate the build copy.
http://ventralnet.blogspot.com/2011/03/eclipse-pdt-auto-deploy-webapp-to.html
You can use a combination of ANT and custom builders in eclipse to auto copy your web app to your web root