SlideShare a Scribd company logo
1 of 20
Download to read offline
WebDAV Home
Alfresco
Alfresco
WebScript Alfresco Solr
Alfresco SDK
grep
find
: WebDAV
<servlet>
<servlet-name>WebDAV</servlet-name>
<servlet-class>org.alfresco.repo.webdav.WebDAVServlet</
servlet-class>
<load-on-startup>5</load-on-startup>
</servlet>
: WebDAV
m_davMethods = new Hashtable<String, Class<? extends
WebDAVMethod>>();
m_davMethods.put(WebDAV.METHOD_PROPFIND, PropFindMethod.class);
m_davMethods.put(WebDAV.METHOD_PROPPATCH, PropPatchMethod.class);
m_davMethods.put(WebDAV.METHOD_COPY, CopyMethod.class);
m_davMethods.put(WebDAV.METHOD_DELETE, DeleteMethod.class);
m_davMethods.put(WebDAV.METHOD_GET, GetMethod.class);
m_davMethods.put(WebDAV.METHOD_HEAD, HeadMethod.class);
m_davMethods.put(WebDAV.METHOD_LOCK, LockMethod.class);
m_davMethods.put(WebDAV.METHOD_MKCOL, MkcolMethod.class);
m_davMethods.put(WebDAV.METHOD_MOVE, MoveMethod.class);
m_davMethods.put(WebDAV.METHOD_OPTIONS, OptionsMethod.class);
m_davMethods.put(WebDAV.METHOD_POST, PostMethod.class);
m_davMethods.put(WebDAV.METHOD_PUT, PutMethod.class);
m_davMethods.put(WebDAV.METHOD_UNLOCK, UnlockMethod.class);
: WebDAV
protected void executeImpl() throws WebDAVServerException, Exception
{
FileFolderService fileFolderService = getFileFolderService();
NodeRef rootNodeRef = getRootNodeRef();
String path = getPath();
...
FileInfo nodeInfo = null;
try
{
nodeInfo = getDAVHelper().getNodeForPath(rootNodeRef, path);
}
: WebDAV
WebDAVServlet
GetMethod
DeleteMethod
…
WebDAVMethod
WebDAVHelper
getDAVHelper()
Bean
<bean id="webdav.initParams"
class="org.alfresco.repo.webdav.WebDAVServlet$WebDAVInitParameters">
<property name="enabled" value="${system.webdav.servlet.enabled}" />
<property name="storeName" value="${system.webdav.storeName}" />
<property name="rootPath" value="${system.webdav.rootPath}" />
</bean>
…
<bean id="webDAVHelper" class="org.alfresco.repo.webdav.WebDAVHelper"
parent="baseWebDAVHelper" />
remote-api-context.xml
public class WebDAVHelper extends org.alfresco.repo.webdav.WebDAVHelper
{
public List<FileInfo> getChildren(FileInfo fileInfo) throws
WebDAVServerException
{
List<FileInfo> children =
this.getFileFolderService().list(fileInfo.getNodeRef());
if ( this.rootNodeRefs.contains(fileInfo.getNodeRef())) {
YourHomeFileInfo yourHome = new YourHomeFileInfo();
children.add(yourHome);
}
return children;
}
YourHome
public FileInfo getNodeForPath(NodeRef rootNodeRef, String path) throws
FileNotFoundException
{
…
if ( path.startsWith("/" + YOUR_HOME)) {
// resolve your your name
String userName =
this.getAuthenticationService().getCurrentUserName();
NodeRef person = this.personService.getPerson(userName);
NodeRef homeFolderRef =
(NodeRef)this.getNodeService().getProperty(person,
ContentModel.PROP_HOMEFOLDER);
if ( homeFolderRef != null ) {
FileInfo userHome =
this.getFileFolderService().getFileInfo(homeFolderRef);
String pathLeft = path.replace("/" + YOUR_HOME, "");
if ( pathLeft.length() > 0 ) {
List<String> splitPath = splitAllPaths(pathLeft);
return
this.getFileFolderService().resolveNamePath(userHome.getNodeRef(),
splitPath);
}
else {
return
this.getFileFolderService().getFileInfo(homeFolderRef);
}
}
YourHome
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="webDAVHelper"
class="jp.aegif.study.alfresco.webdav2.WebDAVHelper"
parent="baseWebDAVHelper" >
<property name="personService" ref="PersonService" />
</bean>
</beans>
bean
custom-wedav—context.xml
Alfresco
WebDAV
Alfresco study presentation 38th customize How-To WebDAV
Alfresco study presentation 38th customize How-To WebDAV

More Related Content

What's hot

深入淺出 MVC
深入淺出 MVC深入淺出 MVC
深入淺出 MVC
Jace Ju
 

What's hot (20)

Python Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CIPython Flask app deployed to OPenShift using Wercker CI
Python Flask app deployed to OPenShift using Wercker CI
 
SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)SDPHP - Percona Toolkit (It's Basically Magic)
SDPHP - Percona Toolkit (It's Basically Magic)
 
Deploy Rails Application by Capistrano
Deploy Rails Application by CapistranoDeploy Rails Application by Capistrano
Deploy Rails Application by Capistrano
 
Flask SQLAlchemy
Flask SQLAlchemy Flask SQLAlchemy
Flask SQLAlchemy
 
深入淺出 MVC
深入淺出 MVC深入淺出 MVC
深入淺出 MVC
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
快快樂樂用Homestead
快快樂樂用Homestead快快樂樂用Homestead
快快樂樂用Homestead
 
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南[Community Open Camp] 給 PHP 開發者的 VS Code 指南
[Community Open Camp] 給 PHP 開發者的 VS Code 指南
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
 
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
Develop and Deploy your JavaEE micro service in less than 5 minutes with Apac...
 
Write php deploy everywhere
Write php deploy everywhereWrite php deploy everywhere
Write php deploy everywhere
 
[Spring Camp 2013] Java Configuration 없인 못살아!
[Spring Camp 2013] Java Configuration 없인 못살아![Spring Camp 2013] Java Configuration 없인 못살아!
[Spring Camp 2013] Java Configuration 없인 못살아!
 
Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
RESTful in Drupal 8 and Services module - New`n`Tasty!
RESTful in Drupal 8 and Services module - New`n`Tasty!RESTful in Drupal 8 and Services module - New`n`Tasty!
RESTful in Drupal 8 and Services module - New`n`Tasty!
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)
 
Laravel5 Introduction and essentials
Laravel5 Introduction and essentialsLaravel5 Introduction and essentials
Laravel5 Introduction and essentials
 
Laravel 5.3 - Web Development Php framework
Laravel 5.3 - Web Development Php frameworkLaravel 5.3 - Web Development Php framework
Laravel 5.3 - Web Development Php framework
 
LvivPy - Flask in details
LvivPy - Flask in detailsLvivPy - Flask in details
LvivPy - Flask in details
 

Viewers also liked

Viewers also liked (8)

Alfresco勉強会#40 QRコードによる文書の振り分け
Alfresco勉強会#40 QRコードによる文書の振り分けAlfresco勉強会#40 QRコードによる文書の振り分け
Alfresco勉強会#40 QRコードによる文書の振り分け
 
Alfresco study41 alfresco_sdk3_introduction
Alfresco study41 alfresco_sdk3_introductionAlfresco study41 alfresco_sdk3_introduction
Alfresco study41 alfresco_sdk3_introduction
 
0からわかるAlfresco 2017年1月版
0からわかるAlfresco 2017年1月版0からわかるAlfresco 2017年1月版
0からわかるAlfresco 2017年1月版
 
Share UIカスタマイズの第一歩
Share UIカスタマイズの第一歩Share UIカスタマイズの第一歩
Share UIカスタマイズの第一歩
 
Alfresco勉強会#35 AlfrescoのアクティビティフィードをSlackに送るカスタマイズ
Alfresco勉強会#35 AlfrescoのアクティビティフィードをSlackに送るカスタマイズAlfresco勉強会#35 AlfrescoのアクティビティフィードをSlackに送るカスタマイズ
Alfresco勉強会#35 AlfrescoのアクティビティフィードをSlackに送るカスタマイズ
 
Alfresco勉強会#36 alfresco 5でカスタムREST APIを作ってみよう
Alfresco勉強会#36 alfresco 5でカスタムREST APIを作ってみようAlfresco勉強会#36 alfresco 5でカスタムREST APIを作ってみよう
Alfresco勉強会#36 alfresco 5でカスタムREST APIを作ってみよう
 
Alfresco Javascript Consoleのご紹介
Alfresco Javascript Consoleのご紹介Alfresco Javascript Consoleのご紹介
Alfresco Javascript Consoleのご紹介
 
Alfresco勉強会#34 Alfrescoをカスタマイズする時に知っておくと便利なこと
Alfresco勉強会#34 Alfrescoをカスタマイズする時に知っておくと便利なことAlfresco勉強会#34 Alfrescoをカスタマイズする時に知っておくと便利なこと
Alfresco勉強会#34 Alfrescoをカスタマイズする時に知っておくと便利なこと
 

Similar to Alfresco study presentation 38th customize How-To WebDAV

JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
haruki ueno
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
IndicThreads
 
Scala based Lift Framework
Scala based Lift FrameworkScala based Lift Framework
Scala based Lift Framework
vhazrati
 
Build your web app with asp.net mvc 2 from scratch
Build your web app with asp.net mvc 2 from scratchBuild your web app with asp.net mvc 2 from scratch
Build your web app with asp.net mvc 2 from scratch
Chalermpon Areepong
 

Similar to Alfresco study presentation 38th customize How-To WebDAV (20)

JavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオンJavaDo#09 Spring boot入門ハンズオン
JavaDo#09 Spring boot入門ハンズオン
 
Overview Of Lift Framework
Overview Of Lift FrameworkOverview Of Lift Framework
Overview Of Lift Framework
 
Overview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web FrameworkOverview of The Scala Based Lift Web Framework
Overview of The Scala Based Lift Web Framework
 
Scala based Lift Framework
Scala based Lift FrameworkScala based Lift Framework
Scala based Lift Framework
 
JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0JavaOne India 2011 - Servlets 3.0
JavaOne India 2011 - Servlets 3.0
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
 
Vue js 大型專案架構
Vue js 大型專案架構Vue js 大型專案架構
Vue js 大型專案架構
 
Ajax, JSF, Facelets, Eclipse & Maven tutorials
Ajax, JSF, Facelets, Eclipse & Maven tutorialsAjax, JSF, Facelets, Eclipse & Maven tutorials
Ajax, JSF, Facelets, Eclipse & Maven tutorials
 
Knowledge Sharing : Java Servlet
Knowledge Sharing : Java ServletKnowledge Sharing : Java Servlet
Knowledge Sharing : Java Servlet
 
Zend Framework Foundations
Zend Framework FoundationsZend Framework Foundations
Zend Framework Foundations
 
Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talk
 
Build your web app with asp.net mvc 2 from scratch
Build your web app with asp.net mvc 2 from scratchBuild your web app with asp.net mvc 2 from scratch
Build your web app with asp.net mvc 2 from scratch
 
Rest with-spray
Rest with-sprayRest with-spray
Rest with-spray
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
iOS App Module Management
iOS App Module ManagementiOS App Module Management
iOS App Module Management
 
Jsf
JsfJsf
Jsf
 
Apache Click
Apache ClickApache Click
Apache Click
 
Let's play with adf 3.0
Let's play with adf 3.0Let's play with adf 3.0
Let's play with adf 3.0
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Jlook web ui framework
Jlook web ui frameworkJlook web ui framework
Jlook web ui framework
 

More from Takeshi Totani

Alfresco勉強会#25 ワークフロー入門
Alfresco勉強会#25 ワークフロー入門Alfresco勉強会#25 ワークフロー入門
Alfresco勉強会#25 ワークフロー入門
Takeshi Totani
 
Alfresco onlineeditbywebdav 2013
Alfresco onlineeditbywebdav 2013Alfresco onlineeditbywebdav 2013
Alfresco onlineeditbywebdav 2013
Takeshi Totani
 
20130925 alfresco study18performancetuning
20130925 alfresco study18performancetuning20130925 alfresco study18performancetuning
20130925 alfresco study18performancetuning
Takeshi Totani
 
20130801 alfresco study17customizemap
20130801 alfresco study17customizemap20130801 alfresco study17customizemap
20130801 alfresco study17customizemap
Takeshi Totani
 

More from Takeshi Totani (12)

Alfresco study32 introducing5.1
Alfresco study32 introducing5.1Alfresco study32 introducing5.1
Alfresco study32 introducing5.1
 
Alfresco study29 activitymonitoring
Alfresco study29 activitymonitoringAlfresco study29 activitymonitoring
Alfresco study29 activitymonitoring
 
Alfresco勉強会#25 ワークフロー入門
Alfresco勉強会#25 ワークフロー入門Alfresco勉強会#25 ワークフロー入門
Alfresco勉強会#25 ワークフロー入門
 
20140129 alfresco addons
20140129 alfresco addons20140129 alfresco addons
20140129 alfresco addons
 
Alfresco onlineeditbywebdav 2013
Alfresco onlineeditbywebdav 2013Alfresco onlineeditbywebdav 2013
Alfresco onlineeditbywebdav 2013
 
20130925 alfresco study18performancetuning
20130925 alfresco study18performancetuning20130925 alfresco study18performancetuning
20130925 alfresco study18performancetuning
 
20130801 alfresco study17customizemap
20130801 alfresco study17customizemap20130801 alfresco study17customizemap
20130801 alfresco study17customizemap
 
20130606 alfresco study16audit
20130606 alfresco study16audit20130606 alfresco study16audit
20130606 alfresco study16audit
 
20130509 alfresco study15permission
20130509 alfresco study15permission20130509 alfresco study15permission
20130509 alfresco study15permission
 
JJUGナイトセミナー オープンソースポータルLiferayの紹介とLiferay IDEを使った簡単ポートレット開発
JJUGナイトセミナー オープンソースポータルLiferayの紹介とLiferay IDEを使った簡単ポートレット開発JJUGナイトセミナー オープンソースポータルLiferayの紹介とLiferay IDEを使った簡単ポートレット開発
JJUGナイトセミナー オープンソースポータルLiferayの紹介とLiferay IDEを使った簡単ポートレット開発
 
第7回Alfresco勉強会資料 カスタムのオンライン編集
第7回Alfresco勉強会資料 カスタムのオンライン編集第7回Alfresco勉強会資料 カスタムのオンライン編集
第7回Alfresco勉強会資料 カスタムのオンライン編集
 
Alfresco study3 alfresco4
Alfresco study3 alfresco4Alfresco study3 alfresco4
Alfresco study3 alfresco4
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Alfresco study presentation 38th customize How-To WebDAV

  • 1.
  • 2.
  • 7.
  • 10. : WebDAV m_davMethods = new Hashtable<String, Class<? extends WebDAVMethod>>(); m_davMethods.put(WebDAV.METHOD_PROPFIND, PropFindMethod.class); m_davMethods.put(WebDAV.METHOD_PROPPATCH, PropPatchMethod.class); m_davMethods.put(WebDAV.METHOD_COPY, CopyMethod.class); m_davMethods.put(WebDAV.METHOD_DELETE, DeleteMethod.class); m_davMethods.put(WebDAV.METHOD_GET, GetMethod.class); m_davMethods.put(WebDAV.METHOD_HEAD, HeadMethod.class); m_davMethods.put(WebDAV.METHOD_LOCK, LockMethod.class); m_davMethods.put(WebDAV.METHOD_MKCOL, MkcolMethod.class); m_davMethods.put(WebDAV.METHOD_MOVE, MoveMethod.class); m_davMethods.put(WebDAV.METHOD_OPTIONS, OptionsMethod.class); m_davMethods.put(WebDAV.METHOD_POST, PostMethod.class); m_davMethods.put(WebDAV.METHOD_PUT, PutMethod.class); m_davMethods.put(WebDAV.METHOD_UNLOCK, UnlockMethod.class);
  • 11. : WebDAV protected void executeImpl() throws WebDAVServerException, Exception { FileFolderService fileFolderService = getFileFolderService(); NodeRef rootNodeRef = getRootNodeRef(); String path = getPath(); ... FileInfo nodeInfo = null; try { nodeInfo = getDAVHelper().getNodeForPath(rootNodeRef, path); }
  • 13. Bean <bean id="webdav.initParams" class="org.alfresco.repo.webdav.WebDAVServlet$WebDAVInitParameters"> <property name="enabled" value="${system.webdav.servlet.enabled}" /> <property name="storeName" value="${system.webdav.storeName}" /> <property name="rootPath" value="${system.webdav.rootPath}" /> </bean> … <bean id="webDAVHelper" class="org.alfresco.repo.webdav.WebDAVHelper" parent="baseWebDAVHelper" /> remote-api-context.xml
  • 14.
  • 15. public class WebDAVHelper extends org.alfresco.repo.webdav.WebDAVHelper { public List<FileInfo> getChildren(FileInfo fileInfo) throws WebDAVServerException { List<FileInfo> children = this.getFileFolderService().list(fileInfo.getNodeRef()); if ( this.rootNodeRefs.contains(fileInfo.getNodeRef())) { YourHomeFileInfo yourHome = new YourHomeFileInfo(); children.add(yourHome); } return children; } YourHome
  • 16. public FileInfo getNodeForPath(NodeRef rootNodeRef, String path) throws FileNotFoundException { … if ( path.startsWith("/" + YOUR_HOME)) { // resolve your your name String userName = this.getAuthenticationService().getCurrentUserName(); NodeRef person = this.personService.getPerson(userName); NodeRef homeFolderRef = (NodeRef)this.getNodeService().getProperty(person, ContentModel.PROP_HOMEFOLDER); if ( homeFolderRef != null ) { FileInfo userHome = this.getFileFolderService().getFileInfo(homeFolderRef); String pathLeft = path.replace("/" + YOUR_HOME, ""); if ( pathLeft.length() > 0 ) { List<String> splitPath = splitAllPaths(pathLeft); return this.getFileFolderService().resolveNamePath(userHome.getNodeRef(), splitPath); } else { return this.getFileFolderService().getFileInfo(homeFolderRef); } } YourHome
  • 17. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="webDAVHelper" class="jp.aegif.study.alfresco.webdav2.WebDAVHelper" parent="baseWebDAVHelper" > <property name="personService" ref="PersonService" /> </bean> </beans> bean custom-wedav—context.xml Alfresco