You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Chris Hubick (JIRA)" <ji...@apache.org> on 2010/02/03 02:19:18 UTC

[jira] Created: (CMIS-110) Broken APP Folder Tree and Descendant Processing

Broken APP Folder Tree and Descendant Processing
------------------------------------------------

                 Key: CMIS-110
                 URL: https://issues.apache.org/jira/browse/CMIS-110
             Project: Chemistry
          Issue Type: Bug
          Components: atompub
            Reporter: Chris Hubick


Hi.

When using the CMIS Folder Tree and Descendant functions with Alfresco, I get back an Atom 'feed' containing 'entry' elements, which have a cmis/restatom 'children' element, which then recursively holds further Atom 'entry' elements for the child documents of the parent entry.  These recursive 'entry' elements are currently ignored by Chemistry.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CMIS-110) Broken APP Folder Tree and Descendant Processing

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831989#action_12831989 ] 

Florent Guillaume commented on CMIS-110:
----------------------------------------

You're right that the current implementation doesn't deal with nesting correctly.

I'd like to think a bit more about the proper fix though, as I'm not sure adding a parent reference in the ObjectEntry is the correct way to represent nesting. I'd prefer to have a generic Tree<ObjectEntry> datastructure that represents that, and is returned correctly by the APIs, especially getDescendants.

The other side of the issue that has to be tackled is the server side, and doing actual generation of the proper nested feed in CMISChildrenCollection.

If you don't want to work on this right now it's all right, I'll need it soon to be spec compliant so I'll get started on it in the coming days.


> Broken APP Folder Tree and Descendant Processing
> ------------------------------------------------
>
>                 Key: CMIS-110
>                 URL: https://issues.apache.org/jira/browse/CMIS-110
>             Project: Chemistry
>          Issue Type: Bug
>          Components: atompub
>            Reporter: Chris Hubick
>         Attachments: chemistry_parent_entity.patch
>
>
> Hi.
> When using the CMIS Folder Tree and Descendant functions with Alfresco, I get back an Atom 'feed' containing 'entry' elements, which have a cmis/restatom 'children' element, which then recursively holds further Atom 'entry' elements for the child documents of the parent entry.  These recursive 'entry' elements are currently ignored by Chemistry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CMIS-110) Broken Folder Tree and Descendants processing

Posted by "David Caruana (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CMIS-110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12834705#action_12834705 ] 

David Caruana commented on CMIS-110:
------------------------------------

It depends on which version of Alfresco you're testing against.

The spec expects a feed within children, but this was a recent change. So, Alfresco 3.2r2 does not include this change, but http://cmis.alfresco.com does.

Hope that clarifies the situation.

> Broken Folder Tree and Descendants processing
> ---------------------------------------------
>
>                 Key: CMIS-110
>                 URL: https://issues.apache.org/jira/browse/CMIS-110
>             Project: Chemistry
>          Issue Type: Bug
>          Components: atompub
>            Reporter: Chris Hubick
>            Assignee: Florent Guillaume
>         Attachments: chemistry_parent_entity.patch
>
>
> Hi.
> When using the CMIS Folder Tree and Descendant functions with Alfresco, I get back an Atom 'feed' containing 'entry' elements, which have a cmis/restatom 'children' element, which then recursively holds further Atom 'entry' elements for the child documents of the parent entry.  These recursive 'entry' elements are currently ignored by Chemistry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CMIS-110) Broken Folder Tree and Descendants processing

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent Guillaume resolved CMIS-110.
------------------------------------

    Resolution: Fixed
      Assignee: Florent Guillaume

This is now implemented.
r909458

SPI.getDescendants and SPI.getFolderTree now return a Tree<ObjectEntry> which is a recursive datastructure.
This is correctly produced by the AtomPub server, and read by the AtomPub client.


> Broken Folder Tree and Descendants processing
> ---------------------------------------------
>
>                 Key: CMIS-110
>                 URL: https://issues.apache.org/jira/browse/CMIS-110
>             Project: Chemistry
>          Issue Type: Bug
>          Components: atompub
>            Reporter: Chris Hubick
>            Assignee: Florent Guillaume
>         Attachments: chemistry_parent_entity.patch
>
>
> Hi.
> When using the CMIS Folder Tree and Descendant functions with Alfresco, I get back an Atom 'feed' containing 'entry' elements, which have a cmis/restatom 'children' element, which then recursively holds further Atom 'entry' elements for the child documents of the parent entry.  These recursive 'entry' elements are currently ignored by Chemistry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (CMIS-110) Broken Folder Tree and Descendants processing

Posted by "Chris Hubick (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Hubick reopened CMIS-110:
-------------------------------


The current code expects the AtomPubCMIS.CHILDREN element to contain an AtomPub.ATOM_FEED, but Alfresco is returning a sequence of AtomPub.ATOM_ENTRY elements, causing the AbstractObjectReader.readChildren(...) implementation's call to APPObjectFeedTreeReader.read(...) to throw "XMLStreamException: Parse error: Not an atom feed" :(

Or is Alfresco doing the wrong thing here?

I looked into patching this similarly to my original patch, which just had AbstractObjectReader call it's own read(...), but I gave up around the point where I then noticed the 'tree' argument to AbstractObjectReader<T>.setChildren(T object, List<Tree<ObjectEntry>> tree) isn't specified in terms of <T>, which is what you will get back from a recursive AbstractObjectReader.read(...) call.


> Broken Folder Tree and Descendants processing
> ---------------------------------------------
>
>                 Key: CMIS-110
>                 URL: https://issues.apache.org/jira/browse/CMIS-110
>             Project: Chemistry
>          Issue Type: Bug
>          Components: atompub
>            Reporter: Chris Hubick
>            Assignee: Florent Guillaume
>         Attachments: chemistry_parent_entity.patch
>
>
> Hi.
> When using the CMIS Folder Tree and Descendant functions with Alfresco, I get back an Atom 'feed' containing 'entry' elements, which have a cmis/restatom 'children' element, which then recursively holds further Atom 'entry' elements for the child documents of the parent entry.  These recursive 'entry' elements are currently ignored by Chemistry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CMIS-110) Broken Folder Tree and Descendants processing

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent Guillaume updated CMIS-110:
-----------------------------------

    Summary: Broken Folder Tree and Descendants processing  (was: Broken APP Folder Tree and Descendant Processing)

> Broken Folder Tree and Descendants processing
> ---------------------------------------------
>
>                 Key: CMIS-110
>                 URL: https://issues.apache.org/jira/browse/CMIS-110
>             Project: Chemistry
>          Issue Type: Bug
>          Components: atompub
>            Reporter: Chris Hubick
>         Attachments: chemistry_parent_entity.patch
>
>
> Hi.
> When using the CMIS Folder Tree and Descendant functions with Alfresco, I get back an Atom 'feed' containing 'entry' elements, which have a cmis/restatom 'children' element, which then recursively holds further Atom 'entry' elements for the child documents of the parent entry.  These recursive 'entry' elements are currently ignored by Chemistry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CMIS-110) Broken Folder Tree and Descendants processing

Posted by "Florent Guillaume (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Florent Guillaume resolved CMIS-110.
------------------------------------

    Resolution: Fixed

Chris, I'll close this again, as it seems the problem you had was an interop issue with a server implementing a slightly older version of the spec.


> Broken Folder Tree and Descendants processing
> ---------------------------------------------
>
>                 Key: CMIS-110
>                 URL: https://issues.apache.org/jira/browse/CMIS-110
>             Project: Chemistry
>          Issue Type: Bug
>          Components: chemistry-atompub
>            Reporter: Chris Hubick
>            Assignee: Florent Guillaume
>         Attachments: chemistry_parent_entity.patch
>
>
> Hi.
> When using the CMIS Folder Tree and Descendant functions with Alfresco, I get back an Atom 'feed' containing 'entry' elements, which have a cmis/restatom 'children' element, which then recursively holds further Atom 'entry' elements for the child documents of the parent entry.  These recursive 'entry' elements are currently ignored by Chemistry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CMIS-110) Broken APP Folder Tree and Descendant Processing

Posted by "Chris Hubick (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CMIS-110?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Hubick updated CMIS-110:
------------------------------

    Attachment: chemistry_parent_entity.patch

The attached patch tackles several issues with current Chemistry.

First, EntryReader needs some way to return not just the Entry being processed, but also any nested children.  This core of this patch is a modification to the EntryReader methods to return a List of results instead of a single one.

That way, when AbstractObjectReader encounters a nested Entry, it can call itself to process it recursively, and add those entries to it's own result list.

The second problem, is that when calling the Folder Tree and Descendant methods, all the APPObjectEntry's are grouped into a single result list, losing the original hierarchical structure.  This isn't so much of a problem for folders, because the parentId property can be used to infer that structure, but documents don't use parentId.  I thought about introducing a fake "parentId" property, but I don't think that's a good idea (complications saving, etc), so this patch tackles this by introducing an APPObjectEntry 'parent' member.  This enables a method like:

  public static final boolean isChild(final APPObjectEntry folder, final APPObjectEntry object) {
    if (object.getParent().getId().equals(folder.getId())) return true;
    return folder.getId().equals(object.getValue(Property.PARENT_ID));
  }

Which will work when the 'object' arg is a folder or a document.


> Broken APP Folder Tree and Descendant Processing
> ------------------------------------------------
>
>                 Key: CMIS-110
>                 URL: https://issues.apache.org/jira/browse/CMIS-110
>             Project: Chemistry
>          Issue Type: Bug
>          Components: atompub
>            Reporter: Chris Hubick
>         Attachments: chemistry_parent_entity.patch
>
>
> Hi.
> When using the CMIS Folder Tree and Descendant functions with Alfresco, I get back an Atom 'feed' containing 'entry' elements, which have a cmis/restatom 'children' element, which then recursively holds further Atom 'entry' elements for the child documents of the parent entry.  These recursive 'entry' elements are currently ignored by Chemistry.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.