Re: [dba-dev] How to store formated text in OO base

2008-08-29 Thread Marc Santhoff
Am Donnerstag, den 28.08.2008, 18:39 +0200 schrieb Fernand Vanrie:
 Marc Santhoff wrote:
  Am Montag, den 25.08.2008, 16:47 +0200 schrieb Fernand Vanrie:

  don't know if this is shorter, but as I said you can store your 
  OO_source.odf into a stream and then read/write a blob field of your 
  database.

  OK, I was concerned about the size of the blob's  i will test it and 
  comback with the results and nobody seems to now ( on the forum at 
  least) how to get the stored binary data out of a database field  !!
  
 
  I think this could be caused by:
 
  http://extensions.openoffice.org/issues/show_bug.cgi?id=83449
 
  I don't know if the forum message is old enough, but nowadays (2.4.x)

 Thanks i hope it will been properly documented somwhere
 
 so no longer need off private:stream argument ?
 
 and
 
 'args1(2).Name = DocumentBaseURL
 'args1(2).Value = file:///h:/test.html
 
 is of no uses ?

See the macro attached to the issue, it has any answers needed.

  But there is still a problem with this styreams, Just the Retrieving of 
 a stream from a medium complex writerdoc  (2 pages) takes over 20 
 seconds from a OO-database doc!!
 
 Storing the stream (after a time consuming loading from the datbase) to 
 a tmpURL is  prety fast but very space consuming on the database site

Did you use a file on disk for streaming *to* the database? If you
managed to get anything else working I'd be keen to see some code. ;)

 I stay with my RTF or even HTML coded strings, far more simple more 
 speedy , and very economic in space :-)

Seems to be [a|the] sensible solution currently.

Regards,
Marc



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



Re: [dba-dev] How to store formated text in OO base

2008-08-29 Thread Fernand Vanrie

Hi marc,
Marc Santhoff wrote:

Am Donnerstag, den 28.08.2008, 18:39 +0200 schrieb Fernand Vanrie:
  

Marc Santhoff wrote:


Am Montag, den 25.08.2008, 16:47 +0200 schrieb Fernand Vanrie:
  
  
don't know if this is shorter, but as I said you can store your 
OO_source.odf into a stream and then read/write a blob field of your 
database.
  
  
OK, I was concerned about the size of the blob's  i will test it and 
comback with the results and nobody seems to now ( on the forum at 
least) how to get the stored binary data out of a database field  !!



I think this could be caused by:

http://extensions.openoffice.org/issues/show_bug.cgi?id=83449

I don't know if the forum message is old enough, but nowadays (2.4.x)
  
  

Thanks i hope it will been properly documented somwhere

so no longer need off private:stream argument ?

and

'args1(2).Name = DocumentBaseURL
'args1(2).Value = file:///h:/test.html

is of no uses ?



See the macro attached to the issue, it has any answers needed.

  
 But there is still a problem with this styreams, Just the Retrieving of 
a stream from a medium complex writerdoc  (2 pages) takes over 20 
seconds from a OO-database doc!!


Storing the stream (after a time consuming loading from the datbase) to 
a tmpURL is  prety fast but very space consuming on the database site



Did you use a file on disk for streaming *to* the database? If you
  
Yep, i isolate the needed textportion, put in a hidden doc , save and 
load the stream from the newly saved doc file.
This is acetable slowly, but retrieving the stored steream from the 
datbase is the most time consuming thing !
As i am not a prof coder , i looked around for getting a stream out off 
the clipboard or out off a Xtransferable object but no luckso far

For iamges we can get a stream from the internal storage
oPictures.getByName(mFiles(j)).getInputStream())

and then to store them directly in a doc i found this code :

 REM Author: Stephan Wunderlich. Two lines added by ms777 and completed 
by  Fernand

Dim oShape
Dim oProvider  'GraphicProvider service.
 oShape = oDoc.createInstance(com.sun.star.drawing.GraphicObjectShape)
oGraphic = oDoc.createInstance(com.sun.star.text.GraphicObject)
oDoc.getDrawPage().add(oShape)
oProvider = createUnoService(com.sun.star.graphic.GraphicProvider)
Dim oProps(0) as new com.sun.star.beans.PropertyValue
oProps(0).Name  = InputStream
oProps(0).Value =  oStream
' oProps(0).Name  = URL
' oProps(0).Value = sGraphicURL
oShape.Graphic = oProvider.queryGraphic(oProps())
oGraphic.GraphicUrl = oShape.GraphicUrl
' Insert at the current cursor location
oDOc.text.insertTextContent(oDoc.getCurrentController().getViewCursor(), 
oGraphic, false)



Maybe there is a more clever brain around who can get a stream out off 
the clibboard o a Xtranferable object ??


Thanks for your interest in this problem

Fernand

managed to get anything else working I'd be keen to see some code. ;)

  
I stay with my RTF or even HTML coded strings, far more simple more 
speedy , and very economic in space :-)



Seems to be [a|the] sensible solution currently.

Regards,
Marc



-
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]



Re: [dba-dev] How to store formated text in OO base

2008-08-28 Thread Marc Santhoff
Am Montag, den 25.08.2008, 16:47 +0200 schrieb Fernand Vanrie:
  don't know if this is shorter, but as I said you can store your 
  OO_source.odf into a stream and then read/write a blob field of your 
  database.
 OK, I was concerned about the size of the blob's  i will test it and 
 comback with the results and nobody seems to now ( on the forum at 
 least) how to get the stored binary data out of a database field  !!

I think this could be caused by:

http://extensions.openoffice.org/issues/show_bug.cgi?id=83449

I don't know if the forum message is old enough, but nowadays (2.4.x)
.insertDodumentFromUrl() should work using a stream.

HTH,
Marc



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



Re: [dba-dev] How to store formated text in OO base

2008-08-25 Thread Peter Eberlein

Peter Eberlein schrieb:

Hi,
Marc Santhoff schrieb:

Am Freitag, den 22.08.2008, 13:44 +0200 schrieb Fernand Vanrie:
Can hard coded or styled  formated text  out off a writer doc been 
stored in OO base and then been used to be placed in a new writerdoc.


- witch data type ?
- how to enter ?
- how to reproduce in a form ?


just tried to put the XTransferable in a formatted TextField without 
success.


The field doesn't support clipboard or transferable actions with 
formatted text. Worth an RFE?


Sub Main
xCurrentController = ThisComponent.CurrentController
xCursor = ThisComponent.getText.createTextCursor()
xCursor.gotoEnd(true)
xViewCursor = xCurrentController.getViewCursor
// make the selection
xViewCursor.gotoRange(xCursor,false)
xTransferable = xCurrentController.getTransferable

xTextField = Thiscomponent.DrawPage.Forms(0).getByName(TextBox)

xView = xCurrentcontroller.getControl(xTextField)
xView.setFocus
// pasting
xCurrentController.insertTransferable(xTransferable)

End Sub


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



Re: [dba-dev] How to store formated text in OO base

2008-08-25 Thread Fernand Vanrie

Marc and Peter,

Thanks for your responses,

Normally for copying images  and formated text portions from OO- docs 
or  non-OO documents I simply uses the uno:copy with the dispatcher. 
This  approach  works fine  I will now investigate  the XTransferable 
stuff for a suposed more cleaner code :-).

But I still has some questions:

- how do i Store Cliboard or XTransferable content in to the database ?
- how do i call it back from the base into the clibboard or in to a 
XTransferable object ?


When having the database content in the cliboard or a in a XTransferable 
object, then the missing off a proper Form Field can been resolved with 
showing the database content in a frame or Cell. and using a 
writerdoc as a form.


Thanks already for your help

Fernand


Peter Eberlein wrote:

Peter Eberlein schrieb:

Hi,
Marc Santhoff schrieb:

Am Freitag, den 22.08.2008, 13:44 +0200 schrieb Fernand Vanrie:
Can hard coded or styled  formated text  out off a writer doc been 
stored in OO base and then been used to be placed in a new writerdoc.


- witch data type ?
- how to enter ?
- how to reproduce in a form ?


just tried to put the XTransferable in a formatted TextField without 
success.


The field doesn't support clipboard or transferable actions with 
formatted text. Worth an RFE?


Sub Main
xCurrentController = ThisComponent.CurrentController
xCursor = ThisComponent.getText.createTextCursor()
xCursor.gotoEnd(true)
xViewCursor = xCurrentController.getViewCursor
// make the selection
xViewCursor.gotoRange(xCursor,false)
xTransferable = xCurrentController.getTransferable

xTextField = Thiscomponent.DrawPage.Forms(0).getByName(TextBox)

xView = xCurrentcontroller.getControl(xTextField)
xView.setFocus
// pasting
xCurrentController.insertTransferable(xTransferable)

End Sub


-
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]



Re: [dba-dev] How to store formated text in OO base

2008-08-25 Thread Frank Schönheit - Sun Microsystems Germany
Hi Peter,

 The field doesn't support clipboard or transferable actions with 
 formatted text. Worth an RFE?

Sure.

(Though I admit the thing I would want to fix before for this control is
the inability to store its content in a database field ...)

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer [EMAIL PROTECTED] -
- Sun Microsystems  http://www.sun.com/staroffice -
- OpenOffice.org Base   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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



Re: [dba-dev] How to store formated text in OO base

2008-08-25 Thread Fernand Vanrie

OK
I found a complex :-) solution using temp RTF files, but should works

select the formated text portion and put it in a new empty OO_source.odf.

save OO_source.odf  to  RTF_temp.rtf usng the RTF-Export Filter

Read with simpleFileAcces  the content of RTF_source.rtf  and  put it in 
a simple Varchar database field.


Put the content of f the VarChar field into a simple text  file with 
rtf extension


insert the text.rtf into the OO- doc using the RTF- ImportFilter


any ideas for shortening this process ?

Thanks anyway

Fernand

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



Re: [dba-dev] How to store formated text in OO base

2008-08-25 Thread Peter Eberlein

Hi Fernand,

Fernand Vanrie schrieb:

OK
I found a complex :-) solution using temp RTF files, but should works

select the formated text portion and put it in a new empty OO_source.odf.

save OO_source.odf  to  RTF_temp.rtf usng the RTF-Export Filter

Read with simpleFileAcces  the content of RTF_source.rtf  and  put it in 
a simple Varchar database field.


Put the content of f the VarChar field into a simple text  file with rtf 
extension


insert the text.rtf into the OO- doc using the RTF- ImportFilter


any ideas for shortening this process ?

don't know if this is shorter, but as I said you can store your 
OO_source.odf into a stream and then read/write a blob field of your 
database.


e.g. http://www.oooforum.org/forum/viewtopic.phtml?t=29434

Regards

Peter


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



[dba-dev] How to store formated text in OO base

2008-08-22 Thread Fernand Vanrie
Can hard coded or styled  formated text  out off a writer doc been 
stored in OO base and then been used to be placed in a new writerdoc.


- witch data type ?
- how to enter ?
- how to reproduce in a form ?

thanks for any hint

Fernand



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