cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic models - one more question

amenel
Champ in-the-making
Champ in-the-making
Hi,
I have been trying to grab how dynamic models work under Alfresco. And before the question is asked, here is the answer: yes, I did read the wiki page at http://wiki.alfresco.com/wiki/Dynamic_Models.

What I understood is that dynamic models are supposed to be taken into account, without restarting the webapp or the server, as soon as you drop a correctly written xml file in "Data Dictionary > Models" and check its "model active" checkbox. However, I can't create a content of a type defined in the model file: I get a message in red reading "java.lang.IllegalArgumentException: Class {<namespace_uri>}<class_name> has not been defined in the data dictionary"…

I need to stop Tomcat and restart it before I can create the content, which doesn't change much from putting the file in shared/classes/alfresco/extension with the appropriate "*-context.xml" file. Was this intended ? It does not really reflect what I would associate with "dynamic" and ends up being more frustrating than practical. I guess the content types in the model file are not written to the database when activating the model while, at content creation time, the DB is queried for the content type.

My question: is that one shutdown/startup cycle a part of the normal behavior ? or have I missed a step ?
5 REPLIES 5

janv
Employee
Employee
What I understood is that dynamic models are supposed to be taken into account, without restarting the webapp or the server, as soon as you drop a correctly written xml file in "Data Dictionary > Models" and check its "model active" checkbox.

Yes, that's how it should work (ie. without a restart). Can you please confirm exact version/build/env that you're using and also attach a copy of your custom content model ?

Thanks,
Jan

amenel
Champ in-the-making
Champ in-the-making
Thanks for the reply. I tested on 2.9B Community, 3.0Labs, 3.1Labs.

I work for BlueXML, an Alfresco partner, who offers S-IDE, an IDE aimed at sustainable development via model-driven architectures. One element of S-IDE is a graphical editor that allows the user (me in this instance) to design a model of the content types they would like to achieve under Alfresco (types, names, properties, text labels, etc.). However, the process is easier than writing the whole xml files since another element, the generator, takes care of producing the appropriate files (model xml file, messages and web client configuration, amongst other files). The generator also has an option that can use the dynamic models feature: the files are dropped where they fit.

Our only hurdles now are: 1- having to restart the server and 2- the web client not finding the messages set in webclient.properties.

How do I attach files to my post ?

janv
Employee
Employee
If you are a partner then I recommend that you contact Alfresco Support (and raise ticket via http://support.alfresco.com). They can help you to upload files, verify your test case(s) and then log a detailed JIRA, as appropriate.

In the case of "webclient.properties", please make sure that you add it to "Data Dictionary -> Web Client Extension" (rather than "Data Dictionary -> Messages") and then logout / login.

Thanks,
Jan

amenel
Champ in-the-making
Champ in-the-making
Ok, we'll get in touch with the support.
Yes, webclient.properties and web-client-config-custom.xml are both in 'Web Client Extension', model.xml is in 'Models' and a model.properties is dropped in 'Messages'.
Thank you, Jan.

janv
Employee
Employee
FYI, https://issues.alfresco.com/jira/browse/AR-2205 was fixed after Labs 2.9. I would recommend that you test your dynamic model against the latest Enterprise 3.1.0 release (and also Labs 3.2 preview).

Thanks,
Jan