Exemplo n.º 1
0
    def _asDict(self):
        """
    Gets the dict representation of the object
    """
        # Use OFS exportXML to first export to xml
        f = StringIO()
        XMLExportImport.exportXML(self._p_jar, self._p_oid, f)

        # Get the value of exported XML
        xml_value = f.getvalue()
        return xmltodict.parse(xml_value)
Exemplo n.º 2
0
    def fromJSON(self, val):
        """
    Updates an object, based on a JSON representation
    """
        dict_value = json.loads(val)

        # Convert the dict_value to XML representation
        xml_value = xmltodict.unparse(dict_value)

        f = StringIO(xml_value)
        return XMLExportImport.importXML(self._p_jar, f)
Exemplo n.º 3
0
def export_object_to_xml(ob, fp):
    XMLExportImport.exportXML(ob._p_jar, ob._p_oid, fp)
def import_object_from_xml(where, fp):
    return XMLExportImport.importXML(where._p_jar, fp)
Exemplo n.º 5
0
def import_object_from_xml(where, fp):
    return XMLExportImport.importXML(where._p_jar, fp)