Re: [api-dev] Finding the complete OOo version with API ?

2006-04-10 Thread Marc Santhoff
Am Montag, den 10.04.2006, 13:31 +0200 schrieb Bernard Marcelly:
 Hi all,
 Successives minor versions of 2.0 are not only correcting bugs, they 
 also introduce features.
 With API you can read ooSetupVersion from 
 /share/registry/data/org/openoffice/Setup.xcu
 The problem is it returns 2.0 for any minor version, i.e. you cannot 
 distinguish 2.0.0 from 2.0.1 or 2.0.2.
 My question is : can the API provide the exact version of OpenOffice ? 
 or will it be available in ooSetupVersion with the next versions, e.g. 
 2.0.3 ?

Seems to be a bug to me, with 1.x.x it did report the complete version
number.

HTH,
Marc


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



Re: [api-dev] Unpacked - MediaDescriptor - Not Working?!

2006-04-10 Thread Kent Gibson
do you mind elaborating on this?

this is basically what I am doing:

However the Unpacked parameter just seems to be
ignored.

ByteArrayOutputStream byteOut = new
ByteArrayOutputStream( 1 );
OutputStreamToXOutputStreamAdapter unoOut = new
OutputStreamToXOutputStreamAdapter( byteOut );

PropertyValue[] storeArgs = { new PropertyValue(
OutputStream, //$NON-NLS-1$ 
  
-1, unoOut, PropertyState.DIRECT_VALUE ) };
connection.getDocument()
   .storeToURL( private:stream,
storeArgs ); //$NON-NLS-1$

// Wrap filled byte array into UNO input stream and
load new document from it
ByteArrayInputStream unoIn = new ByteArrayInputStream(
byteOut.toByteArray() );
PropertyValue[] loadArgs =
OpenOfficeCoreUtils.addPropertyValue( args,
  
 new PropertyValue( InputStream,
//$NON-NLS-1$
  
   -1, unoIn,
  
  
PropertyState.DIRECT_VALUE ) );

   

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [api-dev] Unpacked - MediaDescriptor - Not Working?!

2006-04-10 Thread Kent Gibson
oops I sent the wrong code, but I reckon you mean that
I should be using a reference to a directory not a
file no?

--- Kent Gibson [EMAIL PROTECTED] wrote:

 do you mind elaborating on this?
 
 this is basically what I am doing:
 
 However the Unpacked parameter just seems to be
 ignored.
 
 ByteArrayOutputStream byteOut = new
 ByteArrayOutputStream( 1 );
 OutputStreamToXOutputStreamAdapter unoOut = new
 OutputStreamToXOutputStreamAdapter( byteOut );
 
 PropertyValue[] storeArgs = { new PropertyValue(
 OutputStream, //$NON-NLS-1$ 
 
  
 -1, unoOut, PropertyState.DIRECT_VALUE ) };
 connection.getDocument()
.storeToURL( private:stream,
 storeArgs ); //$NON-NLS-1$
 
 // Wrap filled byte array into UNO input stream and
 load new document from it
 ByteArrayInputStream unoIn = new
 ByteArrayInputStream(
 byteOut.toByteArray() );
 PropertyValue[] loadArgs =
 OpenOfficeCoreUtils.addPropertyValue( args,
 
  
  new PropertyValue( InputStream,
 //$NON-NLS-1$
 
  
-1, unoIn,
 
  
   
 PropertyState.DIRECT_VALUE ) );
 

 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam
 protection around 
 http://mail.yahoo.com 
 

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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [api-dev] Unpacked - MediaDescriptor - Not Working?!

2006-04-10 Thread Marc Santhoff
Am Montag, den 10.04.2006, 05:12 -0700 schrieb Kent Gibson:
 oops I sent the wrong code, but I reckon you mean that
 I should be using a reference to a directory not a
 file no?

Check chapter 14 of the developers guide about the Universal Content
Broker, the target UCP has to support folders. A stream does not. The
data from the document is sent out as multiple streams, as I had to
learn, too.

I think your goal of writing a document to a stream is reachable by
creating your own export filter component, which has to take care of
concatenating the streams or the like. 

You can check yourself: rename a OO.o-document to name.zip and open or
list with your favourite packing tool. You'll see several files
(=streams) located in several folders (not supported by streams).

HTH,
Marc


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



Re: [api-dev] Unpacked - MediaDescriptor - Not Working?!

2006-04-10 Thread Kent Gibson
wow, so to write an unpacked format I will have to
write an export and import filter, or use the UCP?
Seems like overkill? Did you do something similiar
with  UCP? I looked at the demo code and it seems to
like file urls, and my document is in memory, so I
wonder if the UCP will work for me. I wonder why the
Unpacked  parameters is there.

Thanks for the help. If you have some snippets doing
something similiar to what I want that would be grand.
The truth is that I am just trying to squeeze some
performance, and this might not even work. I am
rendering a document which takes a minute and then 2
minutes to presumably compress (loads of redundant
data). 

--- Marc Santhoff [EMAIL PROTECTED] wrote:

 Am Montag, den 10.04.2006, 05:12 -0700 schrieb Kent
 Gibson:
  oops I sent the wrong code, but I reckon you mean
 that
  I should be using a reference to a directory not a
  file no?
 
 Check chapter 14 of the developers guide about the
 Universal Content
 Broker, the target UCP has to support folders. A
 stream does not. The
 data from the document is sent out as multiple
 streams, as I had to
 learn, too.
 
 I think your goal of writing a document to a stream
 is reachable by
 creating your own export filter component, which has
 to take care of
 concatenating the streams or the like. 
 
 You can check yourself: rename a OO.o-document to
 name.zip and open or
 list with your favourite packing tool. You'll see
 several files
 (=streams) located in several folders (not supported
 by streams).
 
 HTH,
 Marc
 
 

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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [api-dev] Unpacked - MediaDescriptor - Not Working?!

2006-04-10 Thread Marc Santhoff
Am Montag, den 10.04.2006, 06:36 -0700 schrieb Kent Gibson:
 wow, so to write an unpacked format I will have to
 write an export and import filter, or use the UCP?
 Seems like overkill? 

You are already using UCB/P, storing a document makes use of a
com.sun.star.ucb.FileContentProvider as I understand it.

 Did you do something similiar
 with  UCP? I looked at the demo code and it seems to
 like file urls, and my document is in memory, so I
 wonder if the UCP will work for me. I wonder why the
 Unpacked  parameters is there.

Because it works with most precanned UCPs (file, WebDAV, ftp, hirarchy,
zip/jar). ;)

 Thanks for the help. If you have some snippets doing
 something similiar to what I want that would be grand.

No, I haven't. Sorry.

 The truth is that I am just trying to squeeze some
 performance, and this might not even work. I am
 rendering a document which takes a minute and then 2
 minutes to presumably compress (loads of redundant
 data). 

If you can stand losing macros embedded in documents there's a chance
that making a flat xsl filter work. Most common stuff is this:

?xml version=1.0 encoding=ISO-8859-1?

xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; 
version=1.0
xsl:output method=xml encoding=UTF-8/
xsl:template match=/
xsl:copy-of select=/ /
/xsl:template

/xsl:stylesheet

You can register it for writing and reading (Menu: Tools - XML Filter
Settings) and then use save as to select it in the type combo box. At
least for testing the performance advantage it may be helpful.

Have you tried saving uncompressed to an ordinary file system? This
would be easy, somthing like (BASIC, written from memory):

snip
fname = /where/you/like/yourdoc

dim Args(2) as new com.sun.star.beans.PropertyValue
' not sure atm if it's necessary for standard format ...
' args(2).Name = FilterName
' args(2).Value = OpenOffice.org 1.0 Text Document
args(1).Name = Overwrite
args(1).Value = TRUE
args(0).Name = Unpacked
args(0).Value = TRUE
doc.storeAsUrl(ConvertToUrl(fname), args())
' or storeToUrl for making a copy like when exporting

This will create a folder hirarchy like the one in the zip but
uncompressed an unarchived. The last name component (yourdoc) is the
base folder.

HTH,
Marc
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

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



Re: [api-dev] Calc: loading file with key-shortcuts .sxc v/.ods

2006-04-10 Thread Ennio-Sr
* Mathias Bauer [EMAIL PROTECTED] [090406, 17:47]:
 Ennio-Sr wrote:
 [...] 
 My recommendation would be to use the template mechanism: create a
 document template that contains the configuration you want to have:
 create a new document, store the shortcut configuration into it 
 
This was the hardest part for me to understand until Bart sent me that
'private' post and suggested me to download a few of his examples: these
were very useful, but I still have to master them!

 and then
 save this document with File-Templates-Save.
 
 Then create all new documents that should use this shortcut
 configuration from this template using File-New-Templates and Documents.
 

I'll take advantage of your suggestions.
Thank you again, Mathias, and have my best regards.
Ennio

-- 
[Perche' usare Win$ozz (dico io) se ...anche uno sciocco sa farlo.   \\?//
 Fa' qualche cosa di cui non sei capace!  (diceva Henry Miller) ](°|°)
[Why use Win$ozz (I say) if ... even a fool can do that.  )=(
 Do something you aren't good at! (as Henry Miller used to say) ]

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



Re: [api-dev] Unpacked - MediaDescriptor - Not Working?!

2006-04-10 Thread Kent Gibson
thanks for the pointers.

I tried the basic code, and no unpacked directory was
created. I am starting to think this is a bug. hmm.
odd. I also tried some of the existing filters with
the unpacked paramaters, no go. I guess I will try the
other stuff later.

take care.

--- Marc Santhoff [EMAIL PROTECTED] wrote:

 Am Montag, den 10.04.2006, 06:36 -0700 schrieb Kent
 Gibson:
  wow, so to write an unpacked format I will have to
  write an export and import filter, or use the UCP?
  Seems like overkill? 
 
 You are already using UCB/P, storing a document
 makes use of a
 com.sun.star.ucb.FileContentProvider as I
 understand it.
 
  Did you do something similiar
  with  UCP? I looked at the demo code and it seems
 to
  like file urls, and my document is in memory, so
 I
  wonder if the UCP will work for me. I wonder why
 the
  Unpacked  parameters is there.
 
 Because it works with most precanned UCPs (file,
 WebDAV, ftp, hirarchy,
 zip/jar). ;)
 
  Thanks for the help. If you have some snippets
 doing
  something similiar to what I want that would be
 grand.
 
 No, I haven't. Sorry.
 
  The truth is that I am just trying to squeeze some
  performance, and this might not even work. I am
  rendering a document which takes a minute and then
 2
  minutes to presumably compress (loads of redundant
  data). 
 
 If you can stand losing macros embedded in documents
 there's a chance
 that making a flat xsl filter work. Most common
 stuff is this:
 
 ?xml version=1.0 encoding=ISO-8859-1?
 
 xsl:stylesheet
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; 
 version=1.0
   xsl:output method=xml encoding=UTF-8/
   xsl:template match=/
   xsl:copy-of select=/ /
   /xsl:template
 
 /xsl:stylesheet
 
 You can register it for writing and reading (Menu:
 Tools - XML Filter
 Settings) and then use save as to select it in the
 type combo box. At
 least for testing the performance advantage it may
 be helpful.
 
 Have you tried saving uncompressed to an ordinary
 file system? This
 would be easy, somthing like (BASIC, written from
 memory):
 
 snip
 fname = /where/you/like/yourdoc
 
 dim Args(2) as new com.sun.star.beans.PropertyValue
 ' not sure atm if it's necessary for standard format
 ...
 ' args(2).Name = FilterName
 ' args(2).Value = OpenOffice.org 1.0 Text Document
 args(1).Name = Overwrite
 args(1).Value = TRUE
 args(0).Name = Unpacked
 args(0).Value = TRUE
 doc.storeAsUrl(ConvertToUrl(fname), args())
 ' or storeToUrl for making a copy like when
 exporting
 
 This will create a folder hirarchy like the one in
 the zip but
 uncompressed an unarchived. The last name
 component (yourdoc) is the
 base folder.
 
 HTH,
 Marc
 -- 
 A: Because it messes up the order in which people
 normally read text.
 Q: Why is top-posting such a bad thing?
 A: Top-posting.
 Q: What is the most annoying thing on usenet and in
 e-mail?
 

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


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



[api-dev] [EMAIL PROTECTED] REQUEST: unanswered questions

2006-04-10 Thread Michael Hoennig
Dear OpenOffice.org community,

We really would like to see all questions answered, but
we need your help to keep track of your questions and their
answer status.  Thus, if you still have a question unanswered
for more than two days, feel free to place a reminder on the
list.  But maybe you should think about simplifying your
question, strip down your code example etc.

I'd like to remind that this mailinglist is not a support 
forum. We core developers like to see all questions answered,
but we cannot do your work.  Thus, even though some background
information can be helpful, phrase your question as easy as 
possible to us and focus on the OOo API rather then your 
application.

Juergen+Andreas

-- 
http://api.openoffice.org

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



[api-dev] Making Live Spreadsheets: Can OOo connect to an XML feed

2006-04-10 Thread Alexandro Colorado
Is it possible to make a live spreadsheet, meaning that the content of the  
cells are provided by a live XML feed from an APi. The  idea is to have  
stock charts/currency exchange/ and/or pricing of products directly  
inserted into a Calc spreadsheet and users can add calculation to this  
live objects such as graph a yield or update their price to their local  
currency automatically.


Internet -- XML Feed --- OOoMacro -- Live Spread Sheet

My first question will be if the XML can be register as a DataSource,  
which protocol to use so OOo can identify it as a datasource, second will  
be how to use the XML parser that OOo includes (SAX?) from the Macro API  
and finally can this connection be mantain as permanent or should it be  
required every x seconds.


First idea is that hdbsql is close to this question because of its native  
XML method of storage. OOo should at some point parse the information to  
be included into the widgetery.


The parser should be available somewher around the com.sun.star.xml and  
the registry could be on a fetch array function within the scripting  
framework to finally be inserted into a cell.


Am I ignoring something I should also be aware? Any answer to the previous  
doubts about best way to connect and parse?


--
Alexandro Colorado
CoLeader of OpenOffice.org ES
http://es.openoffice.org

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