To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=65317





------- Additional comments from [EMAIL PROTECTED] Wed May 17 06:03:29 -0700 
2006 -------
I open OOo connexion with a socket, if you want how I do this, go :
http://www.oooforum.org/forum/viewtopic.phtml?t=35602
First, I open the original document (odt), I change the properties of the fields
(databasename and datatablename), and I save it.
After, I call mailmerge service like this : 

Object mmservice = null;

        // Create an instance of the MailMerge service
        try
        {
            XMultiComponentFactory mxMCF = OOo.getMxMCF();
            XComponentContext xComponentContext = OOo.getMxComponentContext();
            mmservice =
mxMCF.createInstanceWithContext("com.sun.star.text.MailMerge", 
xComponentContext);
            if (mmservice == null)
            {
                FichierLog.ecrire("OOoFusion.realiserFusion", "mmservice null",
"I");
                throw new OOoComponentException("OOoFusion.realiserFusion", "0",
"mmservice null", "fr");
            }
        }
        catch (Exception e)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "Exception - " +
e.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0", "Exception -
" + e.getMessage(), "fr");
        }

        // Get the XPropertySet interface of the mmservice object
        XPropertySet oObjProps = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, mmservice);
        if (oObjProps == null)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "oObjProps null", 
"I");
            throw new OOoComponentException("OOoFusion.realiserFusion", "0",
"oObjProps null", "fr");
        }

        try
        {
            // Set up the properties for the MailMerge command
            oObjProps.setPropertyValue("DataSourceName", mDataSourceName);

            oObjProps.setPropertyValue("Command", mTableName);

            oObjProps.setPropertyValue("CommandType", new
Integer(com.sun.star.sdb.CommandType.TABLE));

            oObjProps.setPropertyValue("OutputType", new Short((short) 2));

            oObjProps.setPropertyValue("DocumentURL", mFileURL);

            oObjProps.setPropertyValue("OutputURL", repEnvoi);

            oObjProps.setPropertyValue("FileNamePrefix", nomFichierEnvoi);

            
oObjProps.setPropertyValue("ActiveConnection",cxDB.getXConnection());

            if (typeEnvoi.equalsIgnoreCase("pdf"))
            {
                // generation document au format pdf
                oObjProps.setPropertyValue("SaveFilter", "writer_pdf_Export");
            }
            else if (typeEnvoi.equalsIgnoreCase("doc"))
            {
                oObjProps.setPropertyValue("SaveFilter", "MS Word 97");
            }

            if (nbFichiersGeneres.equalsIgnoreCase("1"))
            {
                // generation d'un seul document
                oObjProps.setPropertyValue("SaveAsSingleFile", new 
Boolean(true));
            }
            else
            {
                oObjProps.setPropertyValue("SaveAsSingleFile", new 
Boolean(false));
            }

        }
        catch (UnknownPropertyException e1)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion",
"UnknownPropertyException - " + e1.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"UnknownPropertyException - " + e1.getMessage(), "fr");
        }
        catch (PropertyVetoException e1)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "PropertyVetoException
- " + e1.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"PropertyVetoException - " + e1.getMessage(), "fr");
        }
        catch (IllegalArgumentException e1)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion",
"IllegalArgumentException - " + e1.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"IllegalArgumentException - " + e1.getMessage(), "fr");
        }
        catch (WrappedTargetException e1)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion",
"WrappedTargetException - " + e1.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"WrappedTargetException - " + e1.getMessage(), "fr");
        }

        // Get XJob interface from MailMerge service and call execute on it
        XJob job = (XJob) UnoRuntime.queryInterface(XJob.class, mmservice);
        if (job == null)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "job null", "I");
            throw new OOoComponentException("OOoFusion.realiserFusion", "0",
"job null", "fr");
        }   

        try
        {
            Boolean res = (Boolean) job.execute(new NamedValue[0]);
            return res.booleanValue();
        }
        catch (IllegalArgumentException e3)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion",
"IllegalArgumentException - " + e3.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0",
"IllegalArgumentException - " + e3.getMessage(), "fr");
        }
        catch (Exception e3)
        {
            FichierLog.ecrire("OOoFusion.realiserFusion", "Exception - " +
e3.getMessage(), "E");
            throw new OOoException("OOoFusion.realiserFusion", "0", "Exception -
" + e3.getMessage(), "fr");
        }

When I do this in a loop, nearly thousands times, OOo can't save the result file
. OOo run a widget with an error who say that "style.xml or
content.xml can't be saved". After that, the document is corrupt and OOo is in
an error state.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to