|
List Info
Thread: DocumentInfo: Wrong documentation, broken functionality or PEBKAC?
|
|
| DocumentInfo: Wrong documentation,
broken functionality or PEBKAC? |

|
2007-02-02 05:38:59 |
Hi *,
I got some trouble with the DocumentInfo's properties.
file:///opt/openoffice.org2.1_sdk/docs/common/ref/com/sun/st
ar/document/DocumentInfo.html
http://api.openoffice.org/docs/
common/ref/com/sun/star/document/DocumentInfo.html
The properties I can query don't match those that are listed
in the
reference.
I originally tried in Java, but I get the same results when
using Basic.
Try the following macro:
sub docinfoprops()
Dim props() as Variant
oDoc = ThisComponent
oText = oDoc.getText()
xprops = oDoc.getDocumentInfo()
xpsi = xprops.getPropertySetInfo()
props = xpsi.getProperties()
for i = 0 To UBound(props)
oText.InsertString(oCursor, "Prop " & i
& " " & props(i).Name , false)
oinspect = xprops.getPropertyValue(props(i).Name) ' can
watch this...
oText.insertControlCharacter(oCursor,
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
next
print "Done"
end sub
You'll get 33 Properties, but not all are listed in the
docs, and you don't get
all that are listed in the docs.
(look e.g. for the "Language" property listed in
the docs. It is not
available. Instead you got a property
"CharLocale")
But the trouble doesn't stop here. Some properties cannot be
retrieved.
You get an empty/void object instead.
So while you can use
oText.InsertString(oCursor, ": " &
xprops.getPropertyValue("CreationDate").Year ,
false)
to get the Year-field from the DateTime struct, you cannot
use
oText.InsertString(oCursor, ": " &
xprops.getPropertyValue("CharLocale").Language ,
false)
to get the Language field from the Locale struct, since it
doesn't
return a struct, but an empty object.
Is the problem my understanding of the whole thing? (please
direct me to
my error/show me how I would do this properly)
Is the problem the documentation? Is the problem in the
functionality of
the Office?
ciao
Christian
--
NP: Helmet - Ironhead
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: DocumentInfo: Wrong documentation,
broken functionality or PEBKAC? |

|
2007-02-02 06:40:32 |
Hi,
some remarks inserted in your message...
Message de Christian Lohmaier date 2007-02-02 12:38 :
> Hi *,
>
> I got some trouble with the DocumentInfo's properties.
>
file:///opt/openoffice.org2.1_sdk/docs/common/ref/com/sun/st
ar/document/DocumentInfo.html
> http://api.openoffice.org/docs/
common/ref/com/sun/star/document/DocumentInfo.html
>
> The properties I can query don't match those that are
listed in the
> reference.
>
> I originally tried in Java, but I get the same results
when using Basic.
>
> Try the following macro:
> sub docinfoprops()
> Dim props() as Variant
> oDoc = ThisComponent
> oText = oDoc.getText()
>
> xprops = oDoc.getDocumentInfo()
> xpsi = xprops.getPropertySetInfo()
> props = xpsi.getProperties()
>
> for i = 0 To UBound(props)
> oText.InsertString(oCursor, "Prop " &
i & " " & props(i).Name , false)
> oinspect = xprops.getPropertyValue(props(i).Name) '
can watch this...
> oText.insertControlCharacter(oCursor,
com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
> next
>
> print "Done"
> end sub
>
> You'll get 33 Properties, but not all are listed in the
docs, and you don't get
> all that are listed in the docs.
I get 31 properties in a Writer or Calc document.
You can read them easily in Basic with Xray macro.
Xray thisComponent.DocumentInfo
>
> (look e.g. for the "Language" property listed
in the docs. It is not
> available. Instead you got a property
"CharLocale")
Language is documented but does not exist.
CharLocale is not documented in DocumentInfo page, and does
not exist in
DocumentInfo object.
CharLocale is directly accessible (with Basic) from the
document itself.
> Is the problem the documentation? Is the problem in the
functionality of
> the Office?
>
Documentation is incorrect. See Issue 26672 created nearly 3
years ago.
Regards
Bernard
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: DocumentInfo: Wrong documentation,
broken functionality or PEBKAC? |

|
2007-02-02 07:38:02 |
Hi Bernard, *,
On Fri, Feb 02, 2007 at 01:40:32PM +0100, Bernard Marcelly
wrote:
> Message de Christian Lohmaier date 2007-02-02 12:38 :
> >
> >I got some trouble with the DocumentInfo's
properties.
>
>file:///opt/openoffice.org2.1_sdk/docs/common/ref/com/su
n/star/document/DocumentInfo.html
> >http://api.openoffice.org/docs/
common/ref/com/sun/star/document/DocumentInfo.html
> >
> >The properties I can query don't match those that
are listed in the
> >reference.
> >[...]
> >You'll get 33 Properties, but not all are listed in
the docs, and you
> >don't get
> >all that are listed in the docs.
>
> I get 31 properties in a Writer or Calc document.
Hmm. I get 33 - no matter whether I use basic or java. (OOo
2.1 680_m6 (9095) -
Sun provided german build)
And in calc as well the props-Array contains 33 entries.
> You can read them easily in Basic with Xray macro.
> Xray thisComponent.DocumentInfo
When I set a watch on xprops and have a look at it, it has
the 33 properties as
well.
> >(look e.g. for the "Language" property
listed in the docs. It is not
> >available. Instead you got a property
"CharLocale")
>
> Language is documented but does not exist.
> CharLocale is not documented in DocumentInfo page, and
does not exist in
> DocumentInfo object.
But why is it included in the poperties then?
It is true that the doc has this property, but it has others
as well that are
not included in the set returned.
> CharLocale is directly accessible (with Basic) from the
document itself.
Well - that should not be possible in java, but I get it
there as well.
//xtd is XTextDocument
XDocumentInfoSupplier xdis =
(XDocumentInfoSupplier)UnoRuntime.queryInterface(
XDocumentInfoSupplier.class,xtd);
XDocumentInfo xdi = xdis.getDocumentInfo();
XPropertySet xps =
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,x
di);
XPropertySetInfo xpsi = xps.getPropertySetInfo();
Property[] props = xpsi.getProperties();
for (int i = 0; i < props.length; i++) {
xText.insertString(xCursor, i +": "+
props[i].Name, false);
}
Gives me the same properties as in basic.
But maybe you meant this as a workaround and I got your
wrong?
> >Is the problem the documentation? Is the problem in
the functionality of
> >the Office?
> >
> Documentation is incorrect. See Issue 26672 created
nearly 3 years ago.
That talks about StandaloneDocumentInfo, but I want to query
real DocumentInfo
- not sure whether that is still the same
ciao
Christian
--
NP: Bif Naked - Daddy's Getting Married
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: DocumentInfo: Wrong documentation,
broken functionality or PEBKAC? |

|
2007-02-02 09:17:54 |
Bernard Marcelly schrieb:
> Hi,
> some remarks inserted in your message...
>
> Message de Christian Lohmaier date 2007-02-02 12:38 :
>> Hi *,
>>
>> I got some trouble with the DocumentInfo's
properties.
>>
file:///opt/openoffice.org2.1_sdk/docs/common/ref/com/sun/st
ar/document/DocumentInfo.html
>> http://api.openoffice.org/docs/
common/ref/com/sun/star/document/DocumentInfo.html
>>
>> The properties I can query don't match those that
are listed in the
>> reference.
(snip)
> Documentation is incorrect. See Issue 26672 created
nearly 3 years ago.
You are right. Perhaps you could help us getting the
documentation right
by compiling a complete list of all properties you get from
a
DocumentInfo object in OOo2.1 and attaching it to the issue?
We can
review it if something is missing or superfluous and then
either change
the documentation or the implementation or both of them.
BTW: StandaloneDocument info and DocumentInfo should support
the same
properties. They only differ in the way they are created.
The first is
loaded from a URL, the second is retrieved from a running
document.
Ciao,
Mathias
--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/Gu
llFOSS
Please don't reply to "nospamformba gmx.de".
I use it for the OOo lists and only rarely read other mails
sent to it.
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: DocumentInfo: Wrong documentation,
broken functionality or PEBKAC? |

|
2007-02-03 03:45:55 |
Message de Christian Lohmaier date 2007-02-02 14:38 :
> Hi Bernard, *,
>
> On Fri, Feb 02, 2007 at 01:40:32PM +0100, Bernard
Marcelly wrote:
>> Message de Christian Lohmaier date 2007-02-02
12:38 :
>>> I got some trouble with the DocumentInfo's
properties.
>>>
file:///opt/openoffice.org2.1_sdk/docs/common/ref/com/sun/st
ar/document/DocumentInfo.html
>>> http://api.openoffice.org/docs/
common/ref/com/sun/star/document/DocumentInfo.html
>>>
>>> The properties I can query don't match those
that are listed in the
>>> reference.
>>> [...]
>>> You'll get 33 Properties, but not all are
listed in the docs, and you
>>> don't get
>>> all that are listed in the docs.
>> I get 31 properties in a Writer or Calc document.
>
> Hmm. I get 33 - no matter whether I use basic or java.
(OOo 2.1 680_m6 (9095) -
> Sun provided german build)
> And in calc as well the props-Array contains 33
entries.
Hi,
I use OpenOffice.org version 2.0.4, not 2.1.
From what I can see with version 2.0.4, the list described
in the Issue
26672 is still valid:
-- Additional comments from as Tue Oct 19 08:11:25
Info:
The following properties are described inside IDL but not
implemented:
- "Generator"
- "Language"
- "Theme"
The following properties are implemented but not described
inside IDL:
- "EditingCycles"
- "EditingDuration"
- "SaveVersionOnClose"
- "TemplateFileName"
It seems 2 new entries have appeared in 2.1 ?
Regards
Bernard
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: DocumentInfo: Wrong documentation,
broken functionality or PEBKAC? |

|
2007-02-03 06:50:24 |
Hi *,
On Sat, Feb 03, 2007 at 10:45:55AM +0100, Bernard Marcelly
wrote:
> Message de Christian Lohmaier date 2007-02-02 14:38 :
> >On Fri, Feb 02, 2007 at 01:40:32PM +0100, Bernard
Marcelly wrote:
> >>Message de Christian Lohmaier date 2007-02-02
12:38 :
> >>>I got some trouble with the DocumentInfo's
properties.
>
>>>file:///opt/openoffice.org2.1_sdk/docs/common/re
f/com/sun/star/document/DocumentInfo.html
> >>>http://api.openoffice.org/docs/
common/ref/com/sun/star/document/DocumentInfo.html
> >>[31 instead of 33 properties]
> I use OpenOffice.org version 2.0.4, not 2.1.
Ah, OK, that would explain the difference.
> From what I can see with version 2.0.4, the list
described in the Issue
> 26672 is still valid:
>
> -- Additional comments from as Tue Oct 19 08:11:25
> Info:
> The following properties are described inside IDL but
not implemented:
> - "Generator"
> - "Language"
> - "Theme"
These are still missing
> The following properties are implemented but not
described inside IDL:
> - "EditingCycles"
> - "EditingDuration"
> - "SaveVersionOnClose"
> - "TemplateFileName"
These are present as well.
> It seems 2 new entries have appeared in 2.1 ?
Yes, the additional two are:
CharLocale
DocumentStatistic
But both return a void object when queried...
/me will update the issue accordingly
ciao
Christian
--
NP: Slipknot - Disasterpiece
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
[1-6]
|
|