use of org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectParentDataImpl in project structr by structr.
the class CMISNavigationService method getObjectParents.
@Override
public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String propertyFilter, Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter, Boolean includeRelativePathSegment, ExtensionsData extension) {
final App app = StructrApp.getInstance();
try (final Tx tx = app.tx()) {
final List<ObjectParentData> data = new LinkedList<>();
final AbstractFile graphObject = app.get(AbstractFile.class, objectId);
final Folder parent = graphObject.getParent();
final ObjectData element = parent != null ? CMISObjectWrapper.wrap(parent, propertyFilter, includeAllowableActions) : new CMISRootFolder(propertyFilter, includeAllowableActions);
final ObjectParentDataImpl impl = new ObjectParentDataImpl(element);
impl.setRelativePathSegment(graphObject.getProperty(AbstractNode.name));
data.add(impl);
tx.success();
return data;
} catch (Throwable t) {
logger.warn("", t);
}
return null;
}
Aggregations