diff --git a/config/alfresco/templates/webscripts/org/alfresco/index.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/index.get.desc.xml index ed8b75f368..0f28256724 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/index.get.desc.xml +++ b/config/alfresco/templates/webscripts/org/alfresco/index.get.desc.xml @@ -1,6 +1,6 @@ - Web Scripts Documentation - Web Scripts Documentation + Web Scripts Home + Web Scripts Home / /index \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/index.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/index.get.html.ftl index 457b7a2234..8b6899f395 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/index.get.html.ftl +++ b/config/alfresco/templates/webscripts/org/alfresco/index.get.html.ftl @@ -2,7 +2,7 @@ - Web Scripts Documentation + Web Scripts Home @@ -11,7 +11,7 @@ - +
AlfrescoWeb Scripts DocumentationWeb Scripts Home
Alfresco ${server.edition} v${server.version}
${webscripts?size} Web Scripts - Online documentation. @@ -19,34 +19,17 @@

+ Index
Browse all Web Scripts +
Browse by Web Script URL +
Browse by Web Script Package

- <#macro recurseuri uri> - <#if uri.scripts?size > 0> -
${uri.path} - - <#list uri.children as childpath> - <@recurseuri uri=childpath/> - - - Web Scripts by URL - - <@recurseuri uri=rooturl/> -

- <#macro recursepackage package> - <#if package.scripts?size > 0> -
${package.path} - - <#list package.children as childpath> - <@recursepackage package=childpath/> - - - Web Scripts by Package + Maintenance - <@recursepackage package=rootpackage/> +
Alfresco Javascript Debugger
\ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.get.desc.xml new file mode 100644 index 0000000000..a0e819a320 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.get.desc.xml @@ -0,0 +1,5 @@ + + Javascript Debugger + Javascript Debugger + /api/javascript/debugger + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.get.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.get.html.ftl new file mode 100644 index 0000000000..975f668728 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.get.html.ftl @@ -0,0 +1,22 @@ + + + + + Alfresco Javascript Debugger + + + +
+ + + + + + +
AlfrescoAlfresco Javascript Debugger
Alfresco ${server.edition} v${server.version} +
Currently <#if visible>enabled<#else>disabled. + +
+
+ + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.post.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.post.desc.xml new file mode 100644 index 0000000000..0a6ff885e4 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.post.desc.xml @@ -0,0 +1,5 @@ + + Javascript Debugger Maintenance + Javascript Debugger Maintenance + /api/javascript/debugger?active={active?} + \ No newline at end of file diff --git a/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.post.html.ftl b/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.post.html.ftl new file mode 100644 index 0000000000..975f668728 --- /dev/null +++ b/config/alfresco/templates/webscripts/org/alfresco/jsdebugger.post.html.ftl @@ -0,0 +1,22 @@ + + + + + Alfresco Javascript Debugger + + + +
+ + + + + + +
AlfrescoAlfresco Javascript Debugger
Alfresco ${server.edition} v${server.version} +
Currently <#if visible>enabled<#else>disabled. + +
+
+ + \ No newline at end of file diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml index bd83d2c1c3..b10279545a 100644 --- a/config/alfresco/web-scripts-application-context.xml +++ b/config/alfresco/web-scripts-application-context.xml @@ -195,6 +195,14 @@ + + + + + + + + diff --git a/source/java/org/alfresco/web/scripts/bean/JavascriptDebugger.java b/source/java/org/alfresco/web/scripts/bean/JavascriptDebugger.java new file mode 100644 index 0000000000..1d57ac000b --- /dev/null +++ b/source/java/org/alfresco/web/scripts/bean/JavascriptDebugger.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2005-2007 Alfresco Software Limited. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ +package org.alfresco.web.scripts.bean; + +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.repo.jscript.AlfrescoRhinoScriptDebugger; +import org.alfresco.web.scripts.DeclarativeWebScript; +import org.alfresco.web.scripts.WebScriptRequest; +import org.alfresco.web.scripts.WebScriptStatus; + + +/** + * Javascript Debugger + * + * @author davidc + */ +public class JavascriptDebugger extends DeclarativeWebScript +{ + // dependencies + private AlfrescoRhinoScriptDebugger debugger; + + /** + * @param ticketComponent + */ + public void setDebugger(AlfrescoRhinoScriptDebugger debugger) + { + this.debugger = debugger; + } + + + /* (non-Javadoc) + * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse) + */ + @Override + protected Map executeImpl(WebScriptRequest req, WebScriptStatus status) + { + // construct model + Map model = new HashMap(7, 1.0f); + model.put("visible", debugger.isVisible()); + return model; + } + +} diff --git a/source/java/org/alfresco/web/scripts/bean/JavascriptDebuggerPost.java b/source/java/org/alfresco/web/scripts/bean/JavascriptDebuggerPost.java new file mode 100644 index 0000000000..86b2f7be75 --- /dev/null +++ b/source/java/org/alfresco/web/scripts/bean/JavascriptDebuggerPost.java @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2005-2007 Alfresco Software Limited. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + * As a special exception to the terms and conditions of version 2.0 of + * the GPL, you may redistribute this Program in connection with Free/Libre + * and Open Source Software ("FLOSS") applications as described in Alfresco's + * FLOSS exception. You should have recieved a copy of the text describing + * the FLOSS exception, and it is also available here: + * http://www.alfresco.com/legal/licensing" + */ +package org.alfresco.web.scripts.bean; + +import java.util.HashMap; +import java.util.Map; + +import org.alfresco.repo.jscript.AlfrescoRhinoScriptDebugger; +import org.alfresco.web.scripts.DeclarativeWebScript; +import org.alfresco.web.scripts.WebScriptRequest; +import org.alfresco.web.scripts.WebScriptStatus; + + +/** + * Javascript Debugger + * + * @author davidc + */ +public class JavascriptDebuggerPost extends DeclarativeWebScript +{ + // dependencies + private AlfrescoRhinoScriptDebugger debugger; + + /** + * @param ticketComponent + */ + public void setDebugger(AlfrescoRhinoScriptDebugger debugger) + { + this.debugger = debugger; + } + + + /* (non-Javadoc) + * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse) + */ + @Override + protected Map executeImpl(WebScriptRequest req, WebScriptStatus status) + { + String visibleStr = req.getParameter("visible"); + boolean visible = Boolean.valueOf(visibleStr); + + if (visible) + { + debugger.show(); + } + else + { + debugger.hide(); + } + + Map model = new HashMap(7, 1.0f); + model.put("visible", debugger.isVisible()); + return model; + } + +}