Page 1 of 1

Doubt connect to Database

PostPosted:Tue Jun 27, 2017 4:40 pm
by flakopaisa
Good morning, I'm new to Openkm and my English is not good.

I have a database with health entities, this DB is called entidad.

When I am creating the propierty groups I have:
Code: Select all
select $entidad from DatabaseMetadataValue dmv where dmv.table='entidad' and lower(dmv.$entidad) like '%{0}%' order by dmv.$entidad
but when I run the metadata don't appers data.

and when run OKMScanner doesn't run the field entidad.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE property-groups PUBLIC "-//OpenKM//DTD Property Groups 2.0//EN"
                                 "http://www.openkm.com/dtd/property-groups-2.0.dtd">
<property-groups>
      <property-group label="Envios" name="okg:envios">
    <input label="Numero Envio" type="text" name="okp:envios.numero_envio"/>
    <input label="Fecha Envio" type="date" name="okp:envios.fecha_envio" />
   <select label="Quién Radica?" name="okp:envios.persona_radica" type="simple">
      <option label="Lina Murillo" value="Lina Murillo" />
      <option label="Valentina Grisales" value="Valentina Grisales" />
          </select>
          <suggestbox label="Provincia" name="okp:envios.entidad" width="200px"
   table="entidad" dialogTitle="Seleccionar la entidad" filterMinLen="3"
   filterQuery="select $entidad from DatabaseMetadataValue dmv where dmv.table='entidad' and lower(dmv.$entidad) like '%{0}%' order by dmv.$entidad "
   valueQuery=" select $entidad from DatabaseMetadataValue dmv  where dmv_table='entidad' " /> 
  </property-group>
  </property-groups>

Re: Doubt connect to Database

PostPosted:Thu Jun 29, 2017 8:47 pm
by jllort
Read this section https://docs.openkm.com/kcenter/view/ok ... adatatable

Ensure you have inserted correct values into OKM_DB_METADATA_TYPE and OKM_DB_METADATA_VALUE.
From Database query , you should be able to list the values of this new metadata table definition ( you have three options in the select, jddbc, hibernate and metadata, choose the last ). If all is right from this point of view, check the xml definition again , might be is something wrong.

At least with a quick review in your queries, see that in our samples we select two values ( label and value ) and in your select you are only selecting a single value, that is wrong sure.

Re: Doubt connect to Database

PostPosted:Sat Jul 01, 2017 3:30 am
by flakopaisa
Thanks,