cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Model in 2.9C not working

jlabuelo
Champ on-the-rise
Champ on-the-rise
Good Afternoon all

I am trying something in my MultyTenant  2.9C Alfresco configuration over my Windows XP machine. I have the nightly built from March 2008, and what I am trying to do is add a generic set of custom Types in the SuperAdmin (single tenant configuration) so all the tenants created over this configuration will have it, and then for each of the tenants I have a specialized set of types customized.

I mean I have two types  customized in my CustomModel.xml and my web-client-config-custom.xml which are in tomcat\shared\classes\alfresco\extension.

Then for each of the tenants I have created I have also created a CustomModel.xml and a web-client-config-custom.xml, with specialized types which can not be shared between them.

After reading the instructions about how the Dynamic Model configuration should be implemented, in each of the tenants, I have placed the CustomModel.xml  in the
Company Home -> Data Dictionary -> Models
space and the web-client-config-custom.xml in
Company Home -> Data Dictionary -> Web Client Extension
space.

At this moment I am getting error messages when starting the server, but I would like to know if what I am trying is possible before continuing with this test.

Regards
7 REPLIES 7

janv
Employee
Employee
At this moment I am getting error messages when starting the server, …

What error message are you seeing ? Have you tried the 2.9.0C-dev build available from: http://dev.alfresco.com/downloads/nightly/dist/

…but I would like to know if what I am trying is possible before continuing with this test.

Yes, it should be possible, although you may wish to upload the shared model into the super tenant data dictionary (rather than use the classpath). If you still see the same error message with the latest 2.9.0C-dev build then please raise a JIRA with steps to repeat and attach examples of your model definitions and client config.

Thanks,
Jan

jlabuelo
Champ on-the-rise
Champ on-the-rise
Hi Janv

I can confirm that the configuration using Dynamic Models does not work for us in 2.9.0C

We have created 4 example files, 2 customModel.xml and 2 web-cling-config-custom.xml, a couple of customModel.xml and web-client-config-custom.xml are stored in the Super Tenant Data Dictionary in the Models folder and in the Web Client Extension folder. This is because these files contain common files to all the tenants.

Then we have also created other 2 files (customModel.xml and web-client-config-custom.xml) files containing only types related to a tenant, so we have placed them in the tenant Data Dictionary also in Models and in Web Client Extension.

The problem is that by doing this, this way, we are not able to use the types at all (common and "types for tenant" ones), however if we place the customModel.xml and the web-client-config-custom.xml files in \tomcat\shared\classes\alfresco\extension they work ok and we are able to use the types.

In your last post you said I should raise a defect in Jira for this. I will do it right the way as this is quite important for us. We have the last nightly build

Please let us know what can be done, as if not in each of the tenants we have created we will have to include in the generic path the types, and the Advanced Search will be quite a mess  Smiley Sad

Thanks for your help in advance.

PS (We did not place any custom-model-context.xml file in any space, shall we do it? and if so, where????) thanks

jlabuelo
Champ on-the-rise
Champ on-the-rise
I have created a BUG ALFCOM-1765

janv
Employee
Employee
Thanks for the feedback and example test case.

Please note that a tenant-specific model will override a shared model that has the same name (in your case, "custom:customModel") by effectively replacing it. Similarly for web client config. Hence, if you wish to continue to expose the two common types ("custom:Localizacion" and "customSmiley Tongueropietario") within this particular tenant, then these will need to appear in your tenant-specific model and also be merged into your tenant-specific web client config. I made the changes locally and tested with 2.9.0C-dev, and this then works as expected. I will set the issue to resolved, pending further details.

Hope this helps.

Regards,
Jan

jlabuelo
Champ on-the-rise
Champ on-the-rise
Hi Janv

Thanks a lot for your quick response and help. If I understood correctly, if I want to have a common set of types and then for a set of tenants, I want to have a specialized set of types, I must introduce the first set of types in the super tenant Data Dictionary Models /Web Client Extension with a name (customModel.xml and web-client-custom-config.xml) and then in each tenant in the Data Dictionary – Models /Web Client Extension I can create another customModelTenant.xml and web-cilent-config-custom-Tenant.xml…. will it work this way???.

For example in the super Tenant Data Dictionary I have the web-client-custom-config.xml configured in the way that only Enligsh ad Spanish are the available languages and also the way the customSmiley Tongueropietario, custom:Localizacion types are defined, and then in the tenant I will have the customModelTenant.xml file with the specific types and the web-client-config-custom-Tenant.xml file

Will it work?? also, what about the web-client-custom-config.xml file in tomcat\shared\classes\alfresco\extension shall I remove it? and what about the custom-model-context.xml? do I need any (in path, supertenant data dictionary…, tenant data dictionary?)

I have tried just using the customModel.xml and web-client-config-custom.xml I have, in the tenant data dictionary, none in the path none in the super tenant but still did not get it to work… Could you detail me plesae where did you place (space names/file names) the files or how you did it?

Thanks a lot again

janv
Employee
Employee
In the case of dynamic web client config, you will need to upload a "web-client-config-custom.xml" (unless you change the "webClientConfigSource" in "web-client-application-context.xml").

http://wiki.alfresco.com/wiki/Dynamic_Models#Deploying_web_client_customisations

However, in the case of dynamic models, you can upload multiple models.

http://wiki.alfresco.com/wiki/Dynamic_Models#Deploying_and_activating_a_custom_model

So, you can either add the tenant-specific types into a new model (which is separate from the common model) or if you wish to override an existing model incrementally then you can add the tenant-specific types to a copy of the model. In the latter case, based on your example attached to ALFCOM-1765, you could:

1. as super tenant, upload "customModel_(common).xml" to Data Dictionary -> Models space, and remember to tick "Model Active" property in order to activate the model
2. as super tenant, upload "web-client-config-custom.xml" (renamed from web-client-config-custom(Common).xml") to Data Dictionary -> Web Client Extension space
3. as super tenant, access the web client config console and "reload" the client config, login and logout, and then add some content based on the new content types
4. edit "customModel(Tenant).xml" and add the 2 common types (copied from "customModel_(common).xml")
5. as tenant admin, upload "customModel(Tenant).xml" to Data Dictionary -> Models space, and remember to tick "Model Active" property in order to activate the model
6. edit "web-client-config-custom(Tenant).xml" and merge in the 2 common types (merged from "web-client-config-custom(Common).xml")
7. as tenant admin, upload "web-client-config-custom.xml" (renamed from "web-client-config-custom(Tenant).xml") to Data Dictionary -> Web Client Extension space
8. as tenant admin, access the web client config console and "reload" the client config, login and logout, and then add some content based on the common content types and/or tenant-specific content types

Hope this helps.

Regards,
Jan

muralie39
Champ on-the-rise
Champ on-the-rise
Thanks