cancel
Showing results for 
Search instead for 
Did you mean: 

Custom model: "name" and "namespace" restrictions. Config Properties: documentation need

mtsiak
Star Contributor
Star Contributor

We have recently created a custom model in alfresco: downloaded the 2.2.1 archetype and edited content-model.xml.

It took as some time to discover that

  • the prefix of a namespace can not contain underscore "_" character
  • the name of the model can not be "contentModel"

<model name="pr:contentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

...

</model>

Apologies, is these are not true, or/and documented somewhere.

One question is what alfresco classes parses the models in repository tier, and the alfresco-config in the share tier, so by reading the code we could correct further mistakes.

Meanwhile, in share, there are some configurations with properties like 'evaluator' and 'condition'

e.g. <config evaluator="node-type" condition="cm:content"> ...</config>

      <config evaluator="aspect" condition="pr:myAspectName">...</config>

and further properties

e.g.

force="true"

for-mode="edit" 

Where could we learn more about their usage?

Thanks in advance

2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator

There is no explicit code that disallows the underscore as a prefix. But functionality related to the Forms engine will encode the colon of a qualified name as an underscore when transporting it over the wire, as well as decode the first underscore as a colon. This causes issues when you consciously chose to use an underscore in the prefix. This can be seen in places such as QNameFieldProcessor or ContentModelFormProcessor.

I am unaware of any functionality that would interfere with naming a model xy:contentModel. I often use a name as simple as that. Or do you mean the name only be "contentModel" without a prefix? That would be invalid as name is typically required to be a qualified name (QName) - this is the same with name of properties, aspects and types.

mtsiak
Star Contributor
Star Contributor

Thank you for your reply. The suggested classed were helpful.

As far as the name, i meant it with the use of a prefix, e.g. pr:contentModel did not work, wheres pr:myNameModel worked.