share-config-custom.xml not working

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

share-config-custom.xml not working

share-config-custom.xml not working

I've successfully created a custom content model in Alfresco but I can't manage to view the type name in Share.

I'm using archetype sdk 2.2.0 

I'm follwinf jeff pots tutorial... but even following step by step his tutorial and doing exactly the same whitepaper and marketing document all i can do is get a working content model but nothing on share.

Thanks you for any help

This is my share\src\main\resources\META-INF\share-config-custom.xml file

<!-- Share configuration related to this particular Share module extension, such as: - Doclib action config - Form config - Aspect and Type config Note.
Any configuration related to the whole Share.war webapp (i.e. not specific to this share extension) should be placed in the environment specific config:
alfresco/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml file -->
<alfresco-config>
<!-- Document Library config section -->
<config evaluator="string-compare" condition="DocumentLibrary">
</config>

<types>
<type name="myca:mycaDocument">
<subtype name="myca:squadra" />
<subtype name="myca:giocatore" />
<subtype name="myca:trofeo" />
</type>
</types>
</alfresco-config>

And this is the working content model

<?xml version="1.0" encoding="UTF-8"?>
<model name="myca:campionato" xmlns="http://www.alfresco.org/model/dictionary/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.alfresco.org/model/dictionary/1.0 https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS/5.1.e/root/projects/repos..."><!-- Optional meta-data about the model -->
<description>Campionato di calcio</description>
<author>Riccardo Arzenton</author>
<version>1.0</version>

<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" />
<!-- Import Alfresco System Model Definitions -->
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
</imports>


<namespaces>
<namespace uri="http://www.campionato.com/model/campionato/calcio/1.0" prefix="myca" />
</namespaces>

<constraints>
<constraint name="myca:campionatoList" type="LIST">
<parameter name="allowedValues">
<list>
<value>Serie A</value>
<value>Premier League</value>
<value>La Liga</value>
<value>Bundesliga</value>
</list>
</parameter>
</constraint>
</constraints>


<types>

<!-- Tipo documento di base -->
<type name="myca:mycaDocument">
<title>Documento Generico Campionato</title>
<description>Tipo documento di base del Campionato</description>
<parent>cm:content</parent>
<properties>
<property name="myca:uiVisibleProperties">
<title>Proprietà visibili</title>
<description>Proprietà visibili in interfaccia</description>
<type>d:qname</type>
<mandatory>true</mandatory>
<multiple>true</multiple>
<index enabled="false"></index>
</property>
</properties>
<!-- <associations /> -->
<!-- <overrides /> -->
<!-- <mandatory-aspects /> -->
</type>

<type name="myca:squadra">
<title>Squadra</title>
<description>Squadra</description>
<parent>myca:mycaDocument</parent>
<properties>
<property name="myca:nomesquadra">
<title>Nome Squadra</title>
<description>Nome Squadra</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="myca:annofondazione">
<title>Anno Fondazione</title>
<description>Descrizione breve</description>
<type>d:int</type>
<mandatory>false</mandatory>
</property>
<property name="myca:campionato">
<title>Campionato</title>
<description>Campionato</description>
<type>d:text</type>
<mandatory>false</mandatory>
<multiple>false</multiple>
<constraints>
<constraint ref="myca:campionatoList" />
</constraints>
</property>
<property name="myca:nazione">
<title>Nazione</title>
<description>Nazione</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="myca:citta">
<title>Città</title>
<description>Città</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>
<associations>
<association name="myca:squadragiocatori">
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>myca:giocatore</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
<association name="myca:squadratrofei">
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>myca:trofeo</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
<type name="myca:giocatore">
<title>Giocatore</title>
<description>Giocatore</description>
<parent>myca:mycaDocument</parent>
<properties>
<property name="myca:nomegiocatore">
<title>Nome</title>
<description>Nome</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="myca:cognomegiocatore">
<title>Cognome</title>
<description>Cognome</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="myca:datanascita">
<title>Data di Nascita</title>
<description>Data di Nascita</description>
<type>d:date</type>
<mandatory>false</mandatory>
</property>
<property name="myca:nazionalita">
<title>Nazionalità</title>
<description>Nazionalità</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>
</type>
<type name="myca:trofeo">
<title>Trofeo</title>
<description>Trofeo</description>
<parent>myca:mycaDocument</parent>
<properties>
<property name="myca:nometrofeo">
<title>Nome Trofeo</title>
<description>Nome Trofeo</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="myca:annotrofeo">
<title>Anno Trofeo</title>
<description>Anno Trofeo</description>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>
</type>
</types>
</model>

1 Reply
douglascrp
Advanced II

Re: share-config-custom.xml not working

Hello.

You have an invalid xml, as you are closing the config section and then trying to put more sections inside of it.

Try this one instead:

<!-- Share configuration related to this particular Share module extension, such as: - Doclib action config - Form config - Aspect and Type config Note.
Any configuration related to the whole Share.war webapp (i.e. not specific to this share extension) should be placed in the environment specific config:
alfresco/tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml file -->

<alfresco-config>
<!-- Document Library config section -->
<config evaluator="string-compare" condition="DocumentLibrary">
<types>
<type name="myca:mycaDocument">
<subtype name="myca:squadra" />
<subtype name="myca:giocatore" />
<subtype name="myca:trofeo" />
</type>
</types>
</config>
</alfresco-config>

The line 14 in my version was in the line 7 in yours.