- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2012 01:55 PM
More specifically, how do I differentiate between the immediate parent and the parent of the parent(grandparent) when using the JAVA code below?
DocumentModel x = session.getParentDocument( input.getParentRef());
where session is the injected session and input is a reference to the current document's DocumentModel.
If I look at x.getType() the type is the parent of the parent (grandparent) not the parent document.
The documents on all three levels are folders (from bottom to top a folder, in a folder, in a folder)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2012 04:55 PM
Ok, found out what I was doing incorrectly.
parentDoc = session.getParentDocument(input.getParentRef());
should be
parentDoc = session.getDocument(input.getParentRef());
I was getting the parent of the parent and therefore skipping over the immediate parent document.
Pilot error!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2012 03:20 PM
Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-20-2012 04:55 PM
Ok, found out what I was doing incorrectly.
parentDoc = session.getParentDocument(input.getParentRef());
should be
parentDoc = session.getDocument(input.getParentRef());
I was getting the parent of the parent and therefore skipping over the immediate parent document.
Pilot error!!!!