cancel
Showing results for 
Search instead for 
Did you mean: 

Working with Custom Content Types

benoit
Champ in-the-making
Champ in-the-making
Bonjour,


Je tente de customisé mes metadonnées en suivant les  tutoriaux Anglophone dispo sur le wiki.


J'ai deux points qui reste obsure.

1)Faut-il modifier le fichier core-services-context.xml et ajouter une ligne dans la section <!– Content models –>?
Par exemple
<value>alfresco/extension/exampleModel.xml</value>

2) je ne vois pas ce qu'il faut indiqué dans la section <namespaces> de mon fichier exampleModel.xml?
43 REPLIES 43

bch
Champ in-the-making
Champ in-the-making
Bonjour,

Tu dois définir un fichier de contexte qui te permettra de dire que tu dois intégrer ton nouveau modèle. Il doit terminer par context.xml. Voici un exemple :


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

<beans>
    <!– Registration of new models –>
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/test.xml</value>
            </list>
        </property>
      <property name="labels">
            <list>
                <value>alfresco/extension/model</value>
            </list>
        </property>
    </bean>
</beans>

Tu vas définir ton (ou tes) namespace. Par exemple :


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

L'URI doit être unique et le prefixe doit correspondre au préfixe que tu utilises dans le nom de ton modèle.

benoit
Champ in-the-making
Champ in-the-making
J'ai bien cree un fichier exampleModel-context.xml dans C:\alfresco\tomcat\shared\classes\alfresco\extension

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

<beans>

    <!– Registration of new models –>   
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/exampleModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>


Il ne faut donc rien rajouter dans core-services-context.xml???

Pour namespace j'ai mis
<namespace uri="http://localhost:8080/model/content/1.0"" prefix="my"/>

bch
Champ in-the-making
Champ in-the-making
Ce fichier de contexte peut contenir d'autres informations mais voici la base.

Le namespace n'a rien à voir avec l'adresse à laquelle on accède à Alfresco. Celà peut être le nomde votre société ou association. Celà sert d'identifiant. Le préfixe est un raccourci pour éviter de répéter cette URI partout.

benoit
Champ in-the-making
Champ in-the-making
merci

et pour le fichier  core-services-context.xml dois-je le modifier ou non?

bch
Champ in-the-making
Champ in-the-making
Vous n'avez rien à ajouter pour l'instant pour une configuration simple dans ce fichier.

benoit
Champ in-the-making
Champ in-the-making
merci

je n'ai pas de message d'erreur, mais je ne vois pas de changement dans mon alfresco? :?:

bch
Champ in-the-making
Champ in-the-making
Avez vous configuré votr client web pour proposer la possibilité de créer votre nouveau type ?

benoit
Champ in-the-making
Champ in-the-making
non, je pense que c'est une excellente suggestion. Smiley Very Happy

benoit
Champ in-the-making
Champ in-the-making
ne parvenant toujours pas a faire fonctionner l'exemple, je reviens a la charge.

1)La liste des fichiers à creer/modifier se limite bien a ceci?

- exampleModel.xml
- example-model-context.xml
- web-client-config-custom.xml

2) La traduction francaise des metadonnées ne se trouve dans aucun fichier .xml??? Cela a t'il un rapport?