AnsweredAssumed Answered

Put results of a mysql query into DataList

Question asked by soulcollector on Oct 12, 2016
Latest reply on Oct 20, 2016 by soulcollector

Hello. I'm completely new to Alfresco, but i have a decent knowledge about MySQL databases and queries.

Using Alfresco Community, i have the following problem. The agency i'm working for has a customers database; it has these columns:

  • Name
  • Company
  • Birthdate
  • Customer since
  • Sector

 

What i should do is to load these in a dataList inside an Alfresco Site; plus, i need a sorting button, by free search or by standard values of columns; i need as well to make it able to add new rows to the table.

My problem is not with MySQL. I understood i need to create a new model like:

<?xml version='1.0' encoding='UTF-8'?>
<model name="acmedl:rubrica" xmlns="http://www.alfresco.org/model/dictionary/1.0">
  <description>Customer list</description>
  <author>Daniele Pani</author>
  <version>0.1</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 Data List Model Definitions -->
        <import uri="http://www.alfresco.org/model/datalist/1.0"   prefix="dl" />
    </imports>

  <namespaces>
        <namespace uri="http://www.company.org/model/datalist/0.1" prefix="acmedl"/>
    </namespaces>

  <types>
  <type name="acmedl:projectListItem">
  <title>Customer list for ACME AG</title>
  <parent>dl:dataListItem</parent>
  <properties>
  <property name="acmedl:company">
  <title>Company</title>
  <type>d:text</type>
                    <mandatory>true</mandatory>
  </property>
  <property name="acmedl:name">
  <title>Name</title>
  <type>d:text</type>
  <mandatory>true</mandatory>
  </property>
  <property name="acmedl:birthdate">
  <title>Birthdate</title>
  <type>d:date</type>
  <mandatory>true</mandatory>
  </property>
  <property name="acmedl:customersince">
  <title>Customer since</title>
  <type>d:date</type>
  <mandatory>true</mandatory>
     </property>
     <property name="acmedl:sector">
     <title>Sector</title>
     <type>d:text</type>
     <mandatory>true</mandatory>
     </property>
     </properties>
     </type>
     </types>
     </model>

Now, i didn't understand where to put this file. Using it inside Alfresco's panel, in the data dictionary, leads me to a dataList type creation, but random fields appear (date of creation, name, actions, etc...); bootstrapping it didn't work and prevented me to login even with right user/passord; plus i didn't find how to perform queries against the db and import them in this dataList.

Could you help me or tell me where to read something helpul about this? Thank you.

Outcomes