I have a model folder
"0000"
alfresco
{"alf_destination": "workspace://SpacesStore/35818681-274f-4d61-8fe7-5cff238513e5",
"prop_cm_name": "0000",
"prop_cm_title": "",
"prop_cm_description": "",
"sourceNodeRef": "workspace://SpacesStore/aeeaca0a-89bf-4294-8506-315ecd7d18f2",
"parentNodeRef": "workspace://SpacesStore/35818681-274f-4d61-8fe7-5cff238513e5"
}
/{id}
ftp_mkdir
/Alfresco/Dictionnaire de données/Modèles d'espace/0000
/Alfresco/Data/users
There is the userHomesHomeFolderProvider
that allows you inject Home Folder Template. You can find its definition inside this library: tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-{ver}.jar/alfresco/authentication-services-context.xml
:
<bean name="userHomesHomeFolderProvider" parent="usernameHomeFolderProvider">
<property name="rootPath">
<value>/${spaces.company_home.childname}/${spaces.user_homes.childname}</value>
</property>
<property name="storeUrl">
<value>${spaces.store}</value>
</property>
</bean>
You can customize this bean as follows:
Create the template folder and its content (files, sub-folders,..), for example: Repository> Data Dictionary> user_homes_templates> custom_home_root
Override the userHomesHomeFolderProvider
bean definition and inject the new property templatePath
pointing to the template folder.
Create the file tomcat/shared/classes/alfresco/extension/user-homes-custom-context.xml
with the new bean definition:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean name="userHomesHomeFolderProvider" parent="usernameHomeFolderProvider">
<property name="rootPath">
<value>/${spaces.company_home.childname}/${spaces.user_homes.childname}</value>
</property>
<property name="storeUrl">
<value>${spaces.store}</value>
</property>
<property name="templatePath">
<value>/app:company_home/app:dictionary/cm:user_homes_templates/cm:custom_home_root</value>
</property>
</bean>
</beans>
Now restart Alfresco and create the new user, template content will be copied into the new user home folder (Repository> User Homes> {user-name}
).
... and if you really must use PHP try Apache Chemistry CMIS PHP Client or REST API.