Problème d'ajout de nouveaux types de documents
![lodacom lodacom](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 05:50 AM
- Labels:
-
Archive
![mfcp mfcp](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 09:25 AM
Il y a quelques erreurs, notamment pour le chemin des dossiers:
Je te propose d'essayer ce code. Dis toi que tu peux avoir un seul fichier avec le suffixe -context.xml et un seul: web-client-config-custom.xml
mais autant de model que tu veux dépendant du nombre de type de document que tu as.
models-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> <!–Registration of new models –> <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap"> <property name="models"> <list> <value>alfresco/extension/model/scModel.xml</value> </list> </property> </bean></beans>
scModel.xml (à placer dans le dossier model):
<?xml version="1.0" encoding="UTF-8"?><!–Definition of new Model –><model name="sc:somecomodel" xmlns="http://www.alfresco.org/model/dictionary/1.0"><!–Optional metadata about the model –><description>Someco Model</description><author>Moi</author><version>1.0</version><!–Imports are required to allow references to definitions in other models–><imports> <!–Import Alfresco Dictionary Definitions –> <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" /> <!–Import Alfresco Content Domain Model Definitions –> <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" /></imports><!–Introduction of new namespaces defined by this model –><namespaces> <namespace uri="http://www.someco.com/model/content/1.0" prefix="sc" /></namespaces><types><!–Enterprisewide generic document type –> <type name="sc:doc"> <title>Someco Document</title> <parent>cm:content</parent> <associations> <association name="sc:relatedDocuments"> <title>Related Documents</title> <source> <mandatory>false</mandatory> <many>true</many> </source> <target> <class>sc:doc</class> <mandatory>false</mandatory> <many>true</many> </target> </association> </associations> <mandatory-aspects> <aspect>cm:generalclassifiable</aspect> </mandatory-aspects> </type> <type name="sc:whitepaper"> <title>Someco Whitepaper</title> <parent>sc:doc</parent> </type></types><aspects> <aspect name="sc:webable"> <title>Someco Webable</title> <properties> <property name="sc:published"> <type>d:date</type> </property> <property name="sc:isActive"> <type>d:boolean</type> <default>false</default> </property> </properties> </aspect> <aspect name="sc:productRelated"> <title>Someco Product Metadata</title> <properties> <property name="sc:product"> <type>d:text</type> <mandatory>true</mandatory> </property> <property name="sc:version"> <type>d:text</type> <mandatory>true</mandatory> </property> </properties> </aspect></aspects></model>
webclient-config-custom.xml:
Il faut placer le code ci-dessous entre les balises <alfresco-config> et </alfresco-config>:
<config evaluator="string-compare" condition="Content Wizards"> <content-types> <type name="sc:doc" /> <type name="sc:whitepaper" /> </content-types></config><!–add webable aspect properties to property sheet –><config evaluator="aspect-name" condition="sc:webable"> <property-sheet> <show-property name="sc:published" display-label-id="published"/> <show-property name="sc:isActive" display-label-id="isActive" read-only="true" /> <show-association name="sc:relatedDocuments" /> </property-sheet></config><config evaluator="aspect-name" condition="sc:productRelated"> <property-sheet> <show-property name="sc:product" display-label-id="product"/> <show-property name="sc:version" display-label-id="version" readonly="true" /> <show-association name="sc:relatedDocuments" /> </property-sheet></config><config evaluator="string-compare" condition="Action Wizards"><!–The list of aspects to show in the add/remove features action –><!–and the has-aspect condition –> <aspects> <aspect name="sc:webable"/> <aspect name="sc:productRelated"/> </aspects><!–The list of types shown in the issubtype condition –> <subtypes> <type name="sc:doc" /> <type name="sc:whitepaper" /> </subtypes><!–The list of content and/or folder types shown in the specialisetype action –> <specialise-types> <type name="sc:doc" /> <type name="sc:whitepaper" /> </specialise-types></config><config evaluator="string-compare" condition="Advanced Search"> <advanced-search> <content-types> <type name="sc:doc" /> <type name="sc:whitepaper" /> </content-types> <custom-properties> <meta-data aspect="sc:webable" property="sc:published" display-label-id="published" /> <meta-data aspect="sc:webable" property="sc:isActive" display-label-id="isActive" /> <meta-data aspect="sc:productRelated" property="sc:product" display-label-id="product" /> <meta-data aspect="sc:productRelated" property="sc:version" display-label-id="version" /> </custom-properties> </advanced-search></config>
![lodacom lodacom](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 09:30 AM
![lodacom lodacom](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 09:44 AM
![mfcp mfcp](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 09:52 AM
En fait, tu sais quoi, vide complétement le web-client-config-custom.xml, rajoute les 2 balises avec le code que je t'ai écrit à l'intérieur:
<alfresco-config>
<!– Ici le code –>
</alfresco-config>
![lodacom lodacom](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 09:56 AM
![mfcp mfcp](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 09:57 AM
![lodacom lodacom](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 10:05 AM
![mfcp mfcp](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 10:11 AM
Je pense à 2 soucis potentiels mais il y a très peu de chance que ce soit ça:
-tu as un autre fichier qui termine par -context.xml
-models-context.xml existe déja dans le core d'alfresco (models étant un nom assez commun) donc il faudrait changer le nom.
Du coup, par précaution, vérifie si tu n'as pas d'autre fichier -context.xml dans ton dossier extension. Il n'en faut qu'un seul pour tout les modèles.
Modifie le nom du dossier par ce nom: someco-model-context.xml
![lodacom lodacom](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 10:16 AM
wcm-bootstrap-context.xml
example-model-context.xml
Je fais quoi de ces fichiers?
Après sinon j'ai que des -context.xml.sample je suppose que ça compte pas.
![lodacom lodacom](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2011 10:19 AM
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'><!– This file enables Alfresco WCM. It should be placed in shared/classes/extension –><beans> <!– Patch in the WCM folders for the Authoring Environment Adds WCM Forms and WCM Projects –> <bean id="patch.wcmFolders" class="org.alfresco.repo.admin.patch.impl.WCMFoldersPatch" parent="basePatch" > <property name="id"><value>patch.wcmFolders</value></property> <property name="description"><value>patch.wcmFolders.description</value></property> <property name="fixesFromSchema"><value>0</value></property> <property name="fixesToSchema"><value>${version.schema}</value></property> <property name="targetSchema"><value>10000</value></property> <!– helper beans for execution –> <property name="messageSource"> <ref bean="bootstrapSpacesMessageSource" /> </property> <property name="importerBootstrap"> <ref bean="spacesBootstrap" /> </property> </bean> <!– Bootstrap the WCM Deployment Receiver Subsystem –> <bean id="wcm_deployment_receiver" class="org.alfresco.repo.management.subsystems.ChildApplicationContextFactory" parent="abstractPropertyBackedBean"> <property name="autoStart"> <value>true</value> </property> </bean> <!– Patch bean to add the "WCM Deployed" space to the company home folder –> <bean id="patch.wcmDeployed" class="org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch" parent="basePatch" > <property name="id"><value>patch.wcmDeployed</value></property> <property name="description"><value>patch.wcmDeployed.description</value></property> <property name="fixesFromSchema"><value>0</value></property> <property name="fixesToSchema"><value>${version.schema}</value></property> <property name="targetSchema"><value>10000</value></property> <!– bootstrap view –> <property name="importerBootstrap"> <ref bean="spacesBootstrap" /> </property> <property name="checkPath"> <value>/${spaces.company_home.childname}/${spaces.wcm_deployed.childname}</value> </property> <property name="bootstrapView"> <props> <prop key="path">/${spaces.company_home.childname}</prop> <prop key="location">alfresco/bootstrap/deployedSpace.xml</prop> <prop key="messages">alfresco/messages/bootstrap-spaces</prop> </props> </property> </bean></beans>
<?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>
Respectivement pour le premier et le deuxième.
![](/skins/images/A90266AC6EB1934BC937DAFB2842964E/responsive_peak/images/icon_anonymous_message.png)