Bug 27024 - ContentImpl.create() always sets displayname to resource name.
Summary: ContentImpl.create() always sets displayname to resource name.
Status: RESOLVED FIXED
Alias: None
Product: Slide
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.0
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-18 09:05 UTC by Willie Vu
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Willie Vu 2004-02-18 09:05:15 UTC
I want to create a resource whose displayname differs from its resource name.
.e.g.  /files/john/file1.txt whose displayname is "My File.txt". 
ContentImpl.create() will always stores displayname as file1.txt instead of "My
File.txt" because it always invokes 

revisionDescriptor.setName(resourceName);

A null check should be performed before setting revisionDescriptor's name.
Comment 1 Oliver Zeigermann 2004-02-26 09:32:43 UTC
Which methode, which line? Can you provide a patch?
Comment 2 Willie Vu 2004-02-26 10:12:35 UTC
Line 496:

revisionDescriptor.setName(new UriPath(strUri).lastSegment());

Should there a check to see if the name is null or empty, just like the one in
setDefaultProperties() at line 1392?

if (revisionDescriptor.getName() == null ||
revisionDescriptor.getName().length() == 0) {
                UriPath uripath = new UriPath(associatedObject.getUri());
                revisionDescriptor.setName(uripath.lastSegment());
            }
Comment 3 Oliver Zeigermann 2004-02-26 11:32:28 UTC
OK, got it. I have seen there are other spots in the Slide code (like in
VersioningHelper) affected by this. So I fixed this in the release branch as
well as in the HEAD.