[Kmkey-spanish] error al importar datos
Santi Camps
santicamps en gmail.com
Lun Jun 18 19:44:17 CEST 2012
Hola Hugo
Deberiad ejecutarlo desde el directorio del script
Saludos
El 18/06/2012 11:57, "Hugo Rodriguez" <hrodriguez.sv at gmail.com> escribió:
> Hola Albert!
> Después de hacer pruebas aun me sigue dando un error te lo muestro aquí
>
> zope at kmkeyPaill:/usr/local/kmkey/zope/bin$ ./zopectl run
> /usr/local/kmkey/source/current/KMKeyCore/utils/xmltokm3/import_from_xml.py
> quality_express_src /home/hrodriguez/testprov_.xml
> 2012-06-18 10:48:32 WARNING Zope OFS.Application: Duplicate Product
> name:After loading Product 'Five' from '/usr/local/kmkey/zope/Products',
> I skipped the one in '/usr/local/tools/zope/lib/python/Products'.
>
> Traceback (most recent call last):
> File "<string>", line 1, in ?
> File
> "/usr/local/kmkey/source/current/KMKeyCore/utils/xmltokm3/import_from_xml.py",
> line 3, in ?
> from ImporterFactory import ImporterFactory
> ImportError: No module named ImporterFactory
> zope at kmkeyPaill:/usr/local/kmkey/zope/bin$
>
> Desde que directorio debería de ejecutar la importación de los datos
>
>
> 2012/6/18 Hugo Rodriguez <hrodriguez.sv at gmail.com>
>
>> Gracias Albert!
>> Probare ahora ...
>>
>>
>> 2012/6/18 Albert Buyó <abuyo at earcon.com>
>>
>>> Hola Hugo, verás q el error , al final, te pone
>>> "ERROR. Objeto Sin portal type especificado {}"
>>>
>>> esto indica q alguno de los items no tiene especificado el atributo
>>> portal_type con un portal type correcto
>>>
>>> saludos
>>>
>>> Albert
>>>
>>> El 16/06/12, Hugo Rodriguez <hrodriguez.sv at gmail.com> escribió:
>>> > Hola Albert!
>>> > Despues deejecutar algunas la rutina de importacion de datos, me da los
>>> > soguientes errores:
>>> >
>>> > root at kmkeyPaill
>>> :/usr/local/kmkey/source/current/KMKeyCore/utils/xmltokm3#
>>> > /usr/local/kmkey/zope/bin/zopectl run import_from_xml.py
>>> > quality_express_src /home/zope/ProveedoresPaill.xml
>>> > 2012-06-15 14:01:12 WARNING Zope OFS.Application: Duplicate Product
>>> > name:After loading Product 'Five' from
>>> '/usr/local/kmkey/zope/Products',
>>> > I skipped the one in '/usr/local/tools/zope/lib/python/Products'.
>>> >
>>> > 2012-06-15 14:01:18 WARNING Zope OFS.Application: Duplicate Product
>>> > name:After loading Product 'Five' from
>>> '/usr/local/kmkey/zope/Products',
>>> > I skipped the one in '/usr/local/tools/zope/lib/python/Products'.
>>> >
>>> > 2012-06-15 14:01:18 WARNING Zope OFS.Application: Duplicate Product
>>> > name:After loading Product 'Five' from
>>> '/usr/local/kmkey/zope/Products',
>>> > I skipped the one in '/usr/local/tools/zope/lib/python/Products'.
>>> >
>>> > 2012-06-15 14:01:18 WARNING Zope OFS.Application: Duplicate Product
>>> > name:After loading Product 'Five' from
>>> '/usr/local/kmkey/zope/Products',
>>> > I skipped the one in '/usr/local/tools/zope/lib/python/Products'.
>>> >
>>> > 2012-06-15 14:01:18 WARNING Zope OFS.Application: Duplicate Product
>>> > name:After loading Product 'Five' from
>>> '/usr/local/kmkey/zope/Products',
>>> > I skipped the one in '/usr/local/tools/zope/lib/python/Products'.
>>> >
>>> > 2012-06-15 14:01:18 WARNING Zope OFS.Application: Duplicate Product
>>> > name:After loading Product 'Five' from
>>> '/usr/local/kmkey/zope/Products',
>>> > I skipped the one in '/usr/local/tools/zope/lib/python/Products'.
>>> >
>>> > 2012-06-15 14:01:18 WARNING Zope OFS.Application: Duplicate Product
>>> > name:After loading Product 'Five' from
>>> '/usr/local/kmkey/zope/Products',
>>> > I skipped the one in '/usr/local/tools/zope/lib/python/Products'.
>>> >
>>> > 2012-06-15 14:01:18 WARNING Zope OFS.Application: Duplicate Product
>>> > name:After loading Product 'Five' from
>>> '/usr/local/kmkey/zope/Products',
>>> > I skipped the one in '/usr/local/tools/zope/lib/python/Products'.
>>> >
>>> > /usr/local/kmkey/zope/Products/CMFCore/DirectoryView.py:428:
>>> UserWarning:
>>> > DirectoryView kmkey_project refers to a non-existing path
>>> > KMKeyProject/skins/kmkey_project
>>> > % (self.id, dirpath), UserWarning)
>>> > /usr/local/kmkey/zope/Products/CMFCore/DirectoryView.py:428:
>>> UserWarning:
>>> > DirectoryView demoiso_default refers to a non-existing path
>>> > demoisoDefault/skins/demoisoDefault
>>> > % (self.id, dirpath), UserWarning)
>>> > ERROR. Objeto Sin portal type especificado {}
>>> > Traceback (most recent call last):
>>> > File "<string>", line 1, in ?
>>> > File "import_from_xml.py", line 58, in ?
>>> > del importer
>>> > NameError: name 'importer' is not defined
>>> >
>>> >
>>> >
>>> > 2012/6/15 Hugo Rodriguez <hrodriguez.sv at gmail.com>
>>> >
>>> >> Hola Albert!
>>> >> Tengo los porveedores en una base de datos MSSQL.
>>> >> Como se llama el esquema del formato del archivo xml.
>>> >>
>>> >> Ya que generando el archvio xml me lo entrega de la siguente forma:
>>> >>
>>> >> <?xml version="1.0" encoding="iso-8859-15"?>
>>> >> <root>
>>> >> <Persongroup>
>>> >> <short_name>SV0001</short_name>
>>> >> <ident_value>33692-0</ident_value>
>>> >> <phone>2212466</phone>
>>> >> <fax>2211034</fax>
>>> >> <email>pentamed at salnet.net / pentame2 at sv.cciglobal.net</email>
>>> >> <addres1>Blvd. Venezuela No.1141 S.S. El Salvador</addres1>
>>> >> <province>San Salvador</province>
>>> >> <postal_code />
>>> >> <country>El Salvador</country>
>>> >> <contacts>Heriberto Argueta</contacts>
>>> >> <categories>provider</categories>
>>> >> <accounting_subaccount />
>>> >> <payment_method />
>>> >> <payment_conditions />
>>> >> <ccc />
>>> >> </Persongroup>
>>> >> </root>
>>> >>
>>> >> lo del nombre de la ruta del sitio debería de ser quality_express_src
>>> >>
>>> >> [image: Inline image 1]
>>> >>
>>> >>
>>> >> 2012/6/15 Albert Buyó <abuyo at earcon.com>
>>> >>
>>> >>> sí, exacto, portal_type kmkey_contact y los campos los q tienes en
>>> ese
>>> >>> patrón
>>> >>>
>>> >>> saludos
>>> >>>
>>> >>> Albert
>>> >>>
>>> >>> El 15/06/12, Hugo Rodriguez <hrodriguez.sv at gmail.com> escribió:
>>> >>> > Gracias Albert!
>>> >>> > Lo probare de esta forma.
>>> >>> > Una pregunta mas al respecto de las importaciones, en el archivo
>>> xml,
>>> >>> para
>>> >>> > importar contactos (usuarios), el portal_type es kmkey_contact, y
>>> los
>>> >>> > campos utilizados los que muestra el patrón Contacte?
>>> >>> >
>>> >>> > 2012/6/15 Albert Buyó <abuyo at earcon.com>
>>> >>> >
>>> >>> >> Hola Hugo, qué tal
>>> >>> >>
>>> >>> >> veo q estás ejecutando el script llamando a python2.4, se tiene
>>> que
>>> >>> >> hacer ejecuntando el zopctl run
>>> >>> >>
>>> >>> >> /usr/local/kmkey/zope/bin/zopectl run import_from_xml.py
>>> >>> >> /root/cliente.xml
>>> >>> >>
>>> >>> >> saludos
>>> >>> >>
>>> >>> >>
>>> >>> >>
>>> >>> >> El 15/06/12, Hugo Rodriguez <hrodriguez.sv at gmail.com> escribió:
>>> >>> >> > Hola Santi!
>>> >>> >> > En un correo anterior te pregunte como hacer para subir en forma
>>> >>> masiva
>>> >>> >> los
>>> >>> >> > datos de los clientes, grupos/empresa y me respodiste lo de este
>>> >>> correo
>>> >>> >> > abajo.
>>> >>> >> >
>>> >>> >> > Ahora bien, estoy haciendo la importación de los datos de la
>>> >>> siguiente
>>> >>> >> > forma:
>>> >>> >> > cd /usr/local/kmkey/zope/Products/KMKeyCore/utils/xmltokm3
>>> >>> >> > /usr/local/python2.4 import_from_xml.py /root/cliente.xml
>>> >>> >> > (usando zope y root como usuarios)
>>> >>> >> >
>>> >>> >> > pero me da un error, y es el siguiente:
>>> >>> >> >
>>> >>> >> > Traceback (most recent call last):
>>> >>> >> > File "import_from_xml.py", line 1, in ?
>>> >>> >> > from AccessControl.SecurityManagement import
>>> newSecurityManager
>>> >>> >> > ImportError: No module named AccessControl.SecurityManagement
>>> >>> >> >
>>> >>> >> > En espera de tus recomendaciones, Atentamente.
>>> >>> >> >
>>> >>> >> > --
>>> >>> >> >
>>> >>> >> > Atentamente.
>>> >>> >> >
>>> >>> >> > ______________________________________
>>> >>> >> > Hugo Rodriguez
>>> >>> >> >
>>> >>> >> >
>>> >>> >> >
>>> >>> >> > Hola
>>> >>> >> >
>>> >>> >> > La importación de datos funciona a base de documentos XML como
>>> el
>>> >>> >> > que
>>> >>> >> > te
>>> >>> >> > adjunto (un ejemplo de datos de clientes). Como ves casi
>>> todos
>>> >>> >> > los
>>> >>> >> > atributos corresponden con los campos del portal_schemas del
>>> >>> >> > patrón,
>>> >>> >> menos
>>> >>> >> > el porta_type que determina el patrón de trabajo a usar, y el
>>> UID
>>> >>> >> > que
>>> >>> >> debe
>>> >>> >> > ser un identificador único por objeto. El sistema recuerda las
>>> >>> >> > importaciones, de forma que al reimportar si el mismo UID ya ha
>>> >>> >> > sido
>>> >>> >> antes
>>> >>> >> > importado procede modificando los datos:
>>> >>> >> >
>>> >>> >> > Antes que nada, te recomiendo leer
>>> >>> >> >
>>> >>> >>
>>> >>>
>>> http://kmkey-es.blogspot.com.es/2011/09/formacion-para-administradores-los_12.html
>>> >>> >> > y
>>> >>> >> > descubrir la relación entre patrón de trabajo -> portal_type en
>>> ZMI
>>> >>> >> (acceso
>>> >>> >> > server:8083/manage) -> portal_schemas, ya que es básica para
>>> >>> >> > definir
>>> >>> >> > los
>>> >>> >> > XML's de importación de cada tipo de objetos
>>> >>> >> >
>>> >>> >> > El importador se encuentra
>>> >>> >> > en
>>> >>> >>
>>> /usr/local/kmkey/zope/Products/KMKeyCore/utils/xmltokm3/import_from_xml
>>> >>> >> > .py
>>> >>> >> >
>>> >>> >> > Saludos
>>> >>> >> > --
>>> >>> >> > Santi Camps
>>> >>> >> > KMKey hacker (http://www.kmkey.com)
>>> >>> >> > Earcon S.L. (http://www.earcon.com)
>>> >>> >> >
>>> >>> >> > 2012/5/30 Hugo Rodriguez <hrodriguez.sv at gmail.com>
>>> >>> >> >
>>> >>> >> >> Gracias por los tutoriales.
>>> >>> >> >>
>>> >>> >> >> Estaba viendo el TAB de equipo, ¿hay alguna forma para crear un
>>> >>> batch
>>> >>> >> >> y
>>> >>> >> >> hacer una carga de Grupos/Empresas de forma masiva?
>>> >>> >> >> Pregunto esto, por que cando veo las tablas en la base de
>>> datos de
>>> >>> >> >> quality_src, no encuentro la información en la tabla
>>> >>> >> >> kmkey_contact,
>>> >>> ya
>>> >>> >> >> que
>>> >>> >> >> se me ocurria hacer la carga directamente en la base de datos a
>>> >>> través
>>> >>> >> de
>>> >>> >> >> un archivo de texto.
>>> >>> >> >>
>>> >>> >> >> Gracias nuevamente.
>>> >>> >> >>
>>> >>> >> >>
>>> >>> >> >>
>>> >>> >> >> --
>>> >>> >> >
>>> >>> >> > Atentamente.
>>> >>> >> >
>>> >>> >> > ______________________________________
>>> >>> >> > Hugo Rodriguez
>>> >>> >> >
>>> >>> >>
>>> >>> >>
>>> >>> >> --
>>> >>> >> --
>>> >>> >> -----------------
>>> >>> >> Albert Buyó
>>> >>> >> Earcon S.L. - http://www.earcon.com
>>> >>> >> - http://www.kmkey.com
>>> >>> >>
>>> >>> >>
>>> >>> >
>>> >>> >
>>> >>> > --
>>> >>> >
>>> >>> > Atentamente.
>>> >>> >
>>> >>> > ______________________________________
>>> >>> > Hugo Rodriguez
>>> >>> >
>>> >>>
>>> >>>
>>> >>> --
>>> >>> --
>>> >>> -----------------
>>> >>> Albert Buyó
>>> >>> Earcon S.L. - http://www.earcon.com
>>> >>> - http://www.kmkey.com
>>> >>>
>>> >>>
>>> >>
>>> >>
>>> >> --
>>> >>
>>> >> Atentamente.
>>> >>
>>> >> ______________________________________
>>> >> Hugo Rodriguez
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> >
>>> > Atentamente.
>>> >
>>> > ______________________________________
>>> > Hugo Rodriguez
>>> >
>>>
>>>
>>> --
>>> --
>>> -----------------
>>> Albert Buyó
>>> Earcon S.L. - http://www.earcon.com
>>> - http://www.kmkey.com
>>>
>>>
>>
>>
>> --
>>
>> Atentamente.
>>
>> ______________________________________
>> Hugo Rodriguez
>>
>
>
>
> --
>
> Atentamente.
>
> ______________________________________
> Hugo Rodriguez
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://joinup.ec.europa.eu/mailman/archives/kmkey-spanish/attachments/20120618/3c3b6179/attachment-0001.html>
Más información sobre la lista de distribución Kmkey-spanish