cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to add [...] to the list of folder types as the prefix can not be resolved

yago
Champ in-the-making
Champ in-the-making
Hi

I've been reading different entries of the blog with this problem, but I couldn't solve mine . The thing Is that I'm trying to define a type folder , so, at the moment I enter in 'create space wizard' , at point two '2. Space options', It may be possible to select my type of folder . I have defined the following files …

[tomcat-path]/shared/classes/alfresco/extension/ajvModel.xml


<?xml version="1.0" encoding="UTF-8"?>

<!– Modelo personalizado –>

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

   <imports>
      <!– Importamos definiciones de Alfresco, concetamente el diccionario de datos y el modelo de contenido de Alfresco –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
   </imports>

   <!– Registramos el namespace que se usara en este modelo –>
   <namespaces>
      <namespace uri="ajv.model" prefix="ajv" />
   </namespaces>

   <!– Definicion de los tipos de datos personalizados –>
   <types>
      <!– Definicion del tipo de contenido Nombre –>
      <type name="ajv:carpeta">
         <title>Carpeta de proyecto</title>
         <parent>cm:folder</parent>
         <properties>
            <!– Propiedad de nombre–>
            <property name="ajv:nombre">
               <title>Nombre</title>
               <type>d:text</type>
            </property>
            
            <!– Primer apellido –>
            <property name="ajv:primerApellido">
               <title>Primer apellido</title>
               <type>d:text</type>
            </property>
            
            <!– Segundo apellido –>
            <property name="ajv:segundoApellido">
               <title>Segundo apellido</title>
               <type>d:text</type>
            </property>
            
            <!– Documento NIF –>
            <property name="ajv:documentoNif">
               <title>Documento NIF</title>
               <type>d:text</type>
            </property>
            
            <!– Puesto –>
            <property name="ajv:puesto">
               <title>Puesto</title>
               <type>d:text</type>
            </property>
            
            <!– Comunidad autonoma –>
            <property name="ajv:comunidadAutonoma">
               <title>Comunidad autonoma</title>
               <type>d:text</type>
            </property>
            
            <!– Provincias –>
            <property name="ajv:provincias">
               <title>Provincias</title>
               <type>d:text</type>
            </property>
         </properties>
      </type>
   </types>
   
   <aspects>
      <!– Definicion de los aspectos personalizados –>
   </aspects>
</model>


[tomcat-path]/shared/classes/alfresco/extension/ajvModel-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
   <!– Registro de los nuevos modelos –>
   <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/ajvModel.xml</value>
            </list>
        </property>
    </bean>
</beans>


[tomcat-path]/shared/classes/alfresco/extension/web-client-config-custom.xml

<alfresco-config>
… commented code …
<config condition="Content Wizards" evaluator="string-compare">
      <content-types>
         <type name="co:TipoCompany"/>
         <type name="co:TipoNoCompany"/>
         <type name="co:TipoPublicacion"/>
         <type name="co:TipoFactura"/>
         <type name="co:TipoCalidad"/>
         <type name="co:TipoPG"/>
         <type name="co:TipoPRAE"/>
         <type name="co:TipoPNT"/>
         <type name="co:TipoRCAEQuimica"/>
         <type name="co:TipoRCAEMicrobiologia"/>
      </content-types>
   </config>
… commented code …
<config evaluator="string-compare" condition="Space Wizards">
      <folder-types>
         <type name="ajv:carpeta"/>
      </folder-types>
   </config>

</alfresco-config>



But when I arrive to the wizard, and try to create an space folder, I get the following error …

[bean.spaces.CreateSpaceWizard] Failed to add 'ajv:carpeta' to the list of folder types as the prefix can not be resolved

and the type folder I'm trying to define is not appearing .

I have review that the three files are in the same folder, but eventhough, I continue having the same message . Is there something left ? what am I missing ?

Best regards
Yago

7 REPLIES 7

abarisone
Star Contributor
Star Contributor
Hi,
but why did you put all your extemsions under tomcat/shared?
I install my extensions as a module and they are finely found under
tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\<myModuleName>

So it seems that you're putting your files in the wrong position, since most configuration files are put under
tomcat\webapps\alfresco\WEB-INF\classes\alfresco


Regards,
Andrea

yago
Champ in-the-making
Champ in-the-making
Sorry, I'm quite newbie in alfresco . I'm reaing the following tutorial (http://conesoft.blogspot.com.es/2008/11/mini-gua-creacin-de-tipos-de-contenido.html) and It explicits that you should put the files in … '..\shared\classes\alfresco\extension' . It's for the original web page of alfresco . I haven't create modules .

abarisone
Star Contributor
Star Contributor
Ok,
try this tutorial http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Step_1:_Create_a_new_Model
Did you restart your server in order to make your modifications effective?

Regards,
Andrea

yago
Champ in-the-making
Champ in-the-making
Sorry, but even the tutorial was good, it doesn't helped me . I have put the files where it says …

TOMCAT_HOME/shared/classes/alfresco/extension

my files are the following . The difference with the tutorial is that the parent is <parent>cm:folder<parent>

[TOMCAT_HOME]shared/classes/alfresco/extension/ajvModel.xml

<?xml version="1.0" encoding="UTF-8"?>

<!– Modelo personalizado –>

<model name="ajv:modeloPersonalizado" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   
   <description>Ejemplo de creacion de carpeta</description>
   <author></author>
   <version>1.0</version>

   <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" />
   </imports>

   <!– Registramos el namespace que se usara en este modelo –>
   <namespaces>
      <namespace uri="modelo.personalizado" prefix="ajv" />
   </namespaces>

   <!– Definicion de los tipos de datos personalizados –>
   <types>
      <type name="ajv:carpeta">
         <title>Carpeta de proyecto</title>
         <parent>cm:folder</parent>
         <properties>
            <property name="ajv:nombre">
               <title>Nombre</title>
               <type>d:text</type>
            </property>
            <property name="ajv:primerApellido">
               <title>Primer apellido</title>
               <type>d:text</type>
            </property>
         </properties>
      </type>
   </types>
</model>


[TOMCAT_HOME]shared/classes/alfresco/extension/ajvModel-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
   <!– Registro de los nuevos modelos –>
   <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/ajvModel.xml</value>
            </list>
        </property>
    </bean>
</beans>


and in [TOMCAT_HOME]shared/classes/alfresco/extension/web-client-config-custom.xml


<config evaluator="string-compare" condition="Space Wizards">
      <folder-types>
         <type name="ajv:carpeta" description="folder shown" display-label="Mega folder"/>
      </folder-types>
   </config>



And still getting the same error …

WARN  [bean.spaces.CreateSpaceWizard] Failed to add 'ajv:carpeta' to the list of folder types as the prefix can not be resolved

I have tried to execute the part for testing the model (org.alfresco.repo.dictionary.TestModel), but I get that it hasn't been found or loaded the principal class org.alfresco.repo.dictionary.TestModel .

When I restart the server I got no errors .

It's a bit nightmare this error, and I'm sure it's the most stupid thing of the world .

kaynezhang
World-Class Innovator
World-Class Innovator
You namespace format is wrong ,your namespace should be like this

   <namespaces>
      <namespace uri="http://www.yourcompany.com/model/content/1.0" prefix="ajv"/>
   </namespaces>

instead of like this

<code>
   <namespaces>

      <namespace uri="modelo.personalizado" prefix="ajv" />

   </namespaces>
<code>

yago
Champ in-the-making
Champ in-the-making
Thanks kaynezhang . I have tested what you propose but still failing . I don't think changing the format will help . I don't have the model there . I'm just testing in my personal laptop .

What I have discovered is that in ajv-model-context.xml, if I do a mistake in the format, the server complains, but in ajv-model.xml, no . So, I think is a problem with the path 'alfresco/extension/ajv-model.xml', because the server is not reading that info . I'll keep investigating . Thanks to everybody.

yago
Champ in-the-making
Champ in-the-making
Ok, it's solved . As I though, in ajv-model-comtext.xml there was a problem with the path . He wasn't finding … alfresco/extension/ajv-model.xml (The xml where the bean was defined) . I had to change the value of the id of the bean in that file to bean id="extension.ajv.dictionaryBootstrap" instead of bean id="extension.dictionaryBootstrap" (ajv was the prefix of the namespace in ajv-model.xml … <namespace uri="http://www.mimacom.com/model/content/1.0" prefix="ajv"/>).

Thanks to everybody, and I hope this can help someone .