Issue 121922 - webdav ucp: getPropertyValues returns empty values after the first call
webdav ucp: getPropertyValues returns empty values after the first call
Status: RESOLVED FIXED
Product: General
Classification: Code
Component: code
3.4.0
All All
: P3 normal (vote)
: 4.0.0
Assigned To: Ariel Constenla-Haile
:
Depends on:
Blocks: 121202 121584
  Show dependency treegraph
 
Reported: 2013-03-20 06:50 UTC by Ariel Constenla-Haile
Modified: 2013-03-24 13:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ariel Constenla-Haile 2013-03-20 06:50:00 UTC
Retrieve one or more properties from a webdav content. For example:

Testing http://people.apache.org/~arielch/images/avatar.png

ContentType: 
IsDocument: 1
IsFolder: 0
DateCreated: 00-00-0000 00:00:00
DateModified: 02-18-2013 09:10:31
MediaType: image/png
Size: 81635
Title: avatar.png


Retrieve one or more properties once again:

ContentType: 
IsDocument: 1
IsFolder: 0
DateCreated: 00-00-0000 00:00:00
DateModified: 00-00-0000 00:00:00
MediaType: image/png
Size: <empty>
Title: avatar.png

Non-cacheable properties, like Size and DateModified are empty after the first execution of getPropertyValues
Comment 1 Ariel Constenla-Haile 2013-03-20 07:02:55 UTC
The condition on http://svn.apache.org/viewvc/incubator/ooo/trunk/main/ucb/source/ucp/webdav/webdavcontent.cxx?revision=1294557&view=markup#l1328 seems wrong:

1328 	// All properties obtained already?
1329 	std::vector< rtl::OUString > aMissingProps;
1330 	if ( !( xProps.get()
1331 	&& xProps->containsAllNames(
1332 	rProperties, aMissingProps ) )
1333 	&& !m_bDidGetOrHead )

IF there are properties that are not cached AND we didn't already perform a GET or HEAD, then ...

the first time "getPropertyValues" or "open" is executed, cacheable properties are stored (enhancement: instead of caching all cacheable properties in the response, only those explicitly asked are cached), and m_bDidGetOrHead is set to true.

If you execute again "getPropertyValues", m_bDidGetOrHead is true, so the code doesn't perform a HEAD request again; if you ask for non-cacheable properties, you get empty Anys.

Non-cacheable properties are the ones defined in aNonCachableProps (correct English seems to be cacheable)
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/ucb/source/ucp/webdav/ContentProperties.cxx?revision=1292794&view=markup#l588
Comment 2 SVN Robot 2013-03-24 13:20:49 UTC
"arielch" committed SVN revision 1460353 into trunk:
i121922 - Fix wrong condition
Comment 3 Ariel Constenla-Haile 2013-03-24 13:27:50 UTC
Fixed on trunk