$entry->getContentLink gets all links in a folder
Opened this issue · 1 comments
If I iterate over all entries in a given folder, like this:
while ((my $entry = $child_content->getNext())){
a) Dump($entry)
b) my $link = $entry->getContentLink();
}
a) if I dump just the entry, I get only the name of the doc (cmis:title = mydoc):
'cmis:name' => bless( {
'queryName' => 'cmis:name',
'propertyDefinitionId' => 'cmis:name',
'localName' => 'name',
'value' => "Auswertung Januar.pdf",
'displayName' => 'Name'
}, 'WebService::Cmis::Property::String' ),
That's great and this is what I expect, but:
b) gives me all links concated for all entries in this folder like this (just showing the first three):
I connect to the atom repo with localhost:8080, maybe the domain with the corresponding port is somewhere not escaped / interpolated or regexed correctly?
Here is my binding URL for Alfresco 4.2f:
http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom
Thanks!
Hi, I wrote a short script to clarify this issue. The problem is indeed that I get more than one:
"content src" xml-entry in the server reply.
Here are my params:
I connect against Alfresco 4.2f, with the atom pub binding 1.0:
my $source_folder = $repo->getObjectByPath("/Benutzer-Homes/kopierer/eingescannte Belege/");
# simple return if we can't find a folder
if (!$source_folder) {
exit;
}
my $child_content = $source_folder->getChildren();
# iterate all entries
while ((my $entry = $child_content->getNext())){
# for now we skip folders
next if ($entry->isa("WebService::Cmis::Folder"));
print "entry: " . Dumper($entry);
# this entry has all the "content src"-entries in the xml answer
# for all documents in the folder
my $entry_object_id = $entry->getProperty("cmis:objectId");
my $single_entry = $repo->getObject($entry_object_id);
print "mein einfacher eintrag:" . Dumper($single_entry);
# this entry is fine
}
Therefore my first idea (wrong regex etc) is plain wrong. Something else is mixed up.
Just a guess: It seems, that $child_content->getNext, gets all the correct attributes, but is not getting the 'new' atom feed (just for this single element).
I can upload the script or do a test against a official repo or whatever might be helpful.
Thanks,
Jan