mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -187,6 +187,10 @@
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
|
||||
<prop key="location">alfresco/bootstrap/webScripts.xml</prop>
|
||||
</props>
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
|
||||
<prop key="location">alfresco/bootstrap/webScriptsExtensions.xml</prop>
|
||||
</props>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
34
config/alfresco/bootstrap/webScriptsExtensions.xml
Normal file
34
config/alfresco/bootstrap/webScriptsExtensions.xml
Normal 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>
|
@@ -1 +1 @@
|
||||
<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. They are ideal for building data access & update APIs and simple UI components such as Portlets. Development of Web Scripts may be performed within Alfresco. 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://<host>:<port>/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://<host>:<port>/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://<host>:<port>/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://<host>:<port>/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. They are ideal for building data access & update APIs and simple UI components such as Portlets. Development of Web Scripts may be performed within Alfresco. 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://<host>:<port>/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://<host>:<port>/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://<host>:<port>/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://<host>:<port>/alfresco/service/blog/2007/03/04/new-release </p>
|
@@ -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, "execute" javascript, or "response" template) may be overridden. This is achieved by copying the original part to this extension folder. 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 "Keyword search" 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 "Refresh List of Web Scripts" button. The next invocation of the web script will include your override.<br /> </p>
|
@@ -150,3 +150,4 @@ patch.AVMLayeredSnapshotPatch.description=Set indirectionVersion on Layered Node
|
||||
patch.AVMLayeredSnapshotPatch.result=Layered Node indirectionVersions set.
|
||||
|
||||
patch.webscripts.description=Adds Web Scripts to Data Dictionary.
|
||||
patch.webscriptsExtension.description=Adds Web Scripts Extension to Data Dictionary.
|
||||
|
@@ -765,4 +765,22 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="patch.webscriptsExtension" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" >
|
||||
<property name="id"><value>patch.webscriptsExtension</value></property>
|
||||
<property name="description"><value>patch.webscriptsExtension.description</value></property>
|
||||
<property name="fixesFromSchema"><value>0</value></property>
|
||||
<property name="fixesToSchema"><value>54</value></property>
|
||||
<property name="targetSchema"><value>55</value></property>
|
||||
<!-- bootstrap view -->
|
||||
<property name="importerBootstrap">
|
||||
<ref bean="spacesBootstrap" />
|
||||
</property>
|
||||
<property name="bootstrapView">
|
||||
<props>
|
||||
<prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
|
||||
<prop key="location">alfresco/bootstrap/webScriptsExtensions.xml</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
@@ -19,4 +19,4 @@ version.build=@build-number@
|
||||
|
||||
# Schema number
|
||||
|
||||
version.schema=54
|
||||
version.schema=55
|
||||
|
Reference in New Issue
Block a user