use of org.nuxeo.ecm.core.api.CoreSession in project nuxeo-drive-server by nuxeo.
the class AbstractFileSystemItemFactory method getDocumentByFileSystemId.
@Deprecated
@Override
public DocumentModel getDocumentByFileSystemId(String id, Principal principal) {
// Parse id, expecting
// pattern:fileSystemItemFactoryName#repositoryName#docId
String[] idFragments = parseFileSystemId(id);
String repositoryName = idFragments[1];
String docId = idFragments[2];
CoreSession session = Framework.getService(FileSystemItemManager.class).getSession(repositoryName, principal);
return getDocumentById(docId, session);
}
use of org.nuxeo.ecm.core.api.CoreSession in project nuxeo-filesystem-connectors by nuxeo.
the class AbstractBackendFactory method getBackend.
@Override
public Backend getBackend(String path, HttpServletRequest request) {
if (request == null) {
throw new NullPointerException("null request");
}
Backend backend = (Backend) request.getAttribute(WIRequestFilter.BACKEND_KEY);
if (backend == null) {
// create backend from WebEngine session
WebContext webContext = WebEngine.getActiveContext();
if (webContext == null) {
throw new NullPointerException("null WebContext");
}
CoreSession session = webContext.getCoreSession();
if (session == null) {
throw new NullPointerException("null CoreSession");
}
backend = createRootBackend(session);
request.setAttribute(WIRequestFilter.BACKEND_KEY, backend);
}
return backend.getBackend(path);
}
Aggregations