Web Scripts:

- addition of extension paths for web script customisations
- updated "delete ticket" web script to return appropriate response on success

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5867 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2007-06-06 11:57:42 +00:00
parent 6cadd8573a
commit c7fddafa1e
7 changed files with 60 additions and 2 deletions

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<view:view xmlns:view="http://www.alfresco.org/view/repository/1.0">
<cm:folder xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:alf="http://www.alfresco.org" xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0" xmlns:act="http://www.alfresco.org/model/action/1.0" xmlns:wf="http://www.alfresco.org/model/workflow/1.0" xmlns:app="http://www.alfresco.org/model/application/1.0" xmlns:ver="http://www.alfresco.org/model/versionstore/1.0" xmlns:usr="http://www.alfresco.org/model/user/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:wcm="http://www.alfresco.org/model/wcmmodel/1.0" xmlns:wca="http://www.alfresco.org/model/wcmappmodel/1.0" xmlns:sys="http://www.alfresco.org/model/system/1.0" xmlns:wcmwf="http://www.alfresco.org/model/wcmworkflow/1.0" xmlns:rule="http://www.alfresco.org/model/rule/1.0" xmlns:fm="http://www.alfresco.org/model/forum/1.0" xmlns:bpm="http://www.alfresco.org/model/bpm/1.0" xmlns:custom="custom.model" xmlns="" view:childName="cm:extensionwebscripts">
<view:aspects>
<app:uifacets></app:uifacets>
</view:aspects>
<view:properties>
<cm:description>Customized Web Scripts</cm:description>
<app:icon>space-icon-default</app:icon>
<cm:title>URL addressable Web Service Extensions</cm:title>
<cm:name>Web Scripts Extensions</cm:name>
</view:properties>
<view:associations>
<cm:contains>
<cm:content view:childName="cm:readme.html">
<view:aspects>
<cm:titled></cm:titled>
<cm:author></cm:author>
<app:inlineeditable></app:inlineeditable>
</view:aspects>
<view:properties>
<app:editInline>true</app:editInline>
<cm:description>How to customize an existing Web Script</cm:description>
<cm:content>contentUrl=classpath:alfresco/bootstrap/webscripts/readmeExtension.html|mimetype=text/html|size=|encoding=UTF-8|locale=en_US_</cm:content>
<cm:title></cm:title>
<cm:author></cm:author>
<cm:name>readme.html</cm:name>
</view:properties>
<view:associations></view:associations>
</cm:content>
</cm:contains>
</view:associations>
</cm:folder>
</view:view>

View File

@@ -1 +1 @@
<h1>Web Scripts &nbsp;</h1><p>Documentation on how to develop a Web Script may be found <a href="http://wiki.alfresco.com/wiki/Web_Scripts">here</a>. </p><p>Web Scripts allow you to bind new Alfresco-based functionality to a HTTP method and custom URL. A library of URLs may be built up to provide a complete API accessible via HTTP.&nbsp; They are ideal for building data access &amp; update APIs and simple UI components such as Portlets.&nbsp; Development of Web Scripts may be performed within Alfresco.&nbsp; Knowledge of Java is <em><strong>not</strong></em> required.<br /> </p><p>For example, you could create the following API for your particular application... </p> <dl><dt><strong>Execute a search</strong> </dt></dl> <p>GET http://&lt;host&gt;:&lt;port&gt;/alfresco/service/blog/category?c=Web20 </p> <dl><dt><strong>Retrieve meta-data for an item in the repository</strong> </dt></dl> <p>GET http://&lt;host&gt;:&lt;port&gt;/alfresco/service/blog/2007/03/04/new-release </p> <dl><dt><strong>Update meta-data for an item in the repository</strong> </dt></dl> <p>POST http://&lt;host&gt;:&lt;port&gt;/alfresco/service/blog/2007/03/04/new-release?status=Draft </p> <dl><dt><strong>Delete an item in the repository</strong> </dt></dl> <p>DELETE http://&lt;host&gt;:&lt;port&gt;/alfresco/service/blog/2007/03/04/new-release </p>
<h1>Web Scripts</h1><p>Documentation on how to develop a Web Script may be found <a href="http://wiki.alfresco.com/wiki/Web_Scripts">here</a>. </p><p>Web Scripts allow you to bind new Alfresco-based functionality to a HTTP method and custom URL. A library of URLs may be built up to provide a complete API accessible via HTTP.&nbsp; They are ideal for building data access &amp; update APIs and simple UI components such as Portlets.&nbsp; Development of Web Scripts may be performed within Alfresco.&nbsp; Knowledge of Java is <em><strong>not</strong></em> required.<br /> </p><p>For example, you could create the following API for your particular application... </p> <dl><dt><strong>Execute a search</strong> </dt></dl> <p>GET http://&lt;host&gt;:&lt;port&gt;/alfresco/service/blog/category?c=Web20 </p> <dl><dt><strong>Retrieve meta-data for an item in the repository</strong> </dt></dl> <p>GET http://&lt;host&gt;:&lt;port&gt;/alfresco/service/blog/2007/03/04/new-release </p> <dl><dt><strong>Update meta-data for an item in the repository</strong> </dt></dl> <p>POST http://&lt;host&gt;:&lt;port&gt;/alfresco/service/blog/2007/03/04/new-release?status=Draft </p> <dl><dt><strong>Delete an item in the repository</strong> </dt></dl> <p>DELETE http://&lt;host&gt;:&lt;port&gt;/alfresco/service/blog/2007/03/04/new-release </p>

View File

@@ -0,0 +1 @@
<h1>How to Customize a Web Script</h1><p>Documentation on how to develop a Web Script may be found <a href="http://wiki.alfresco.com/wiki/Web_Scripts">here</a>.</p><p>Any part of a Web Script (i.e. its description, &quot;execute&quot; javascript, or &quot;response&quot; template) may be overridden.&nbsp;&nbsp; This is achieved by copying the original part to this extension folder.&nbsp; The folder within which the part lives must be replicated in this extension area too.<br /></p><p>e.g. to override the html output of the &quot;Keyword search&quot; script...</p><p>copy</p><p><em>/Data Dictionary/Web Scripts/org/alfresco/repository/keywordsearch.get.html.ftl </em><br /></p><p>to</p><p><em>/Data Dictionary/Web Scripts Extensions/org/alfresco/repository/keywordsearch.get.html.ftl </em><br /> </p><p>Once copied, you can make your changes to the copy.</p><p>To ensure your override is registered, go to <a href="/alfresco/service/">/alfresco/service/</a> and click on the &quot;Refresh List of Web Scripts&quot; button.&nbsp; The next invocation of the web script will include your override.<br /> </p>