Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$entry->getContentLink gets all links in a folder #6

Open
jbueren opened this issue Nov 11, 2014 · 1 comment
Open

$entry->getContentLink gets all links in a folder #6

jbueren opened this issue Nov 11, 2014 · 1 comment

Comments

@jbueren
Copy link

jbueren commented Nov 11, 2014

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):

2014-11-11 13:50:07 887 [6886] : link: http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/content/Auswertung%20Januar?id=259f2aab-4ffb-43ff-8538-76b145dd56b6%3B1.0http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/content/Linet%20201400174.pdf?id=bda076b2-1d20-4121-81d2-423d71ea9084%3B1.0http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/content/Bildband_323%20Januar%202014.pdf?id=37bcf690-0d0c-483c-807d-bccc7c570867%3B1.0http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.0/atom/content/Jahresbereicht%2014.02.2014.pdf?id=6ad3e2bc-9cb1-4e4c-a2af-dcb73e3db917%3B1.0http://localhost:8080/

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!

@jbueren
Copy link
Author

jbueren commented Nov 12, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant