cancel
Showing results for 
Search instead for 
Did you mean: 

Importación de modelo de contenido

Shift
Champ on-the-rise
Champ on-the-rise

He creado dos modelos de contenido A y B. Necesito importar el modelo A en el modelo B para poder crear una asociación entre un tipo de contenido de mi modelo B con uno del modela A.

Realizo la importación de la siguiente manera:

<imports>

<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>

<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>

<import uri="(URI DEFINIDA EN EL NAMESPACE AL CREAR EL MODELO A)" prefix="(PREFIJO DEFINIDO)"/>

</imports>

Al reiniciar me da el siguiente error:

org.alfresco.service.namespace.NamespaceException: URI (URI DEFINIDA EN EL NAMESPACE AL CREAR EL MODELO A) cannot be imported as it is not defined (with prefix (PREFIJO DEFINIDO)

En el bootstrap-context.xml estan definido de la siguiente forma

<bean id="cu.models.alfresco.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>
alfresco/module/mi_proyecto/models/A.xml
</value>
<value>
alfresco/module/mi_proyecto/models/B.xml
</value>
</list>
</property>
</bean>

Qué debo hacer para subsanar este error?

2 ACCEPTED ANSWERS

narkuss
Star Contributor
Star Contributor

I think you could make it work defining the models in two different beans. Say you give model A bean the id "cu.modelA" and model B bean the id "cu.modelB", then you must specify dependsOn="cu.modelB" in model A bean.

I don't know if that is the best option, but we got it to work this way, when importing a custom model from another module.

Hope it helps

View answer in original post

Shift
Champ on-the-rise
Champ on-the-rise
The solution was to put model B first and then model A in the bootstrap-context.xml, from the other firm model A was calling model B when it was not yet created.

View answer in original post

2 REPLIES 2

narkuss
Star Contributor
Star Contributor

I think you could make it work defining the models in two different beans. Say you give model A bean the id "cu.modelA" and model B bean the id "cu.modelB", then you must specify dependsOn="cu.modelB" in model A bean.

I don't know if that is the best option, but we got it to work this way, when importing a custom model from another module.

Hope it helps

Shift
Champ on-the-rise
Champ on-the-rise
The solution was to put model B first and then model A in the bootstrap-context.xml, from the other firm model A was calling model B when it was not yet created.