12-02-2022 09:12 AM
Hi, I created custom model, that is extending cmis:document, in alfresco share an exported it as zip with two xmls. Now for deployment I want that exported model to be automaticaly imported to alfresco docker container, so I dont have to import it manualy each time. It this possible ? I have not found those xmls in docker container files, I only found namespace and types in database.
12-09-2022 02:38 AM
For anyone wondering I had to add NAME-context.xml next to tomcat/shared/classes/alfresco/extension/custom-document.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="myCustomModel.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/custom-document.xml</value>
</list>
</property>
</bean>
</beans>
Dont know If it nessesary but at least I know that when custom document is deployed it is not shown in alfresco share model mannager or alfresco console command show models. If alfresco start up correctly better to test it with document upload or import .zip file with same custom document name
12-02-2022 09:49 AM
There is no out-of-the-box option to import a Content Model from a ZIP file.
You can design the content model in XML to be deployed in repo part and the forms in XML to be deployed in share. This allows you to deploy them automatically on every deployment:
https://docs.alfresco.com/content-services/latest/develop/repo-ext-points/content-model/
12-07-2022 04:15 AM
Thanks.
So If i understant it correctly, when I created custom model in alfresco share and then export it it gives me 2 files. One where root element is model(there are imports, namespace and types) and secon one where root element is module(there is configuration). So first one with model is actual model and I should copy it to alfresco docker tomcat/shared/classes/alfresco/extension/NAME.xml. Second one is for alfresco share, so document could be viewed in browser so it shoul be copied to alfresco share docker tomcat/shared/classes/alfresco/web-extension/NAME.xml. So I did, checked that files are there, alfresco recognise it because firstly there were errors and when I correced them alfresco started normaly. But there is still no my custom model shown in alfresco share or alfresco console. What can be tha cause ?
12-09-2022 02:38 AM
For anyone wondering I had to add NAME-context.xml next to tomcat/shared/classes/alfresco/extension/custom-document.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="myCustomModel.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/custom-document.xml</value>
</list>
</property>
</bean>
</beans>
Dont know If it nessesary but at least I know that when custom document is deployed it is not shown in alfresco share model mannager or alfresco console command show models. If alfresco start up correctly better to test it with document upload or import .zip file with same custom document name
Explore our Alfresco products with the links below. Use labels to filter content by product module.