Importación de modelo de contenido

cancel
Showing results for 
Search instead for 
Did you mean: 
Shift
Active Member

Importación de modelo de contenido

Jump to solution

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 Solutions

Accepted Solutions
narkuss
Established Member II

Re: Importación de modelo de contenido

Jump to solution

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 solution in original post

Shift
Active Member

Re: Importación de modelo de contenido

Jump to solution
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 solution in original post

2 Replies
narkuss
Established Member II

Re: Importación de modelo de contenido

Jump to solution

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
Active Member

Re: Importación de modelo de contenido

Jump to solution
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.