Cannot Create Custom Data List

cancel
Showing results for 
Search instead for 
Did you mean: 
lawrence
Member II

Cannot Create Custom Data List

Hi All,

I am struggling to create a Custom Data List in Alfresco 5.1. I had tried following to the letter the following, among others:

http://docs.alfresco.com/5.1/references/dev-extension-points-data-lists.html

https://miblogtecnico.wordpress.com/tag/alfresco-custom-data-list/

However, when I try create the new Data List model it does not show in the drop-down list within the form. Also, if I try to stop and restart the servoce I get the following error message:

"An error has occured in the Share component: /share/service/components/dashlets/my-sites.

It responded with a status of 500 - Internal Error.

Error Code Information: 500 - An error inside the HTTP server which prevented it from fulfilling the request.

Error Message: 00200005 Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/components/dashlets/my-sites.get.js': 00200004 00200003 Failed during processing of IMAP server status configuration from Alfresco: 00200002 Unable to retrieve IMAP server status from Alfresco: 404

Server: Alfresco Spring WebScripts - v6.13.0 schema 1,000

Time: Jan 20, 2017 8:13:21 PM

Your request could not be processed at this time. Please contact your system administrator for further information."

It seems that the file triggering the error is the Context file.

This is all very frustrating because I am doing exactly what the above-mentioned pages say. Also, I am working on a completely new download and installation, and I have not done any configuring or customisation to it, so there should be no reason for the solutions not to work.

Many thanks for your help.

5 Replies
mitpatoliya
Moderator
Moderator

Re: Cannot Create Custom Data List

Could you please post your model and share-config-custom files which you have created for custom content model?

Any other error  in logs related to model or share-config? Above error seems to be kind of result of some other issue.

lawrence
Member II

Re: Cannot Create Custom Data List

Hi Mittal,

 

I am using the code from this tutorial:

https://miblogtecnico.wordpress.com/tag/tomcatsharedclassesalfrescoextension/

I am using it as is until it works, then I will create my own code as necessary.

 

First I created the model file as follows:

 

C:\alfresco-community\tomcat\shared\classes\alfresco\extension\ modelo_lista_FRA.xml

 

with the code:

 

<?xml version=”1.0″ encoding=”UTF-8″?>

 

<!– Definition of new Model –>

 

<model name=”fra:modeloFra” xmlns=”http://www.alfresco.org/model/dictionary/1.0″>

 

<!– Optional meta-data about the model –>

<description>Lista de datos Personalizada</description>

<author>Lawrence Attard</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”/>

<!– Import Alfresco Data List Model Definitions –>

<import uri=”http://www.alfresco.org/model/datalist/1.0″ prefix=”dl”/>

</imports>

 

<!– Introduction of new namespaces defined by this model –>

<namespaces>

<namespace uri=”fra.listadatos.com” prefix=”fra”/>

</namespaces>

 

<!– T Y P E D E F I N I T I O N S –>

<types>

<!– Data list defintions For this model go here –>

<type name=”fra:listaFra”>

<title>Lista de Facturas</title>

<description>Lista de Facturas</description>

<parent>dl:dataListItem</parent>

<properties>

<property name=”fra:fraID”>

<title>ID Factura</title>

<type>d:text</type>

<mandatory>true</mandatory>

</property>

<property name=”fra:fraCliente”>

<title>Cliente</title>

<type>d:text</type>

<mandatory>true</mandatory>

</property>

<property name=”fra:fraTotal”>

<title>Total Factura</title>

<type>d:text</type>

<mandatory>false</mandatory>

</property>

</properties>

 

<associations>

<association name=”fra:fraAnexo”>

<title>Anexos</title>

<source>

<mandatory>false</mandatory>

<many>true</many>

</source>

<target>

<class>cm:content</class>

<mandatory>false</mandatory>

<many>true</many>

</target>

</association>

</associations>

</type>

</types>

</model>

 

 

Then I created the context file as:

 

C:\alfresco-community\tomcat\shared\classes\alfresco\extension\ modelo_lista_FRA-context.xml

 

with the code:

 

<?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.fra.dictionaryBootstrap” parent=”dictionaryModelBootstrap” depends-on=”dictionaryBootstrap”>

<property name=”models”>

<list>

<value>alfresco/extension/modelo_lista_FRA.xml</value>

</list>

</property>

</bean>

 

</beans>

 

 

Then I amended the shared-config-custom file:

 

C:\alfresco-community\tomcat\shared\classes\alfresco\web-extension\ shared-config-custom.xml

 

by inserting the following code between the two configuration tags of the file (<alfresco-config> and </ alfresco-config>):

 

<!– Lista de datos Facturas –>

 

<config evaluator=”model-type” condition=”fra:listaFra”>

<forms>

<!– Create item form –>

<form>

<field-visibility>

<!– for the form creation we are showing everything except approved date –>

<show id=”fra:fraID” />

<show id=”fra:fraCliente” />

<show id=”fra:fraTotal” />

<show id=”fra:fraAnexo” />

</field-visibility>

<create-form template=”/org/alfresco/components/data-lists/forms/dataitem.ftl” />

<appearance>

<field id=”fra:fraCliente”>

<control template=”/org/alfresco/components/form/controls/textarea.ftl” />

</field>

 

<field id=”fra:fraTotal”>

<control template=”/org/alfresco/components/form/controls/textarea.ftl” />

</field>

<field id=”fra:fraAnexo”>

<control>

<control-param name=”startLocation”>{doclib}</control-param>

</control>

</field>

</appearance>

</form>

 

<!– Data Grid view –>

<form id=”datagrid”>

<field-visibility>

<show id=”fra:fraID” />

<show id=”fra:fraCliente” />

<show id=”fra:fraTotal” />

<show id=”fra:Anexo” />

</field-visibility>

</form>

</forms>

</config>

 

<!– Edit view –>

<config evaluator=”node-type” condition=”fra:listaFra”>

<forms>

<!– Edit marketing item form –>

<form>

<field-visibility>

<show id=”fra:fraID” />

<show id=”fra:fraCliente” />

<show id=”fra:fraTotal” />

<show id=”fra:fraAnexo” />

</field-visibility>

<create-form template=”/org/alfresco/components/data-lists/forms/dataitem.ftl” />

<appearance>

<field id=”fra:fraCliente”>

<control template=”/org/alfresco/components/form/controls/textarea.ftl” />

</field>

 

<field id=”fra:fraTotal”>

<control template=”/org/alfresco/components/form/controls/textarea.ftl” />

</field>

<field id=”fra:fraAnexo”>

<control>

<control-param name=”startLocation”>{doclib}</control-param>

</control>

</field>

</appearance>

 

</form>

</forms>

</config>

 

 

Thanks in advance for your help.

 

Regards,

 

Lawrence

lawrence
Member II

Re: Cannot Create Custom Data List

Hi Mittal,

I managed to create the custom data lists I need. However, one problem remains: I am getting fields that I do not want, i.e. meta-data such as Date Created, Creator and Accessed Date. I am entering the appropriate code for the forms and data grid view in alfresco/web-extension/share-config-custom, but it seems that this file is not loading at all.

Any ideas please?

Many thanks,

Lawrence

hardik1512
Established Member II

Re: Cannot Create Custom Data List

Make sure that file name is share-config-custom.xml  and NOT shared-config-custom.xml.

In your above replies somewhere it is mentioned as shared-config-custom.xml.

shashank_tyagi
Member II

Re: Cannot Create Custom Data List

Hi Lawrence,

I am facing the issue

"An error has occured in the Share component: /share/service/components/dashlets/my-sites.

It responded with a status of 500 - Internal Error.

As you said you managed to create custom data listcan you please provide the solution.

Thanks,

Shashank