cancel
Showing results for 
Search instead for 
Did you mean: 

Building docker container with custom model (exported from alfresco share)

Not applicable

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. 

1 ACCEPTED ANSWER

Not applicable

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

View answer in original post

3 REPLIES 3

angelborroy
Community Manager Community Manager
Community Manager

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/

Hyland Developer Evangelist

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 ?image

Not applicable

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